private void MToolBar_MenuItemClick(object sender, SupportToolbar.MenuItemClickEventArgs e)
 {
     if (e.Item.ItemId == Resource.Id.menuItemClear)
     {
         mEtDescription.Text = "";
     }
 }
Ejemplo n.º 2
0
 private void TabsToolbar_MenuItemClick(object sender, Toolbar.MenuItemClickEventArgs e)
 {
     if (e.Item.ItemId == Resource.Id.action_add)
     {
         StartActivity(typeof(NewDeliveryActivity));
     }
 }
Ejemplo n.º 3
0
        private async void MainToolbar_MenuItemClick(object sender, SupportToolBar.MenuItemClickEventArgs e)
        {
            switch (e.Item.ItemId)
            {
            case Resource.Id.menu_logout:

                ProgressDialog dialog = ProgressDialog.Show(this, "", "Logging out...");

                await MeritMoneyBrain.LogOut();

                ProfileDatabase pdb = new ProfileDatabase();
                pdb.DeleteDatabase();

                UsersDatabase udb = new UsersDatabase();
                udb.DeleteDatabase();

                ISharedPreferences       info   = Application.Context.GetSharedPreferences(Application.Context.GetString(Resource.String.ApplicationInfo), FileCreationMode.Private);
                ISharedPreferencesEditor editor = info.Edit();
                editor.Clear();
                editor.Apply();

                dialog.Dismiss();

                Intent LogInIntent = new Intent(this, typeof(LogInActivity));
                this.StartActivityForResult(LogInIntent, LOG_IN_REQUEST);
                break;
            }
        }
        private void MToolBar_MenuItemClick(object sender, SupportToolbar.MenuItemClickEventArgs e)
        {
            if (e.Item.ItemId == Resource.Id.menuItem_copy)
            {
                //copy here
                GlobalVariables.parentProductCopyHolder.Clear();
                GlobalVariables.newProductCopyHolder.Clear();
                CopyData();
                Toast.MakeText(this, "Product copied!", ToastLength.Long).Show();
            }
            else if (e.Item.ItemId == Resource.Id.menuItem_paste)
            {
                if (GlobalVariables.parentProductCopyHolder.Count > 0)
                {
                    Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(this);
                    Android.App.AlertDialog         alert   = builder.Create();
                    alert.SetTitle("Confirm action");
                    alert.SetMessage("Paste copied product?");

                    alert.SetButton2("CANCEL", (c, ev) =>
                    {
                        //cancel button
                    });

                    alert.SetButton("YES", (c, ev) =>
                    {
                        PasteData(GlobalVariables.parentProductCopyHolder, GlobalVariables.newProductCopyHolder);
                        Toast.MakeText(this, "Successfully pasted!", ToastLength.Long).Show();
                    });

                    alert.Show();
                }
                else
                {
                    Toast.MakeText(this, "Clipboard is empty!", ToastLength.Long).Show();
                }
            }
            else if (e.Item.ItemId == Resource.Id.menuItem_delete)
            {
                Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(this);
                Android.App.AlertDialog         alert   = builder.Create();
                alert.SetTitle("Delete product");
                alert.SetMessage("Are you sure you want to delete this product? This action cannot be undone.");

                alert.SetButton2("CANCEL", (c, ev) =>
                {
                    //cancel button
                });

                alert.SetButton("YES", (c, ev) =>
                {
                    //delete code here
                    DeleteProduct(editParentProductId);
                    Finish();
                });

                alert.Show();
            }
        }
 /// <summary>
 ///
 /// </summary>
 private void Toolbar_MenuItemClick(object sender, V7Toolbar.MenuItemClickEventArgs e)
 {
     switch (e.Item.ItemId)
     {
     case Resource.Id.home:
         drawerLayout.OpenDrawer(Android.Support.V4.View.GravityCompat.End);
         break;
     }
 }
        private void MenuClickItem(object sender, SupportToolbar.MenuItemClickEventArgs e)
        {
            setupDateTimeInterpreter(false);
            switch (e.Item.ItemId)
            {
            case Resource.Id.action_today:
                mWeekView.GoToToday();
                break;

            case Resource.Id.action_dayView:
                if (mWeekViewType != TYPE_DAY_VIEW)
                {
                    e.Item.SetChecked(!e.Item.IsChecked);
                    mWeekViewType = TYPE_DAY_VIEW;
                    mWeekView.NumberOfVisibleDays = (1);

                    // Lets change some dimensions to best fit the view.
                    mWeekView.ColumnGap     = (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 8, Resources.DisplayMetrics);
                    mWeekView.TextSize      = (int)TypedValue.ApplyDimension(ComplexUnitType.Sp, 12, Resources.DisplayMetrics);
                    mWeekView.EventTextSize = (int)TypedValue.ApplyDimension(ComplexUnitType.Sp, 12, Resources.DisplayMetrics);
                }
                break;

            case Resource.Id.action_threedays:
                if (mWeekViewType != TYPE_THREE_DAY_VIEW)
                {
                    e.Item.SetChecked(!e.Item.IsChecked);
                    mWeekViewType = TYPE_THREE_DAY_VIEW;
                    mWeekView.NumberOfVisibleDays = (3);

                    // Lets change some dimensions to best fit the view.
                    mWeekView.ColumnGap     = (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 8, Resources.DisplayMetrics);
                    mWeekView.TextSize      = (int)TypedValue.ApplyDimension(ComplexUnitType.Sp, 12, Resources.DisplayMetrics);
                    mWeekView.EventTextSize = (int)TypedValue.ApplyDimension(ComplexUnitType.Sp, 12, Resources.DisplayMetrics);
                }
                break;

            case Resource.Id.action_show_week:
                if (mWeekViewType != TYPE_WEEK_VIEW)
                {
                    setupDateTimeInterpreter(true);
                    e.Item.SetChecked(!e.Item.IsChecked);
                    mWeekViewType = TYPE_WEEK_VIEW;
                    mWeekView.NumberOfVisibleDays = (7);

                    // Lets change some dimensions to best fit the view.
                    mWeekView.ColumnGap     = (int)TypedValue.ApplyDimension(ComplexUnitType.Dip, 2, Resources.DisplayMetrics);
                    mWeekView.TextSize      = (int)TypedValue.ApplyDimension(ComplexUnitType.Sp, 10, Resources.DisplayMetrics);
                    mWeekView.EventTextSize = (int)TypedValue.ApplyDimension(ComplexUnitType.Sp, 10, Resources.DisplayMetrics);
                }
                break;
            }
        }
 private void MToolBar_MenuItemClick(object sender, SupportToolbar.MenuItemClickEventArgs e)
 {
     if (e.Item.ItemId == Resource.Id.menuItemMultipay)
     {
         if (HasUnpaidSales())
         {
             Intent intent = new Intent(this.Context, typeof(RunnersFragmentMultiplePaymentRecords));
             intent.PutExtra("selectedRunnerId", mSelectedRunnerRow[0].Id);
             StartActivityForResult(intent, 41);
         }
     }
 }
