Beispiel #1
0
        public void ShowFilterDialog(System.Object o, EventArgs e)
        {
            filterDialog = new Dialog(this);
            filterDialog.SetContentView(Resource.Layout.sort_filter_layout);
            filterDialog.Window.SetSoftInputMode(SoftInput.AdjustResize);
            //searchDialog.Window.ClearFlags(WindowManagerFlags.DimBehind);

            filterDialog.Show();
            filterDialog.Window.SetLayout(LayoutParams.FillParent, LayoutParams.FillParent);
            filterDialog.Window.SetBackgroundDrawableResource(Resource.Color.mtrl_btn_transparent_bg_color);
            btnSaveFilters          = filterDialog.FindViewById <Android.Support.Design.Button.MaterialButton>(Resource.Id.btnSaveFilters);
            btnSaveFilters.Click   += BtnSaveFilters_Click;
            btnCancelFilters        = filterDialog.FindViewById <Android.Support.Design.Button.MaterialButton>(Resource.Id.btnCancelFilters);
            btnCancelFilters.Click += (s, e) => { filterDialog.Dismiss(); };
            rgCategories            = filterDialog.FindViewById <RadioGroup>(Resource.Id.rgCategory);
            rgOrderBy = filterDialog.FindViewById <RadioGroup>(Resource.Id.rgOrderBy);
            //Toast.MakeText(this, selectedCatId.ToString(), ToastLength.Short).Show();
            if (selectedCatId != 0)
            {
                rgCategories.Check(selectedCatId);
            }
            if (selectedOrderById != 0)
            {
                rgOrderBy.Check(selectedOrderById);
            }
        }
        AButton IStepperRenderer.CreateButton()
        {
            var button = new MButton(MaterialContextThemeWrapper.Create(Context), null, Resource.Attribute.materialOutlinedButtonStyle);

            // the buttons are meant to be "square", but are usually wide,
            // so, copy the vertical properties into the horizontal properties
            button.SetMinimumWidth(button.MinimumHeight);
            button.SetMinWidth(button.MinHeight);
            button.SetPadding(button.PaddingTop, button.PaddingTop, button.PaddingBottom, button.PaddingBottom);

            return(button);
        }
Beispiel #3
0
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            if (item.TitleFormatted.ToString() == "Filter")
            {
                filterDialog = new Dialog(this);
                filterDialog.SetContentView(Resource.Layout.sort_filter_layout);
                filterDialog.Window.SetSoftInputMode(SoftInput.AdjustResize);
                //searchDialog.Window.ClearFlags(WindowManagerFlags.DimBehind);

                filterDialog.Show();
                filterDialog.Window.SetLayout(LayoutParams.FillParent, LayoutParams.WrapContent);
                filterDialog.Window.SetBackgroundDrawableResource(Resource.Color.mtrl_btn_transparent_bg_color);
                btnSaveFilters          = filterDialog.FindViewById <Android.Support.Design.Button.MaterialButton>(Resource.Id.btnSaveFilters);
                btnSaveFilters.Click   += BtnSaveFilters_Click;
                btnCancelFilters        = filterDialog.FindViewById <Android.Support.Design.Button.MaterialButton>(Resource.Id.btnCancelFilters);
                btnCancelFilters.Click += (s, e) => { filterDialog.Dismiss(); };
                rgCategories            = filterDialog.FindViewById <RadioGroup>(Resource.Id.rgCategory);
                rgOrderBy = filterDialog.FindViewById <RadioGroup>(Resource.Id.rgOrderBy);
                //Toast.MakeText(this, selectedCatId.ToString(), ToastLength.Short).Show();
                if (selectedCatId != 0)
                {
                    rgCategories.Check(selectedCatId);
                }
                if (selectedOrderById != 0)
                {
                    rgOrderBy.Check(selectedOrderById);
                }
            }

            if (item.ItemId == Android.Resource.Id.Home)
            {
                this.OnBackPressed();
            }
            //Toast.MakeText(this, item.ItemId.ToString(), ToastLength.Short).Show();
            //Toast.MakeText(this, "Action selected: " + item.TitleFormatted, ToastLength.Short).Show();
            return(base.OnOptionsItemSelected(item));
        }