コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: PreferenceFragment.cs プロジェクト: bolkay/ExtractR
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            View view = inflater.Inflate(Resource.Layout.preference_fragment, container, false);

            themeSwitcher         = view.FindViewById <Switch>(Resource.Id.switcher);
            materialCard          = view.FindViewById <MaterialCardView>(Resource.Id.donationCard);
            donationTextView      = view.FindViewById <TextView>(Resource.Id.donationTextView);
            donationRefreshButton = view.FindViewById <Button>(Resource.Id.donationRefreshButton);
            aboutButton           = view.FindViewById <Google.Android.Material.Button.MaterialButton>(Resource.Id.aboutButton);
            reportButton          = view.FindViewById <Google.Android.Material.Button.MaterialButton>(Resource.Id.reportButton);

            donationRefreshButton.Click += DonationRefreshButton_Click;
            aboutButton.Click           += AboutButton_Click;
            reportButton.Click          += ReportButton_Click;
            themeSwitcher.SetOnCheckedChangeListener(this);

            sharedPreferences = PreferenceManager.GetDefaultSharedPreferences(this.Context);

            var stateIsChecked = sharedPreferences.GetBoolean("Saved_Switch", false);

            if (themeSwitcher != null)
            {
                themeSwitcher.Checked = stateIsChecked;

                if (stateIsChecked)
                {
                    themeSwitcher.Text = "Toggle to turn off the lights";
                }
                else
                {
                    themeSwitcher.Text = "Toogle to turn the lights on";
                }
            }
            var userHasDonated = ExtractRAdManager.UserHasDonated(this.Context);

            if (!userHasDonated)
            {
                materialCard.SetBackgroundColor(Android.Graphics.Color.DarkRed);
                donationTextView.SetTextColor(Android.Graphics.Color.GhostWhite);
                donationTextView.Text            = Context.GetString(Resource.String.user_no_donation);
                donationRefreshButton.Visibility = ViewStates.Visible;
            }
            else
            {
                materialCard.SetBackgroundColor(Android.Graphics.Color.DarkGreen);
                donationTextView.SetTextColor(Android.Graphics.Color.GhostWhite);
                donationTextView.Text            = Context.GetString(Resource.String.user_donated);
                donationRefreshButton.Visibility = ViewStates.Gone;
            }

            return(view);
        }
コード例 #3
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            // Use this to return your custom view for this Fragment
            View view = inflater.Inflate(Resource.Layout.new_export_fragment, container, false);

            exportProgressBar = view.FindViewById <ProgressBar>(Resource.Id.exportProgressBar);

            zipButton = view.FindViewById <Google.Android.Material.Button.MaterialButton>(Resource.Id.zipButton);

            imageButton = view.FindViewById <Google.Android.Material.Button.MaterialButton>(Resource.Id.imageExportButton);

            zipButton.Click += ZipButton_Click;

            pdfButton = view.FindViewById <Google.Android.Material.Button.MaterialButton>(Resource.Id.pdfButton);

            pdfButton.Click += PdfButton_Click;

            imageButton.Click += ImageButton_Click;
            return(view);
        }