Exemple #1
0
        void EnterReplaceManyMode()
        {
            SetTitle("Edit: Replace Many");
            mReplaceButton.Show();

            mTapDetector = new TapGestureDetector();

            for (uint i = 0; i < mItemView.GetChildCount(); ++i)
            {
                View child = mItemView.GetChildAt(i);
                View box   = child.FindChildByName("CheckBox");

                if (box)
                {
                    mTapDetector.Attach(child);
                    box.Show();
                }
            }

            mTapDetector.Detected += (obj, e) =>
            {
                View tick = (e.View).FindChildByName("Tick");
                if (tick)
                {
                    if (tick.Visibility)
                    {
                        tick.Hide();
                    }
                    else
                    {
                        tick.Show();
                    }
                }
            };
        }
Exemple #2
0
        private View Instance_PreFocusChange(object source, FocusManager.PreFocusChangeEventArgs e)
        {
            View nextView;

            Tizen.Log.Debug("NUI", "Instance_PreFocusChange = " + e.Direction.ToString());

            //added
            if (e.CurrentView == null)
            {
                e.CurrentView = label[0];
            }
            if (e.ProposedView == null)
            {
                e.ProposedView = label[0];
            }

            int index = Array.FindIndex(label, x => x == e.CurrentView);

            Tizen.Log.Debug("NUI", "index = " + index);

            switch (e.Direction)
            {
            case View.FocusDirection.Up:
                index = (index + numOfSamples - 2) % numOfSamples;      //changed
                _ani.Play();
                break;

            case View.FocusDirection.Down:
                index = (index + 2) % numOfSamples;                                                                                    //changed
                Tizen.Log.Debug("NUI", "pushbutton1 Visible=" + pushButton1.Visible + "  pushbutton2 Visible=" + pushButton2.Visible); //added
                break;

            case View.FocusDirection.Left:
                //added
                pushButton1.Show();
                pushButton2.Show();
                break;

            case View.FocusDirection.Right:
                //added
                pushButton1.Hide();
                pushButton2.Hide();
                break;

            default:
                break;
            }

            Tizen.Log.Debug("NUI", "next index = " + index);
            nextView = label[index];

            if (e.CurrentView.HasFocus())
            {
                //currentView?.ClearKeyInputFocus();  //removed
            }
            //nextView?.SetKeyInputFocus();  //removed

            return(nextView);
        }
Exemple #3
0
        void EnterRemoveManyMode()
        {
            SetTitle("Edit: Remove Many");
            mDeleteButton.Show();

            mTapDetector = new TapGestureDetector();

            for (uint i = 0; i < mItemView.GetChildCount(); ++i)
            //for (uint i = 0; i < ITEM_COUNT; ++i)
            {
                View child = mItemView.GetChildAt(i);
                if (child != null)
                {
                    View box = child.FindChildByName("CheckBox");
                    if (box)
                    {
                        mTapDetector.Attach(child);
                        box.Show();
                    }
                }
            }

            mTapDetector.Detected += (obj, e) =>
            {
                View view = e.View;
                if (view != null)
                {
                    Console.WriteLine("haha");
                    View tick = view.FindChildByName("Tick");
                    if (tick != null)
                    {
                        if (tick.Visibility)
                        {
                            tick.Hide();
                        }
                        else
                        {
                            tick.Show();
                        }
                    }
                }
                else
                {
                    Tizen.Log.Fatal("NUI", "e.View is null when EnterRemoveManyMode!");
                }
            };
        }
Exemple #4
0
        void EnterInsertManyMode()
        {
            SetTitle("Edit: Insert Many");
            mInsertButton.Show();

            mTapDetector = new TapGestureDetector();

            for (uint i = 0; i < mItemView.GetChildCount(); ++i)
            //for (uint i = 0; i < ITEM_COUNT; ++i)
            {
                View child = mItemView.GetChildAt(i);
                if (child != null)
                {
                    View box = child.FindChildByName("CheckBox");

                    if (box)
                    {
                        mTapDetector.Attach(child);
                        box.Show();
                    }
                }
            }
            mTapDetector.Detected += (obj, e) =>
            {
                if (e.View != null)
                {
                    View tick = (e.View).FindChildByName("Tick");
                    if (tick)
                    {
                        if (tick.Visibility)
                        {
                            tick.Hide();
                        }
                        else
                        {
                            tick.Show();
                        }
                    }
                }
                else
                {
                    Tizen.Log.Fatal("NUI", "e.View is null when EnterInsertManyMode!");
                }
            };
        }