예제 #1
0
        private void MaxDownloadClick(object sender, Preference.PreferenceClickEventArgs e)
        {
            View pickerView = LayoutInflater.Inflate(Resource.Layout.NumberPicker, null);

            AlertDialog.Builder builder = new AlertDialog.Builder(Activity, MainActivity.dialogTheme);
            builder.SetTitle(Resources.GetString(Resource.String.max_download_dialog));
            builder.SetView(pickerView);
            NumberPicker picker = (NumberPicker)pickerView;

            picker.MinValue = 1;
            picker.MaxValue = 10;
            picker.Value    = int.Parse(FindPreference("maxDownload").Summary);

            builder.SetPositiveButton(Resources.GetString(Resource.String.apply), (s, eventArg) =>
            {
                ISharedPreferences pref         = PreferenceManager.GetDefaultSharedPreferences(Application.Context);
                ISharedPreferencesEditor editor = pref.Edit();
                editor.PutInt("maxDownload", picker.Value);
                editor.Apply();

                Preference prefButton = FindPreference("maxDownload");
                prefButton.Summary    = pref.GetInt("maxDownload", 2).ToString();

                if (Downloader.instance != null && Downloader.queue.Count > 0)
                {
                    Downloader.instance.maxDownload = pref.GetInt("maxDownload", 4);
                }
            });
            builder.SetNegativeButton(Resources.GetString(Resource.String.cancel), (s, eventArg) => { });
            builder.Show();
        }
예제 #2
0
 private void InviteFriendsPrefOnPreferenceClick(object sender, Preference.PreferenceClickEventArgs e)
 {
     try
     {
         if ((int)Build.VERSION.SdkInt < 23)
         {
             var intent = new Intent(ActivityContext, typeof(InviteFriendsActivity));
             ActivityContext.StartActivity(intent);
         }
         else
         {
             //Check to see if any permission in our group is available, if one, then all are
             if (ActivityContext.CheckSelfPermission(Manifest.Permission.ReadContacts) == Permission.Granted)
             {
                 var intent = new Intent(ActivityContext, typeof(InviteFriendsActivity));
                 ActivityContext.StartActivity(intent);
             }
             else
             {
                 new PermissionsController(ActivityContext).RequestPermission(101);
             }
         }
     }
     catch (Exception exception)
     {
         Methods.DisplayReportResultTrack(exception);
     }
 }
예제 #3
0
 private async void DownloadClick(object sender, Preference.PreferenceClickEventArgs e)
 {
     if (await Preferences.instance.GetReadPermission())
     {
         Preferences.instance.SupportFragmentManager.BeginTransaction().Replace(Android.Resource.Id.ListContainer, DownloadFragment.NewInstance(path)).AddToBackStack(null).Commit();
         Preferences.instance.SupportActionBar.Title = "Download Location";
     }
 }
예제 #4
0
 //Withdrawals
 private void WithdrawalsPrefOnPreferenceClick(object sender, Preference.PreferenceClickEventArgs e)
 {
     try
     {
         ActivityContext.StartActivity(new Intent(ActivityContext, typeof(WithdrawalsActivity)));
     }
     catch (Exception exception)
     {
         Methods.DisplayReportResultTrack(exception);
     }
 }
