コード例 #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            MainApp.ChangeLanguage(this);
            SetTheme(Resource.Style.MyAppTheme);
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.activity_authorization);

            networkChecker           = new NetworkChecker(this);
            autoCompleteTextViewAuth = FindViewById <AutoCompleteTextView>(Resource.Id.autocompletetextview_auth);
            autoCompleteTextViewAuth.SetOnEditorActionListener(this);
            autoCompleteTextViewAuth.AddTextChangedListener(this);
            progressBar = FindViewById <ProgressBar>(Resource.Id.progressbar_auth);

            progressBar.Visibility = ViewStates.Visible;
            Task.Run(async() =>
            {
                groupsDictionary = await MainApp.Instance.GroupsDictionary;
                array            = groupsDictionary.Select(x => x.Key).ToArray();

                RunOnUiThread(() =>
                {
                    suggestAdapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleDropDownItem1Line, array);

                    autoCompleteTextViewAuth.Adapter = suggestAdapter;

                    progressBar.Visibility = ViewStates.Invisible;
                });
            });

            var buttonAuth     = FindViewById <Button>(Resource.Id.button_auth);
            var textViewLater  = FindViewById <TextView>(Resource.Id.textview_later_auth);
            var textViewUpdate = FindViewById <TextView>(Resource.Id.textview_groupsupdate_auth);

            buttonAuth.Click     += ButtonAuth_Click;
            textViewLater.Click  += TextViewLater_Click;
            textViewUpdate.Click += TextViewUpdate_Click;

            prefEditor = MainApp.Instance.SharedPreferences.Edit();
        }
コード例 #2
0
        private static int GetBitmapIdForEmbeddedResource(string resourceName)
        {
            var image = MainApp.GetEmbeddedResourceStream($"Images.{resourceName}");

            return(BitmapRegistry.Instance.Register(image));
        }