コード例 #1
0
        public override bool onOptionsItemSelected(MenuItem item)
        {
            if (item.ItemId == COLOR_MENU_ID)
            {
                (new ColorPickerDialog(this, this, unchecked ((int)0xFFFF0000))).show();
                return(true);
            }
            else if (item.ItemId == CLEAR_MENU_ID)
            {
                mDrawingView.cleanup();
                mSegmentsRef.removeValue(new CompletionListenerAnonymousInnerClassHelper(this));

                return(true);
            }
            else if (item.ItemId == PIN_MENU_ID)
            {
                SyncedBoardManager.toggle(mFirebaseRef.child("boardsegments"), mBoardId);
                item.Checked = SyncedBoardManager.isSynced(mBoardId);
                return(true);
            }
            else
            {
                return(base.onOptionsItemSelected(item));
            }
        }
コード例 #2
0
        public override bool onCreateOptionsMenu(Menu menu)
        {
            base.onCreateOptionsMenu(menu);
            // getMenuInflater().inflate(R.menu.menu_drawing, menu);

            menu.add(0, COLOR_MENU_ID, 0, "Color").setShortcut('3', 'c').setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
            menu.add(0, CLEAR_MENU_ID, 2, "Clear").setShortcut('5', 'x');
            menu.add(0, PIN_MENU_ID, 3, "Keep in sync").setShortcut('6', 's').setIcon(android.R.drawable.ic_lock_lock).setCheckable(true).setChecked(SyncedBoardManager.isSynced(mBoardId));

            return(true);
        }