Beispiel #1
0
 /**
  * Returns the instance of DrawActivity class with default values of pOnlyIncludeForeground and button visibility settings.
  *
  * @param caller The calling object, to be used for callbacks.
  */
 public static DrawActivity getInstance(DrawActivityOnResult caller)
 {
     return getInstance(caller, false);
 }
Beispiel #2
0
 /**
  * Returns the instance of DrawActivity class with default values of button visibility settings.
  *
  * @param caller The calling object, to be used for callbacks.
  * @param pOnlyIncludeForeground If true, only foreground of the drawn image will be returned as a result of this activity. If false, also
  * background will be included.
  */
 public static DrawActivity getInstance(DrawActivityOnResult caller, bool pOnlyIncludeForeground)
 {
     return getInstance(caller, pOnlyIncludeForeground, true, true, true, true, true, true, true, true, true);
 }
Beispiel #3
0
    /**
     * Returns the instance of DrawActivity class with given button visibility settings.
     *
     * @param caller Calling object, to be used for callbacks.
     * @param pOnlyIncludeForeground If true, only foreground of the drawn image will be returned as a result of this activity. If false, also
     * background will be included.
     * @param showPenBtn
     *            Pen button visibility flag.
     * @param showEraserBtn
     *            Eraser button visibility flag.
     * @param showTextBtn
     *            Text button visibility flag.
     * @param showFillingBtn
     *            Filling button visibility flag.
     * @param showColorPickerBtn
     *            Color picker button visibility flag.
     * @param showInsertBtn
     *            Insert button visibility flag.
     * @param showUndoBtn
     *            Undo button visibility flag.
     * @param showRedoBtn
     *            Redo button visibility flag.
     * @param showSaveBtn
     *            Save button visibility flag.
     */
    public static DrawActivity getInstance(DrawActivityOnResult caller, bool pOnlyIncludeForeground, bool showPenBtn, bool showEraserBtn, 
		bool showTextBtn, bool showFillingBtn, bool showColorPickerBtn, bool showInsertBtn, bool showUndoBtn, bool showRedoBtn, bool showSaveBtn)
    {
        ZLog.Log ("DrawActivity getInstance start");

        if (caller == null)
            return null;

        if ((mSPenManager = GameObject.Find("_SPenManager")) == null) {
            ZLog.Log ("DrawActivity getInstance - creating manager game object.");
            mSPenManager = new GameObject ("_SPenManager");
            AndroidJNI.AttachCurrentThread ();
            AndroidJNIHelper.debug = true;
        }

        if ((mInstance = mSPenManager.GetComponent<DrawActivity> ()) == null) {
            ZLog.Log ("DrawActivity getInstance - adding component to manager game object.");
            mInstance = mSPenManager.AddComponent<DrawActivity> ();
            mInstance.mUnityPlayerClass = new AndroidJavaClass ("com.unity3d.player.UnityPlayer");
        }

        mInstance.mCallingActivity = mInstance.mUnityPlayerClass.GetStatic<AndroidJavaObject> ("currentActivity");
        mInstance.mCaller = caller;
        mInstance.mOnlyIncludeForeground = pOnlyIncludeForeground;
        mInstance.mShowPenSettings = showPenBtn;
        mInstance.mShowEraser = showEraserBtn;
        mInstance.mShowText = showTextBtn;
        mInstance.mShowFilling = showFillingBtn;
        mInstance.mShowColorPicker = showColorPickerBtn;
        mInstance.mShowInsertBtn = showInsertBtn;
        mInstance.mShowUndo = showUndoBtn;
        mInstance.mShowRedo = showRedoBtn;
        mInstance.mShowSave = showSaveBtn;

        ZLog.Log ("DrawActivity getInstance - returning instance.");
        return mInstance;
    }