예제 #5
0
 private void GeneralPrefOnPreferenceClick(object sender, Preference.PreferenceClickEventArgs e)
 {
     try
     {
         ActivityContext.StartActivity(new Intent(ActivityContext, typeof(EditProfileInfoActivity)));
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }
예제 #6
0
 private void WithdrawalsPrefOnPreferenceClick(object sender, Preference.PreferenceClickEventArgs e)
 {
     try
     {
         ActivityContext.StartActivity(new Intent(ActivityContext, typeof(WithdrawalsActivity)));
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }
 private void RateAppPrefOnPreferenceClick(object sender, Preference.PreferenceClickEventArgs e)
 {
     try
     {
         StoreReviewApp store = new StoreReviewApp();
         store.OpenStoreReviewPage(Activity.PackageName);
     }
     catch (Exception exception)
     {
         Methods.DisplayReportResultTrack(exception);
     }
 }
예제 #8
0
 //ManageSessions
 private void ManageSessionsPrefOnPreferenceClick(object sender, Preference.PreferenceClickEventArgs e)
 {
     try
     {
         var intent = new Intent(ActivityContext, typeof(ManageSessionsActivity));
         ActivityContext.StartActivity(intent);
     }
     catch (Exception exception)
     {
         Methods.DisplayReportResultTrack(exception);
     }
 }
 //MyBalance
 private void MyBalancePrefOnPreferenceClick(object sender, Preference.PreferenceClickEventArgs e)
 {
     try
     {
         var intent = new Intent(ActivityContext, typeof(TabbedWalletActivity));
         ActivityContext.StartActivity(intent);
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }
 //Verification
 private void VerificationPrefOnPreferenceClick(object sender, Preference.PreferenceClickEventArgs preferenceClickEventArgs)
 {
     try
     {
         var intent = new Intent(ActivityContext, typeof(VerificationActivity));
         ActivityContext.StartActivity(intent);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
예제 #11
0
 //About
 private void AboutPrefOnPreferenceClick(object sender, Preference.PreferenceClickEventArgs e)
 {
     try
     {
         var intent = new Intent(Context, typeof(AboutAppActivity));
         ActivityContext.StartActivity(intent);
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }
 //Edit Profile
 private void EditProfilePref_OnPreferenceClick(object sender, Preference.PreferenceClickEventArgs preferenceClickEventArgs)
 {
     try
     {
         var intent = new Intent(ActivityContext, typeof(EditMyProfileActivity));
         ActivityContext.StartActivity(intent);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
 //My Affiliates
 private void MyAffiliatesPref_OnPreferenceClick(object sender, Preference.PreferenceClickEventArgs e)
 {
     try
     {
         var intent = new Intent(ActivityContext, typeof(MyAffiliatesActivity));
         ActivityContext.StartActivity(intent);
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }
예제 #14
0
 //Verification
 private void VerificationPrefOnPreferenceClick(object sender, Preference.PreferenceClickEventArgs preferenceClickEventArgs)
 {
     try
     {
         var intent = new Intent(ActivityContext, typeof(VerificationActivity));
         ActivityContext.StartActivity(intent);
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
예제 #15
0
 private void InterestPrefOnPreferenceClick(object sender, Preference.PreferenceClickEventArgs e)
 {
     try
     {
         Intent intent = new Intent(ActivityContext, typeof(GenresActivity));
         intent.PutExtra("Event", "Save");
         ActivityContext.StartActivity(intent);
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }
예제 #16
0
 //Report a Problem
 private void ReportProblemPref_OnPreferenceClick(object sender, Preference.PreferenceClickEventArgs preferenceClickEventArgs)
 {
     try
     {
         var intent = new Intent(ActivityContext, typeof(LocalWebViewActivity));
         intent.PutExtra("URL", Client.WebsiteUrl + "/contact-us");
         intent.PutExtra("Type", ActivityContext.GetString(Resource.String.Lbl_Report_Problem));
         ActivityContext.StartActivity(intent);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
예제 #17
0
 //Privacy Policy
 private void PrivacyPolicyPref_OnPreferenceClick(object sender, Preference.PreferenceClickEventArgs preferenceClickEventArgs)
 {
     try
     {
         var intent = new Intent(ActivityContext, typeof(LocalWebViewActivity));
         intent.PutExtra("URL", Client.WebsiteUrl + "/terms/privacy-policy");
         intent.PutExtra("Type", ActivityContext.GetString(Resource.String.Privacy_Policy));
         ActivityContext.StartActivity(intent);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
 //Help
 private void HelpPref_OnPreferenceClick(object sender, Preference.PreferenceClickEventArgs preferenceClickEventArgs)
 {
     try
     {
         var intent = new Intent(ActivityContext, typeof(LocalWebViewActivity));
         intent.PutExtra("URL", Client.WebsiteUrl + "/contact-us");
         intent.PutExtra("Type", ActivityContext.GetString(Resource.String.Lbl_Help));
         ActivityContext.StartActivity(intent);
     }
     catch (Exception e)
     {
         Methods.DisplayReportResultTrack(e);
     }
 }
예제 #19
0
 //Help
 private void HelpPrefOnPreferenceClick(object sender, Preference.PreferenceClickEventArgs e)
 {
     try
     {
         var intent = new Intent(Context, typeof(LocalWebViewActivity));
         intent.PutExtra("URL", Client.WebsiteUrl + "/contact");
         intent.PutExtra("Type", GetText(Resource.String.Lbl_Help));
         ActivityContext.StartActivity(intent);
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }
예제 #20
0
        private void KeepDeletedClick(object sender, Preference.PreferenceClickEventArgs e)
        {
            AlertDialog.Builder builder = new AlertDialog.Builder(Activity, MainActivity.dialogTheme);
            builder.SetTitle("Delete song when removing them from a synced playlist:");
            builder.SetItems(new string[] { "True", "False" }, (s, args) =>
            {
                ISharedPreferences pref         = PreferenceManager.GetDefaultSharedPreferences(Application.Context);
                ISharedPreferencesEditor editor = pref.Edit();
                editor.PutBoolean("keepDeleted", args.Which == 1);
                editor.Apply();

                Preference prefButton = FindPreference("keepDeleted");
                prefButton.Summary    = args.Which == 0 ? "True" : "False";
            });
            builder.Show();
        }
예제 #21
0
 //Logout
 private void LogoutPrefOnPreferenceClick(object sender, Preference.PreferenceClickEventArgs e)
 {
     try
     {
         var dialog = new MaterialDialog.Builder(ActivityContext).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light);
         dialog.Title(Resource.String.Lbl_Warning);
         dialog.Content(GetText(Resource.String.Lbl_Are_you_logout));
         dialog.PositiveText(GetText(Resource.String.Lbl_Ok)).OnPositive(this);
         dialog.NegativeText(GetText(Resource.String.Lbl_Cancel)).OnNegative(this);
         dialog.AlwaysCallSingleChoiceCallback();
         dialog.Build().Show();
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
     }
 }
예제 #22
0
        //Delete Account
        private void DeleteAccountPref_OnPreferenceClick(object sender, Preference.PreferenceClickEventArgs preferenceClickEventArgs)
        {
            try
            {
                TypeDialog = "DeleteAccount";

                var dialog = new MaterialDialog.Builder(ActivityContext).Theme(AppSettings.SetTabDarkTheme ? Theme.Dark : Theme.Light);

                dialog.Title(Resource.String.Lbl_Warning);
                dialog.Content(ActivityContext.GetText(Resource.String.Lbl_Are_you_DeleteAccount) + " " + AppSettings.ApplicationName);
                dialog.PositiveText(ActivityContext.GetText(Resource.String.Lbl_Ok)).OnPositive(this);
                dialog.NegativeText(ActivityContext.GetText(Resource.String.Lbl_Cancel)).OnNegative(this);
                dialog.Build().Show();
                dialog.AlwaysCallSingleChoiceCallback();
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
예제 #23
0
        private void ChangeTheme(object sender, Preference.PreferenceClickEventArgs e)
        {
            AlertDialog.Builder builder = new AlertDialog.Builder(Activity, MainActivity.dialogTheme);
            builder.SetTitle(Resources.GetString(Resource.String.theme_dialog));
            builder.SetItems(new[] { Resources.GetString(Resource.String.white_theme), Resources.GetString(Resource.String.dark_theme), Resources.GetString(Resource.String.black_theme) }, (s, args) =>
            {
                ISharedPreferences pref         = PreferenceManager.GetDefaultSharedPreferences(Application.Context);
                ISharedPreferencesEditor editor = pref.Edit();
                editor.PutInt("theme", args.Which);
                editor.Apply();

                Preference prefButton = FindPreference("theme");
                prefButton.Summary    = args.Which == 0 ? Resources.GetString(Resource.String.white_theme) : Resources.GetString(Resource.String.dark_theme);

                MainActivity.LoadTheme(MainActivity.instance);
                MainActivity.instance.Recreate();
                Activity.Recreate();
            });
            builder.Show();
        }
예제 #24
0
        //Share App with your friends using Url This App in Market Google play
        private async void SharePref_OnPreferenceClick(object sender, Preference.PreferenceClickEventArgs preferenceClickEventArgs)
        {
            try
            {
                //Share Plugin same as flame
                if (!CrossShare.IsSupported)
                {
                    return;
                }

                await CrossShare.Current.Share(new ShareMessage
                {
                    Title = AppSettings.ApplicationName,
                    Text  = InviteSmsText,
                    Url   = "http://play.google.com/store/apps/details?id=" + ActivityContext.PackageName
                });
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }
예제 #25
0
 private void About(object sender, Preference.PreferenceClickEventArgs e)
 {
     Preferences.instance.SupportFragmentManager.BeginTransaction().Replace(Android.Resource.Id.ListContainer, new AboutFragment()).AddToBackStack(null).Commit();
     Preferences.instance.SupportActionBar.Title = GetString(Resource.String.about);
 }
예제 #26
0
 private void UpdatePreference_PreferenceClick(object sender, Preference.PreferenceClickEventArgs e)
 {
     MainActivity.CheckForUpdate(Preferences.instance, true);
 }