Ejemplo n.º 8
0
        private async void MainToolbar_MenuItemClick(object sender, SupportToolBar.MenuItemClickEventArgs e)
        {
            ImagePickerWasPressed = false;

            switch (e.Item.ItemId)
            {
            case Resource.Id.menu_edit:
                if (!isEditing)
                {
                    e.Item.SetTitle("Save");
                    EditingItemsVisible(ViewStates.Visible, ViewStates.Invisible);

                    SaveName        = UserName.Text;
                    SaveSwitchState = NotificationSwitch.Checked;

                    EditName.Text = UserName.Text;

                    ShowKeyboard(EditName);
                    isEditing = true;
                }
                else
                {
                    if (NetworkStatus.State != NetworkState.Disconnected)
                    {
                        e.Item.SetTitle("Edit");

                        EditingItemsVisible(ViewStates.Invisible, ViewStates.Visible);
                        isEditing = false;
                        HideKeyboard(EditName);

                        ProgressDialog progressDialog = ProgressDialog.Show(this, "", "Saving...", true);
                        await HandleResult();

                        progressDialog.Dismiss();
                    }
                    else
                    {
                        Android.Support.V7.App.AlertDialog.Builder dialog = new Android.Support.V7.App.AlertDialog.Builder(this);
                        dialog.SetMessage(GetString(Resource.String.NoInternet));
                        dialog.SetCancelable(true);
                        dialog.SetPositiveButton("OK", this);
                        dialog.Create().Show();

                        HideKeyboard(EditName);
                    }
                }
                SetSwitchState();
                break;
            }
        }
