Esempio n. 1
0
        public override void OnCreatePreferences(Bundle SavedInstanceState, string RootKey)
        {
            SetPreferencesFromResource(Resource.Xml.support_preferences, RootKey);

            AutoSkillSettingsFragment.PreferredSupportOnCreate(this);

            if (FindPreference(GetString(Resource.String.pref_extract_def_support_imgs)) is { } pref)
            {
                pref.PreferenceClick += (S, E) =>
                {
                    Toast.MakeText(Activity, "Extracting Images in background", ToastLength.Short).Show();

                    Task.Run(ImageLocator.ExtractSupportImgs)
                    .ContinueWith(M =>
                    {
                        Activity.RunOnUiThread(() => Toast.MakeText(Activity, "Support Images Extracted Successfully", ToastLength.Short).Show());
                    });
                };
            }
        }
Esempio n. 2
0
        protected override void OnCreate(Bundle SavedInstanceState)
        {
            base.OnCreate(SavedInstanceState);

            SetContentView(Resource.Layout.settings);

            // Add the fragment only on first launch
            if (SavedInstanceState == null)
            {
                var fragment = new AutoSkillSettingsFragment();
                var args     = new Bundle();
                args.PutString(AutoSkillItemKey, Intent.GetStringExtra(AutoSkillItemKey));

                fragment.Arguments = args;

                SupportFragmentManager
                .BeginTransaction()
                .Replace(Resource.Id.settings_container, fragment)
                .Commit();
            }
        }
Esempio n. 3
0
        public override void OnResume()
        {
            base.OnResume();

            AutoSkillSettingsFragment.PreferredSupportOnResume(this);
        }