Ejemplo n.º 9
0
        private void bToolbar_Click(object sender, SupportToolbar.MenuItemClickEventArgs e)
        {
            switch (e.Item.ItemId)
            {
            case Resource.Id.action_newtab: Toast.MakeText(this, "NewTab clicked", ToastLength.Short).Show(); break;

            case Resource.Id.action_color: Toast.MakeText(this, "Color clicked", ToastLength.Short).Show(); break;

            case Resource.Id.action_figure: Toast.MakeText(this, "Figure clicked", ToastLength.Short).Show(); break;

            case Resource.Id.action_width: Toast.MakeText(this, "Width clicked", ToastLength.Short).Show(); break;

            case Resource.Id.action_text: Toast.MakeText(this, "Text clicked", ToastLength.Short).Show(); break;

            case Resource.Id.action_image: Toast.MakeText(this, "Image clicked", ToastLength.Short).Show(); break;
            }
        }
Ejemplo n.º 10
0
        private void ToolbarOnMenuItemClick(object sender, Toolbar.MenuItemClickEventArgs e)
        {
            switch (e.Item.ItemId)
            {
            case Resource.Id.menu_edit:
            {
                var intent = new Intent(this, typeof(AddItemActivity));;
                StartActivity(intent);
                break;
            }

            case Resource.Id.menu_settings:
            {
                var intent = new Intent(this, typeof(FormsActivity));
                intent.PutExtra("PageType", "SettingsPage");
                StartActivity(intent);
                break;
            }
            }
        }
        private void MToolBar_MenuItemClick(object sender, SupportToolbar.MenuItemClickEventArgs e)
        {
            if (e.Item.ItemId == Resource.Id.menuItem_delete)
            {
                Android.App.AlertDialog.Builder builder = new Android.App.AlertDialog.Builder(this);
                Android.App.AlertDialog         alert   = builder.Create();
                alert.SetTitle("Attention!");
                alert.SetMessage("Are you sure you want to delete?");

                alert.SetButton2("CANCEL", (c, ev) =>
                {
                    //cancel button
                });

                alert.SetButton("YES", (c, ev) =>
                {
                    DeleteProduct(mProductSizeId);
                    MarkProductAsToDelete(mProductSizeId);
                    Finish();
                });

                alert.Show();
            }
        }
Ejemplo n.º 12
0
        private void MenuHandler(object sender, SupportToolbar.MenuItemClickEventArgs e)
        {
            switch (e.Item.ItemId)
            {
            case Resource.Id.action_choose:
                Log.Info("Dictionary", "Choose");
                //TODO
                break;

            case Resource.Id.action_share:
                Log.Info("Dictionary", "Share");

                Intent intent = new Intent(Intent.ActionSend);
                intent.SetType("text/plain");

                String shareBody = "Yolo Swag Wafa";

                intent.PutExtra(Intent.ExtraSubject, "A definition by Dinky Dictionary");
                intent.PutExtra(Intent.ExtraText, shareBody);

                StartActivity(Intent.CreateChooser(intent, "Share via"));
                break;
            }
        }
 private void MToolBar_MenuItemClick(object sender, SupportToolbar.MenuItemClickEventArgs e)
 {
 }
Ejemplo n.º 14
0
 private void OnMenuItemClicked(object sender, Toolbar.MenuItemClickEventArgs e)
 {
     OnOptionsItemSelected(e.Item);
 }
Ejemplo n.º 15
0
 /// <summary>
 ///
 /// </summary>
 private void BottomToolbar_MenuItemClick(object sender, V7Toolbar.MenuItemClickEventArgs e)
 {
     Toast.MakeText(this, "Bottom toolbar tapped: " + e.Item.TitleFormatted, ToastLength.Short).Show();
 }
Ejemplo n.º 16
0
 private void ToolbarOnMenuItemClick(object sender, Toolbar.MenuItemClickEventArgs e)
 {
     Messenger.Default.Send((ToolbarActionMessage)e.Item.ItemId);
 }