mirror of
				https://codeberg.org/tom79/Fedilab.git
				synced 2025-10-20 11:20:16 +03:00 
			
		
		
		
	Fix dynamic colors
This commit is contained in:
		
							parent
							
								
									408e51c0a6
								
							
						
					
					
						commit
						ca5b37edfe
					
				
					 66 changed files with 141 additions and 418 deletions
				
			
		|  | @ -100,7 +100,7 @@ public class BasePeertubeActivity extends BaseBarActivity { | |||
|         if (item.getItemId() == R.id.action_cast) { | ||||
|             if (PeertubeBaseMainActivity.chromeCasts != null && PeertubeBaseMainActivity.chromeCasts.size() > 0) { | ||||
|                 String[] chromecast_choice = new String[PeertubeBaseMainActivity.chromeCasts.size()]; | ||||
|                 AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(this, app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(this); | ||||
|                 alt_bld.setTitle(R.string.chromecast_choice); | ||||
|                 int i = 0; | ||||
|                 for (ChromeCast cc : PeertubeBaseMainActivity.chromeCasts) { | ||||
|  |  | |||
|  | @ -605,7 +605,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt | |||
|         popup.setOnMenuItemClickListener(item -> { | ||||
|             int itemId = item.getItemId(); | ||||
|             if (itemId == R.id.action_logout_account) { | ||||
|                 AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(activity); | ||||
|                 alt_bld.setTitle(R.string.action_logout); | ||||
|                 if (currentAccount.mastodon_account != null && currentAccount.instance != null) { | ||||
|                     alt_bld.setMessage(activity.getString(R.string.logout_account_confirmation, currentAccount.mastodon_account.username, currentAccount.instance)); | ||||
|  | @ -1567,7 +1567,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt | |||
|                 itemShowDMs.setChecked(show_dms); | ||||
|                 editor.apply(); | ||||
|             } else if (itemId == R.id.action_filter) { | ||||
|                 AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(BaseMainActivity.this, Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(BaseMainActivity.this); | ||||
|                 LayoutInflater inflater = getLayoutInflater(); | ||||
|                 View dialogView = inflater.inflate(R.layout.popup_filter_regex, new LinearLayout(BaseMainActivity.this), false); | ||||
|                 dialogBuilder.setView(dialogView); | ||||
|  | @ -1888,7 +1888,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt | |||
|     @Override | ||||
|     public boolean onOptionsItemSelected(MenuItem item) { | ||||
|         if (item.getItemId() == R.id.action_logout) { | ||||
|             AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(BaseMainActivity.this, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(BaseMainActivity.this); | ||||
|             alt_bld.setTitle(R.string.action_logout); | ||||
|             alt_bld.setMessage(getString(R.string.logout_account_confirmation, account.mastodon_account.username, account.instance)); | ||||
|             alt_bld.setPositiveButton(R.string.action_logout, (dialog, id) -> { | ||||
|  |  | |||
|  | @ -27,8 +27,6 @@ import androidx.multidex.MultiDex; | |||
| import androidx.multidex.MultiDexApplication; | ||||
| import androidx.preference.PreferenceManager; | ||||
| 
 | ||||
| import com.google.android.material.color.DynamicColors; | ||||
| 
 | ||||
| import net.gotev.uploadservice.UploadServiceConfig; | ||||
| import net.gotev.uploadservice.observer.request.GlobalRequestObserver; | ||||
| 
 | ||||
|  | @ -54,15 +52,10 @@ public class MainApplication extends MultiDexApplication { | |||
|     @Override | ||||
|     public void onCreate() { | ||||
|         super.onCreate(); | ||||
|         SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(MainApplication.this); | ||||
|         try { | ||||
|             webView = new WebView(this); | ||||
|         } catch (Exception ignored) { | ||||
|         } | ||||
|         boolean dynamicColor = sharedpreferences.getBoolean(getString(R.string.SET_DYNAMICCOLOR), false); | ||||
|         if (dynamicColor) { | ||||
|             DynamicColors.applyToActivitiesIfAvailable(this); | ||||
|         } | ||||
|         StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder(); | ||||
|         StrictMode.setVmPolicy(builder.build()); | ||||
|         Toasty.Config.getInstance().apply(); | ||||
|  |  | |||
|  | @ -30,6 +30,7 @@ import androidx.appcompat.app.AppCompatActivity; | |||
| import androidx.appcompat.app.AppCompatDelegate; | ||||
| import androidx.preference.PreferenceManager; | ||||
| 
 | ||||
| import com.google.android.material.color.DynamicColors; | ||||
| import com.vanniktech.emoji.EmojiManager; | ||||
| import com.vanniktech.emoji.one.EmojiOneProvider; | ||||
| 
 | ||||
|  | @ -53,6 +54,7 @@ public class BaseActivity extends AppCompatActivity { | |||
| 
 | ||||
|     @Override | ||||
|     protected void onCreate(@Nullable Bundle savedInstanceState) { | ||||
| 
 | ||||
|         boolean patch_provider = true; | ||||
|         final SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this); | ||||
|         try { | ||||
|  | @ -142,6 +144,10 @@ public class BaseActivity extends AppCompatActivity { | |||
|             } | ||||
|         } | ||||
|         super.onCreate(savedInstanceState); | ||||
|         boolean dynamicColor = sharedpreferences.getBoolean(getString(R.string.SET_DYNAMICCOLOR), false); | ||||
|         if (dynamicColor) { | ||||
|             DynamicColors.applyToActivityIfAvailable(this); | ||||
|         } | ||||
|         if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N) { | ||||
|             ThemeHelper.adjustFontScale(this, getResources().getConfiguration()); | ||||
|         } | ||||
|  |  | |||
|  | @ -1,153 +0,0 @@ | |||
| package app.fedilab.android.mastodon.activities; | ||||
| /* Copyright 2021 Thomas Schneider | ||||
|  * | ||||
|  * This file is a part of Fedilab | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify it under the terms of the | ||||
|  * GNU General Public License as published by the Free Software Foundation; either version 3 of the | ||||
|  * License, or (at your option) any later version. | ||||
|  * | ||||
|  * Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even | ||||
|  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||||
|  * Public License for more details. | ||||
|  * | ||||
|  * You should have received a copy of the GNU General Public License along with Fedilab; if not, | ||||
|  * see <http://www.gnu.org/licenses>. */ | ||||
| 
 | ||||
| 
 | ||||
| import android.annotation.SuppressLint; | ||||
| import android.content.Context; | ||||
| import android.content.SharedPreferences; | ||||
| import android.content.res.Configuration; | ||||
| import android.graphics.Color; | ||||
| import android.os.Build; | ||||
| import android.os.Bundle; | ||||
| import android.view.Window; | ||||
| import android.view.WindowManager; | ||||
| 
 | ||||
| import androidx.annotation.Nullable; | ||||
| import androidx.appcompat.app.AppCompatActivity; | ||||
| import androidx.appcompat.app.AppCompatDelegate; | ||||
| import androidx.preference.PreferenceManager; | ||||
| 
 | ||||
| import com.vanniktech.emoji.EmojiManager; | ||||
| import com.vanniktech.emoji.one.EmojiOneProvider; | ||||
| 
 | ||||
| import org.conscrypt.Conscrypt; | ||||
| 
 | ||||
| import java.security.Security; | ||||
| 
 | ||||
| import app.fedilab.android.R; | ||||
| import app.fedilab.android.mastodon.helper.Helper; | ||||
| import app.fedilab.android.mastodon.helper.ThemeHelper; | ||||
| 
 | ||||
| 
 | ||||
| @SuppressLint("Registered") | ||||
| public class BaseAlertDialogActivity extends AppCompatActivity { | ||||
| 
 | ||||
|     static { | ||||
|         EmojiManager.install(new EmojiOneProvider()); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void onCreate(@Nullable Bundle savedInstanceState) { | ||||
|         final SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this); | ||||
|         boolean patch_provider = true; | ||||
|         try { | ||||
|             patch_provider = sharedpreferences.getBoolean(Helper.SET_SECURITY_PROVIDER, true); | ||||
|         } catch (Exception ignored) { | ||||
|         } | ||||
|         if (patch_provider) { | ||||
|             try { | ||||
|                 Security.insertProviderAt(Conscrypt.newProvider(), 1); | ||||
|             } catch (Exception ignored) { | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         String currentTheme = sharedpreferences.getString(getString(R.string.SET_THEME_BASE), getString(R.string.SET_DEFAULT_THEME)); | ||||
|         //Default automatic switch | ||||
|         if (currentTheme.equals(getString(R.string.SET_DEFAULT_THEME))) { | ||||
| 
 | ||||
|             int currentNightMode = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; | ||||
|             switch (currentNightMode) { | ||||
|                 case Configuration.UI_MODE_NIGHT_NO: | ||||
|                     String defaultLight = sharedpreferences.getString(getString(R.string.SET_THEME_DEFAULT_LIGHT), "LIGHT"); | ||||
|                     switch (defaultLight) { | ||||
|                         case "LIGHT": | ||||
|                             setTheme(R.style.AppThemeAlertDialog); | ||||
|                             break; | ||||
|                         case "SOLARIZED_LIGHT": | ||||
|                             setTheme(R.style.SolarizedAlertDialog); | ||||
|                             break; | ||||
|                     } | ||||
|                     break; | ||||
|                 case Configuration.UI_MODE_NIGHT_YES: | ||||
|                     String defaultDark = sharedpreferences.getString(getString(R.string.SET_THEME_DEFAULT_DARK), "DARK"); | ||||
|                     switch (defaultDark) { | ||||
|                         case "DARK": | ||||
|                             setTheme(R.style.AppThemeAlertDialog); | ||||
|                             break; | ||||
|                         case "SOLARIZED_DARK": | ||||
|                             setTheme(R.style.SolarizedAlertDialog); | ||||
|                             break; | ||||
|                         case "BLACK": | ||||
|                             Window window = getWindow(); | ||||
|                             window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); | ||||
|                             window.setStatusBarColor(Color.BLACK); | ||||
|                             setTheme(R.style.BlackAlertDialog); | ||||
|                             break; | ||||
|                         case "DRACULA": | ||||
|                             setTheme(R.style.DraculaAlertDialog); | ||||
|                             break; | ||||
|                     } | ||||
|                     break; | ||||
|             } | ||||
|         } else { | ||||
|             switch (currentTheme) { | ||||
|                 case "LIGHT": | ||||
|                     AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); | ||||
|                     setTheme(R.style.AppThemeAlertDialog); | ||||
|                     break; | ||||
|                 case "DARK": | ||||
|                     AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); | ||||
|                     setTheme(R.style.AppThemeAlertDialog); | ||||
|                     break; | ||||
|                 case "SOLARIZED_LIGHT": | ||||
|                     AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); | ||||
|                     setTheme(R.style.SolarizedAlertDialog); | ||||
|                     break; | ||||
|                 case "SOLARIZED_DARK": | ||||
|                     AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); | ||||
|                     setTheme(R.style.SolarizedAlertDialog); | ||||
|                     break; | ||||
|                 case "BLACK": | ||||
|                     AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); | ||||
|                     Window window = getWindow(); | ||||
|                     window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); | ||||
|                     window.setStatusBarColor(Color.BLACK); | ||||
|                     setTheme(R.style.BlackAlertDialog); | ||||
|                     break; | ||||
|                 case "DRACULA": | ||||
|                     AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); | ||||
|                     setTheme(R.style.DraculaAlertDialog); | ||||
|                     break; | ||||
|             } | ||||
|         } | ||||
|         super.onCreate(savedInstanceState); | ||||
|         if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N) { | ||||
|             ThemeHelper.adjustFontScale(this, getResources().getConfiguration()); | ||||
|         } | ||||
|         Helper.setLocale(this); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void attachBaseContext(Context newBase) { | ||||
|         if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N) { | ||||
|             final Configuration override = new Configuration(newBase.getResources().getConfiguration()); | ||||
|             SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(newBase); | ||||
|             override.fontScale = prefs.getFloat(newBase.getString(R.string.SET_FONT_SCALE), 1.1f); | ||||
|             applyOverrideConfiguration(override); | ||||
|         } | ||||
|         super.attachBaseContext(newBase); | ||||
|     } | ||||
| } | ||||
|  | @ -30,6 +30,7 @@ import androidx.appcompat.app.AppCompatActivity; | |||
| import androidx.appcompat.app.AppCompatDelegate; | ||||
| import androidx.preference.PreferenceManager; | ||||
| 
 | ||||
| import com.google.android.material.color.DynamicColors; | ||||
| import com.vanniktech.emoji.EmojiManager; | ||||
| import com.vanniktech.emoji.one.EmojiOneProvider; | ||||
| 
 | ||||
|  | @ -128,6 +129,10 @@ public class BaseBarActivity extends AppCompatActivity { | |||
|             } | ||||
|         } | ||||
|         super.onCreate(savedInstanceState); | ||||
|         boolean dynamicColor = sharedpreferences.getBoolean(getString(R.string.SET_DYNAMICCOLOR), false); | ||||
|         if (dynamicColor) { | ||||
|             DynamicColors.applyToActivityIfAvailable(this); | ||||
|         } | ||||
|         if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { | ||||
|             Window window = getWindow(); | ||||
|             window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); | ||||
|  |  | |||
|  | @ -1,59 +0,0 @@ | |||
| package app.fedilab.android.mastodon.activities; | ||||
| /* Copyright 2022 Thomas Schneider | ||||
|  * | ||||
|  * This file is a part of Fedilab | ||||
|  * | ||||
|  * This program is free software; you can redistribute it and/or modify it under the terms of the | ||||
|  * GNU General Public License as published by the Free Software Foundation; either version 3 of the | ||||
|  * License, or (at your option) any later version. | ||||
|  * | ||||
|  * Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even | ||||
|  * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||||
|  * Public License for more details. | ||||
|  * | ||||
|  * You should have received a copy of the GNU General Public License along with Fedilab; if not, | ||||
|  * see <http://www.gnu.org/licenses>. */ | ||||
| 
 | ||||
| import android.annotation.SuppressLint; | ||||
| import android.content.SharedPreferences; | ||||
| import android.os.Bundle; | ||||
| 
 | ||||
| import androidx.annotation.Nullable; | ||||
| import androidx.fragment.app.FragmentActivity; | ||||
| import androidx.preference.PreferenceManager; | ||||
| 
 | ||||
| import com.vanniktech.emoji.EmojiManager; | ||||
| import com.vanniktech.emoji.one.EmojiOneProvider; | ||||
| 
 | ||||
| import org.conscrypt.Conscrypt; | ||||
| 
 | ||||
| import java.security.Security; | ||||
| 
 | ||||
| import app.fedilab.android.mastodon.helper.Helper; | ||||
| 
 | ||||
| 
 | ||||
| @SuppressLint("Registered") | ||||
| public class BaseFragmentActivity extends FragmentActivity { | ||||
| 
 | ||||
| 
 | ||||
|     static { | ||||
|         EmojiManager.install(new EmojiOneProvider()); | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     protected void onCreate(@Nullable Bundle savedInstanceState) { | ||||
|         boolean patch_provider = true; | ||||
|         try { | ||||
|             SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this); | ||||
|             patch_provider = sharedpreferences.getBoolean(Helper.SET_SECURITY_PROVIDER, true); | ||||
|         } catch (Exception ignored) { | ||||
|         } | ||||
|         if (patch_provider) { | ||||
|             try { | ||||
|                 Security.insertProviderAt(Conscrypt.newProvider(), 1); | ||||
|             } catch (Exception ignored) { | ||||
|             } | ||||
|         } | ||||
|         super.onCreate(savedInstanceState); | ||||
|     } | ||||
| } | ||||
|  | @ -30,6 +30,7 @@ import androidx.appcompat.app.AppCompatActivity; | |||
| import androidx.appcompat.app.AppCompatDelegate; | ||||
| import androidx.preference.PreferenceManager; | ||||
| 
 | ||||
| import com.google.android.material.color.DynamicColors; | ||||
| import com.vanniktech.emoji.EmojiManager; | ||||
| import com.vanniktech.emoji.one.EmojiOneProvider; | ||||
| 
 | ||||
|  | @ -128,6 +129,10 @@ public class BaseTransparentActivity extends AppCompatActivity { | |||
|             } | ||||
|         } | ||||
|         super.onCreate(savedInstanceState); | ||||
|         boolean dynamicColor = sharedpreferences.getBoolean(getString(R.string.SET_DYNAMICCOLOR), false); | ||||
|         if (dynamicColor) { | ||||
|             DynamicColors.applyToActivityIfAvailable(this); | ||||
|         } | ||||
|         if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { | ||||
|             Window window = getWindow(); | ||||
|             window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); | ||||
|  |  | |||
|  | @ -121,7 +121,7 @@ public class CacheActivity extends BaseBarActivity { | |||
|             finish(); | ||||
|             return true; | ||||
|         } else if (item.getItemId() == R.id.action_clear) { | ||||
|             AlertDialog.Builder deleteConfirm = new MaterialAlertDialogBuilder(CacheActivity.this, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder deleteConfirm = new MaterialAlertDialogBuilder(CacheActivity.this); | ||||
|             deleteConfirm.setTitle(getString(R.string.delete_cache)); | ||||
|             deleteConfirm.setMessage(getString(R.string.delete_cache_message)); | ||||
|             deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|  | @ -131,7 +131,7 @@ public class CacheActivity extends BaseBarActivity { | |||
|                         size = size / 1000000.0f; | ||||
|                     } | ||||
|                     binding.fileCacheSize.setText(String.format("%s %s", String.format(Locale.getDefault(), "%.2f", size), getString(R.string.cache_units))); | ||||
|                     AlertDialog.Builder restartBuilder = new MaterialAlertDialogBuilder(CacheActivity.this, Helper.dialogStyle()); | ||||
|                     AlertDialog.Builder restartBuilder = new MaterialAlertDialogBuilder(CacheActivity.this); | ||||
|                     restartBuilder.setMessage(getString(R.string.restart_the_app)); | ||||
|                     restartBuilder.setNegativeButton(R.string.no, (dialogRestart, whichRestart) -> { | ||||
|                         recreate(); | ||||
|  |  | |||
|  | @ -215,7 +215,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana | |||
|         } | ||||
|         if (canBeSent(statusDraft)) { | ||||
|             if (promptSaveDraft) { | ||||
|                 AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(ComposeActivity.this, Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(ComposeActivity.this); | ||||
|                 alt_bld.setMessage(R.string.save_draft); | ||||
|                 alt_bld.setPositiveButton(R.string.save, (dialog, id) -> { | ||||
|                     dialog.dismiss(); | ||||
|  | @ -316,7 +316,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana | |||
|         } else if (item.getItemId() == R.id.action_photo_camera) { | ||||
|             photoFileUri = MediaHelper.dispatchTakePictureIntent(ComposeActivity.this); | ||||
|         } else if (item.getItemId() == R.id.action_contacts) { | ||||
|             AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(ComposeActivity.this, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(ComposeActivity.this); | ||||
| 
 | ||||
|             builderSingle.setTitle(getString(R.string.select_accounts)); | ||||
|             PopupContactBinding popupContactBinding = PopupContactBinding.inflate(getLayoutInflater(), new LinearLayout(ComposeActivity.this), false); | ||||
|  |  | |||
|  | @ -45,7 +45,6 @@ import app.fedilab.android.mastodon.client.entities.api.Attachment; | |||
| import app.fedilab.android.mastodon.client.entities.api.Status; | ||||
| import app.fedilab.android.mastodon.client.entities.app.StatusDraft; | ||||
| import app.fedilab.android.mastodon.exception.DBException; | ||||
| import app.fedilab.android.mastodon.helper.Helper; | ||||
| import app.fedilab.android.mastodon.ui.drawer.StatusDraftAdapter; | ||||
| import app.fedilab.android.mastodon.viewmodel.mastodon.TimelinesVM; | ||||
| 
 | ||||
|  | @ -100,7 +99,7 @@ public class DraftActivity extends BaseActivity implements StatusDraftAdapter.Dr | |||
|             finish(); | ||||
|             return true; | ||||
|         } else if (item.getItemId() == R.id.action_delete) { | ||||
|             AlertDialog.Builder unfollowConfirm = new MaterialAlertDialogBuilder(DraftActivity.this, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder unfollowConfirm = new MaterialAlertDialogBuilder(DraftActivity.this); | ||||
|             unfollowConfirm.setTitle(getString(R.string.delete_all)); | ||||
|             unfollowConfirm.setMessage(getString(R.string.remove_draft)); | ||||
|             unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|  |  | |||
|  | @ -136,7 +136,7 @@ public class EditProfileActivity extends BaseBarActivity { | |||
|                     value = Html.fromHtml(field.value).toString(); | ||||
|                 fieldItemBinding.value.setText(value); | ||||
|                 fieldItemBinding.remove.setOnClickListener(v -> { | ||||
|                     AlertDialog.Builder deleteConfirm = new MaterialAlertDialogBuilder(EditProfileActivity.this, Helper.dialogStyle()); | ||||
|                     AlertDialog.Builder deleteConfirm = new MaterialAlertDialogBuilder(EditProfileActivity.this); | ||||
|                     deleteConfirm.setTitle(getString(R.string.delete_field)); | ||||
|                     deleteConfirm.setMessage(getString(R.string.delete_field_confirm)); | ||||
|                     deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|  | @ -158,7 +158,7 @@ public class EditProfileActivity extends BaseBarActivity { | |||
|         binding.addField.setOnClickListener(view -> { | ||||
|             AccountFieldItemBinding fieldItemBinding = AccountFieldItemBinding.inflate(getLayoutInflater()); | ||||
|             fieldItemBinding.remove.setOnClickListener(v -> { | ||||
|                 AlertDialog.Builder deleteConfirm = new MaterialAlertDialogBuilder(EditProfileActivity.this, Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder deleteConfirm = new MaterialAlertDialogBuilder(EditProfileActivity.this); | ||||
|                 deleteConfirm.setTitle(getString(R.string.delete_field)); | ||||
|                 deleteConfirm.setMessage(getString(R.string.delete_field_confirm)); | ||||
|                 deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|  |  | |||
|  | @ -44,7 +44,6 @@ import app.fedilab.android.activities.MainActivity; | |||
| import app.fedilab.android.databinding.ActivityFiltersBinding; | ||||
| import app.fedilab.android.databinding.PopupAddFilterBinding; | ||||
| import app.fedilab.android.mastodon.client.entities.api.Filter; | ||||
| import app.fedilab.android.mastodon.helper.Helper; | ||||
| import app.fedilab.android.mastodon.ui.drawer.FilterAdapter; | ||||
| import app.fedilab.android.mastodon.ui.drawer.KeywordAdapter; | ||||
| import app.fedilab.android.mastodon.viewmodel.mastodon.FiltersVM; | ||||
|  | @ -63,7 +62,7 @@ public class FilterActivity extends BaseBarActivity implements FilterAdapter.Del | |||
|      * @param listener - {@link FilterAdapter.FilterAction} | ||||
|      */ | ||||
|     public static void addEditFilter(Context context, Filter filter, FilterAdapter.FilterAction listener) { | ||||
|         AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|         AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(context); | ||||
|         PopupAddFilterBinding popupAddFilterBinding = PopupAddFilterBinding.inflate(LayoutInflater.from(context)); | ||||
|         FiltersVM filtersVM = new ViewModelProvider((ViewModelStoreOwner) context).get(FiltersVM.class); | ||||
|         dialogBuilder.setView(popupAddFilterBinding.getRoot()); | ||||
|  |  | |||
|  | @ -90,7 +90,7 @@ public class FollowedTagActivity extends BaseBarActivity implements FollowedTagA | |||
|             onBackPressed(); | ||||
|             return true; | ||||
|         } else if (item.getItemId() == R.id.action_unfollow && tag != null) { | ||||
|             AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(FollowedTagActivity.this, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(FollowedTagActivity.this); | ||||
|             alt_bld.setTitle(R.string.action_unfollow_tag); | ||||
|             alt_bld.setMessage(R.string.action_unfollow_tag_confirm); | ||||
|             alt_bld.setPositiveButton(R.string.unfollow, (dialog, id) -> { | ||||
|  | @ -122,7 +122,7 @@ public class FollowedTagActivity extends BaseBarActivity implements FollowedTagA | |||
|             AlertDialog alert = alt_bld.create(); | ||||
|             alert.show(); | ||||
|         } else if (item.getItemId() == R.id.action_follow_tag) { | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(FollowedTagActivity.this, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(FollowedTagActivity.this); | ||||
|             PopupAddFollowedTagtBinding popupAddFollowedTagtBinding = PopupAddFollowedTagtBinding.inflate(getLayoutInflater()); | ||||
|             dialogBuilder.setView(popupAddFollowedTagtBinding.getRoot()); | ||||
|             popupAddFollowedTagtBinding.addTag.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)}); | ||||
|  |  | |||
|  | @ -173,7 +173,7 @@ public class HashTagActivity extends BaseActivity { | |||
|         } else if (item.getItemId() == R.id.action_add_timeline) { | ||||
| 
 | ||||
|             if (pinnedTag) { | ||||
|                 AlertDialog.Builder unpinConfirm = new MaterialAlertDialogBuilder(HashTagActivity.this, Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder unpinConfirm = new MaterialAlertDialogBuilder(HashTagActivity.this); | ||||
|                 unpinConfirm.setMessage(getString(R.string.unpin_timeline_description)); | ||||
|                 unpinConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|                 unpinConfirm.setPositiveButton(R.string.yes, (dialog, which) -> { | ||||
|  |  | |||
|  | @ -147,7 +147,7 @@ public class MastodonListActivity extends BaseBarActivity implements MastodonLis | |||
|             onBackPressed(); | ||||
|             return true; | ||||
|         } else if (item.getItemId() == R.id.action_user_mute_home) { | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(MastodonListActivity.this, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(MastodonListActivity.this); | ||||
|             dialogBuilder.setTitle(R.string.put_all_accounts_in_home_muted); | ||||
|             dialogBuilder.setPositiveButton(R.string.mute_them_all, (dialog, id) -> { | ||||
|                 timelinesVM.getAccountsInList(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, mastodonList.id, null, null, 0) | ||||
|  | @ -161,7 +161,7 @@ public class MastodonListActivity extends BaseBarActivity implements MastodonLis | |||
|             dialogBuilder.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss()); | ||||
|             dialogBuilder.show(); | ||||
|         } else if (item.getItemId() == R.id.action_manage_users) { | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(MastodonListActivity.this, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(MastodonListActivity.this); | ||||
|             PopupManageAccountsListBinding popupManageAccountsListBinding = PopupManageAccountsListBinding.inflate(getLayoutInflater()); | ||||
|             dialogBuilder.setView(popupManageAccountsListBinding.getRoot()); | ||||
|             popupManageAccountsListBinding.loader.setVisibility(View.VISIBLE); | ||||
|  | @ -258,7 +258,7 @@ public class MastodonListActivity extends BaseBarActivity implements MastodonLis | |||
|             dialogBuilder.setPositiveButton(R.string.close, (dialog, id) -> dialog.dismiss()); | ||||
|             dialogBuilder.create().show(); | ||||
|         } else if (item.getItemId() == R.id.action_delete && mastodonList != null) { | ||||
|             AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(MastodonListActivity.this, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(MastodonListActivity.this); | ||||
|             alt_bld.setTitle(R.string.action_lists_delete); | ||||
|             alt_bld.setMessage(R.string.action_lists_confirm_delete); | ||||
|             alt_bld.setPositiveButton(R.string.delete, (dialog, id) -> { | ||||
|  | @ -296,7 +296,7 @@ public class MastodonListActivity extends BaseBarActivity implements MastodonLis | |||
|             AlertDialog alert = alt_bld.create(); | ||||
|             alert.show(); | ||||
|         } else if (item.getItemId() == R.id.action_add_list) { | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(MastodonListActivity.this, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(MastodonListActivity.this); | ||||
|             PopupAddListBinding popupAddListBinding = PopupAddListBinding.inflate(getLayoutInflater()); | ||||
|             dialogBuilder.setView(popupAddListBinding.getRoot()); | ||||
|             popupAddListBinding.addList.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)}); | ||||
|  | @ -336,7 +336,7 @@ public class MastodonListActivity extends BaseBarActivity implements MastodonLis | |||
|             dialogBuilder.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss()); | ||||
|             dialogBuilder.create().show(); | ||||
|         } else if (item.getItemId() == R.id.action_edit) { | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(MastodonListActivity.this, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(MastodonListActivity.this); | ||||
|             PopupAddListBinding popupAddListBinding = PopupAddListBinding.inflate(getLayoutInflater()); | ||||
|             dialogBuilder.setView(popupAddListBinding.getRoot()); | ||||
|             popupAddListBinding.addList.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)}); | ||||
|  |  | |||
|  | @ -477,7 +477,7 @@ public class ProfileActivity extends BaseActivity { | |||
|             } else if (doAction == action.UNFOLLOW) { | ||||
|                 boolean confirm_unfollow = sharedpreferences.getBoolean(getString(R.string.SET_UNFOLLOW_VALIDATION), true); | ||||
|                 if (confirm_unfollow) { | ||||
|                     AlertDialog.Builder unfollowConfirm = new MaterialAlertDialogBuilder(ProfileActivity.this, Helper.dialogStyle()); | ||||
|                     AlertDialog.Builder unfollowConfirm = new MaterialAlertDialogBuilder(ProfileActivity.this); | ||||
|                     unfollowConfirm.setTitle(getString(R.string.unfollow_confirm)); | ||||
|                     unfollowConfirm.setMessage(account.acct); | ||||
|                     unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|  | @ -565,7 +565,7 @@ public class ProfileActivity extends BaseActivity { | |||
|             //Recyclerview for identity proof has not been inflated yet | ||||
|             if (identityProofsRecycler == null) { | ||||
|                 identity_proofs_indicator.setOnClickListener(v -> { | ||||
|                     AlertDialog.Builder builder = new MaterialAlertDialogBuilder(ProfileActivity.this, Helper.dialogStyle()); | ||||
|                     AlertDialog.Builder builder = new MaterialAlertDialogBuilder(ProfileActivity.this); | ||||
|                     identityProofsRecycler = new RecyclerView(ProfileActivity.this); | ||||
|                     LinearLayoutManager mLayoutManager = new LinearLayoutManager(ProfileActivity.this); | ||||
|                     identityProofsRecycler.setLayoutManager(mLayoutManager); | ||||
|  | @ -675,7 +675,7 @@ public class ProfileActivity extends BaseActivity { | |||
|                 binding.personalNote.setText(relationship.note); | ||||
|             } | ||||
|             binding.personalNote.setOnClickListener(view -> { | ||||
|                 AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(ProfileActivity.this, Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(ProfileActivity.this); | ||||
|                 builderInner.setTitle(R.string.note_for_account); | ||||
|                 EditText input = new EditText(ProfileActivity.this); | ||||
|                 LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams( | ||||
|  | @ -860,7 +860,7 @@ public class ProfileActivity extends BaseActivity { | |||
|             }); | ||||
|             return true; | ||||
|         } else if (itemId == R.id.action_filter) { | ||||
|             AlertDialog.Builder filterTagDialog = new MaterialAlertDialogBuilder(ProfileActivity.this, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder filterTagDialog = new MaterialAlertDialogBuilder(ProfileActivity.this); | ||||
|             Set<String> featuredTagsSet = sharedpreferences.getStringSet(getString(R.string.SET_FEATURED_TAGS), null); | ||||
|             List<String> tags = new ArrayList<>(); | ||||
|             if (featuredTagsSet != null) { | ||||
|  | @ -941,7 +941,7 @@ public class ProfileActivity extends BaseActivity { | |||
|                         i++; | ||||
|                     } | ||||
|                 } | ||||
|                 AlertDialog.Builder builder = new MaterialAlertDialogBuilder(ProfileActivity.this, Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder builder = new MaterialAlertDialogBuilder(ProfileActivity.this); | ||||
|                 builder.setTitle(getString(R.string.filter_languages)); | ||||
|                 builder.setMultiChoiceItems(languagesArr, presentArr, (dialog, which, isChecked) -> { | ||||
|                     List<String> languagesFilter = new ArrayList<>(); | ||||
|  | @ -986,7 +986,7 @@ public class ProfileActivity extends BaseActivity { | |||
|                         } | ||||
|                         accountsVM.getListContainingAccount(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id) | ||||
|                                 .observe(ProfileActivity.this, mastodonListUserIs -> { | ||||
|                                     AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(ProfileActivity.this, Helper.dialogStyle()); | ||||
|                                     AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(ProfileActivity.this); | ||||
|                                     builderSingle.setTitle(getString(R.string.action_lists_add_to)); | ||||
|                                     builderSingle.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss()); | ||||
|                                     String[] listsId = new String[mastodonLists.size()]; | ||||
|  | @ -1078,7 +1078,7 @@ public class ProfileActivity extends BaseActivity { | |||
|                             }); | ||||
|                     return true; | ||||
|                 } | ||||
|                 builderInner = new MaterialAlertDialogBuilder(ProfileActivity.this, Helper.dialogStyle()); | ||||
|                 builderInner = new MaterialAlertDialogBuilder(ProfileActivity.this); | ||||
|                 builderInner.setTitle(stringArrayConf[0]); | ||||
| 
 | ||||
|                 builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|  | @ -1098,7 +1098,7 @@ public class ProfileActivity extends BaseActivity { | |||
|                 builderInner.show(); | ||||
|             } | ||||
|         } else if (itemId == R.id.action_mute_home) { | ||||
|             AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(ProfileActivity.this, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(ProfileActivity.this); | ||||
|             builderInner.setMessage(account.acct); | ||||
|             builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|             if (homeMuted) { | ||||
|  | @ -1126,7 +1126,7 @@ public class ProfileActivity extends BaseActivity { | |||
|             }); | ||||
|             return true; | ||||
|         } else if (itemId == R.id.action_report) { | ||||
|             AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(ProfileActivity.this, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(ProfileActivity.this); | ||||
|             builderInner.setTitle(R.string.report_account); | ||||
|             //Text for report | ||||
|             EditText input = new EditText(ProfileActivity.this); | ||||
|  | @ -1146,7 +1146,7 @@ public class ProfileActivity extends BaseActivity { | |||
|             builderInner.show(); | ||||
|             return true; | ||||
|         } else if (itemId == R.id.action_block) { | ||||
|             AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(ProfileActivity.this, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(ProfileActivity.this); | ||||
|             if (relationship != null) { | ||||
|                 if (relationship.blocking) { | ||||
|                     builderInner.setTitle(stringArrayConf[5]); | ||||
|  | @ -1186,7 +1186,7 @@ public class ProfileActivity extends BaseActivity { | |||
|             }); | ||||
|             builderInner.show(); | ||||
|         } else if (itemId == R.id.action_block_instance) { | ||||
|             AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(ProfileActivity.this, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(ProfileActivity.this); | ||||
|             String domain = account.acct.split("@")[1]; | ||||
|             builderInner.setMessage(getString(R.string.block_domain_confirm_message, domain)); | ||||
|             builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|  |  | |||
|  | @ -170,7 +170,7 @@ public class ReorderTimelinesActivity extends BaseBarActivity implements OnStart | |||
|     } | ||||
| 
 | ||||
|     private void addInstance() { | ||||
|         AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(ReorderTimelinesActivity.this, Helper.dialogStyle()); | ||||
|         AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(ReorderTimelinesActivity.this); | ||||
|         PopupSearchInstanceBinding popupSearchInstanceBinding = PopupSearchInstanceBinding.inflate(getLayoutInflater()); | ||||
|         dialogBuilder.setView(popupSearchInstanceBinding.getRoot()); | ||||
|         TextWatcher textWatcher = autoComplete(popupSearchInstanceBinding); | ||||
|  |  | |||
|  | @ -165,7 +165,7 @@ public class AdminActionActivity extends BaseBarActivity { | |||
|             return true; | ||||
|         } else if (item.getItemId() == R.id.action_filter) { | ||||
|             if (getTitle().toString().equalsIgnoreCase(getString(R.string.accounts))) { | ||||
|                 AlertDialog.Builder alertDialogBuilder = new MaterialAlertDialogBuilder(AdminActionActivity.this, Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder alertDialogBuilder = new MaterialAlertDialogBuilder(AdminActionActivity.this); | ||||
|                 PopupAdminFilterAccountsBinding binding = PopupAdminFilterAccountsBinding.inflate(getLayoutInflater()); | ||||
|                 alertDialogBuilder.setView(binding.getRoot()); | ||||
|                 if (local != null && remote == null) { | ||||
|  | @ -259,7 +259,7 @@ public class AdminActionActivity extends BaseBarActivity { | |||
|                 AlertDialog alert = alertDialogBuilder.create(); | ||||
|                 alert.show(); | ||||
|             } else { | ||||
|                 AlertDialog.Builder alertDialogBuilder = new MaterialAlertDialogBuilder(AdminActionActivity.this, Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder alertDialogBuilder = new MaterialAlertDialogBuilder(AdminActionActivity.this); | ||||
|                 PopupAdminFilterReportsBinding binding = PopupAdminFilterReportsBinding.inflate(getLayoutInflater()); | ||||
|                 alertDialogBuilder.setView(binding.getRoot()); | ||||
|                 if (resolved == null) { | ||||
|  |  | |||
|  | @ -129,7 +129,7 @@ public class AdminDomainBlockActivity extends BaseBarActivity { | |||
|             return true; | ||||
|         } else if (itemId == R.id.action_delete) { | ||||
|             if (adminDomainBlock.id != null) { | ||||
|                 AlertDialog.Builder builder = new MaterialAlertDialogBuilder(AdminDomainBlockActivity.this, Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder builder = new MaterialAlertDialogBuilder(AdminDomainBlockActivity.this); | ||||
|                 builder.setMessage(getString(R.string.unblock_domain_confirm, adminDomainBlock.domain)); | ||||
|                 builder | ||||
|                         .setPositiveButton(R.string.unblock_domain, (dialog, which) -> { | ||||
|  |  | |||
|  | @ -84,7 +84,7 @@ public class CrossActionHelper { | |||
|                     } | ||||
|                     Handler mainHandler = new Handler(Looper.getMainLooper()); | ||||
|                     Runnable myRunnable = () -> { | ||||
|                         AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                         AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(context); | ||||
|                         builderSingle.setTitle(context.getString(R.string.choose_accounts)); | ||||
|                         final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList); | ||||
|                         final BaseAccount[] accountArray = new BaseAccount[accounts.size()]; | ||||
|  | @ -99,7 +99,7 @@ public class CrossActionHelper { | |||
|                             boolean confirmBoost = sharedpreferences.getBoolean(context.getString(R.string.SET_NOTIF_VALIDATION), true); | ||||
|                             BaseAccount selectedAccount = accountArray[which]; | ||||
|                             if ((actionType == TypeOfCrossAction.REBLOG_ACTION && confirmBoost) || (actionType == TypeOfCrossAction.FAVOURITE_ACTION && confirmFav)) { | ||||
|                                 AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                                 AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(context); | ||||
|                                 if (actionType == TypeOfCrossAction.REBLOG_ACTION) { | ||||
|                                     alt_bld.setMessage(context.getString(R.string.reblog_add)); | ||||
|                                 } else { | ||||
|  | @ -420,7 +420,7 @@ public class CrossActionHelper { | |||
|                 context.startActivity(intentToot); | ||||
|                 ((BaseActivity) context).finish(); | ||||
|             } else { | ||||
|                 AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(context); | ||||
|                 builderSingle.setTitle(context.getString(R.string.choose_accounts)); | ||||
|                 final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList); | ||||
|                 final BaseAccount[] accountArray = new BaseAccount[accounts.size()]; | ||||
|  |  | |||
|  | @ -416,7 +416,7 @@ public class Helper { | |||
|      * @param url     String download url | ||||
|      */ | ||||
|     public static void manageDownloads(final Context context, final String url) { | ||||
|         final AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|         final AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context); | ||||
|         final DownloadManager.Request request; | ||||
|         try { | ||||
|             request = new DownloadManager.Request(Uri.parse(url.trim())); | ||||
|  | @ -1811,7 +1811,7 @@ public class Helper { | |||
|                 is.close(); | ||||
|                 String json = new String(buffer, StandardCharsets.UTF_8); | ||||
|                 Gson gson = new Gson(); | ||||
|                 AlertDialog.Builder dialogBuilderOptin = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder dialogBuilderOptin = new MaterialAlertDialogBuilder(activity); | ||||
|                 PopupReleaseNotesBinding binding = PopupReleaseNotesBinding.inflate(activity.getLayoutInflater()); | ||||
|                 dialogBuilderOptin.setView(binding.getRoot()); | ||||
|                 try { | ||||
|  |  | |||
|  | @ -412,7 +412,7 @@ public class MastodonHelper { | |||
|      * @param status  {@link Status} | ||||
|      */ | ||||
|     public static void scheduleBoost(Context context, ScheduleType scheduleType, Status status, Account account, TimedMuted listener) { | ||||
|         AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|         AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(context); | ||||
|         DatetimePickerBinding binding = DatetimePickerBinding.inflate(((Activity) context).getLayoutInflater()); | ||||
|         dialogBuilder.setView(binding.getRoot()); | ||||
|         final AlertDialog alertDialogBoost = dialogBuilder.create(); | ||||
|  |  | |||
|  | @ -278,7 +278,7 @@ public class MediaHelper { | |||
|         AudioRecorder mAudioRecorder = AudioRecorder.getInstance(); | ||||
|         File mAudioFile = new File(filePath); | ||||
|         PopupRecordBinding binding = PopupRecordBinding.inflate(activity.getLayoutInflater()); | ||||
|         AlertDialog.Builder audioPopup = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); | ||||
|         AlertDialog.Builder audioPopup = new MaterialAlertDialogBuilder(activity); | ||||
|         audioPopup.setView(binding.getRoot()); | ||||
|         AlertDialog alert = audioPopup.create(); | ||||
|         alert.show(); | ||||
|  | @ -326,7 +326,7 @@ public class MediaHelper { | |||
|      * @param listener - OnSchedule | ||||
|      */ | ||||
|     public static void scheduleMessage(Activity activity, OnSchedule listener) { | ||||
|         AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); | ||||
|         AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(activity); | ||||
|         DatetimePickerBinding binding = DatetimePickerBinding.inflate(activity.getLayoutInflater()); | ||||
| 
 | ||||
|         dialogBuilder.setView(binding.getRoot()); | ||||
|  |  | |||
|  | @ -697,7 +697,7 @@ public class PinnedTimelineHelper { | |||
|                 itemShowDMs.setChecked(show_dms); | ||||
|                 editor.apply(); | ||||
|             } else if (itemId == R.id.action_filter) { | ||||
|                 AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(activity); | ||||
|                 LayoutInflater inflater = activity.getLayoutInflater(); | ||||
|                 View dialogView = inflater.inflate(R.layout.popup_filter_regex, new LinearLayout(activity), false); | ||||
|                 dialogBuilder.setView(dialogView); | ||||
|  | @ -886,7 +886,7 @@ public class PinnedTimelineHelper { | |||
|                     e.printStackTrace(); | ||||
|                 } | ||||
|             } else if (itemId == R.id.action_any) { | ||||
|                 AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(activity); | ||||
|                 LayoutInflater inflater = activity.getLayoutInflater(); | ||||
|                 View dialogView = inflater.inflate(R.layout.tags_any, new LinearLayout(activity), false); | ||||
|                 dialogBuilder.setView(dialogView); | ||||
|  | @ -915,7 +915,7 @@ public class PinnedTimelineHelper { | |||
|                 LayoutInflater inflater; | ||||
|                 View dialogView; | ||||
|                 AlertDialog alertDialog; | ||||
|                 dialogBuilder = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); | ||||
|                 dialogBuilder = new MaterialAlertDialogBuilder(activity); | ||||
|                 inflater = activity.getLayoutInflater(); | ||||
|                 dialogView = inflater.inflate(R.layout.tags_all, new LinearLayout(activity), false); | ||||
|                 dialogBuilder.setView(dialogView); | ||||
|  | @ -944,7 +944,7 @@ public class PinnedTimelineHelper { | |||
|                 LayoutInflater inflater; | ||||
|                 View dialogView; | ||||
|                 AlertDialog alertDialog; | ||||
|                 dialogBuilder = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); | ||||
|                 dialogBuilder = new MaterialAlertDialogBuilder(activity); | ||||
|                 inflater = activity.getLayoutInflater(); | ||||
|                 dialogView = inflater.inflate(R.layout.tags_all, new LinearLayout(activity), false); | ||||
|                 dialogBuilder.setView(dialogView); | ||||
|  | @ -973,7 +973,7 @@ public class PinnedTimelineHelper { | |||
|                 LayoutInflater inflater; | ||||
|                 View dialogView; | ||||
|                 AlertDialog alertDialog; | ||||
|                 dialogBuilder = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); | ||||
|                 dialogBuilder = new MaterialAlertDialogBuilder(activity); | ||||
|                 inflater = activity.getLayoutInflater(); | ||||
|                 dialogView = inflater.inflate(R.layout.tags_name, new LinearLayout(activity), false); | ||||
|                 dialogBuilder.setView(dialogView); | ||||
|  | @ -1114,7 +1114,7 @@ public class PinnedTimelineHelper { | |||
|                     e.printStackTrace(); | ||||
|                 } | ||||
|             } else if (itemId == R.id.action_exclude_visibility) { | ||||
|                 AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(activity); | ||||
|                 DialogBubbleExcludeVisibilityBinding dialogBinding = DialogBubbleExcludeVisibilityBinding.inflate(activity.getLayoutInflater()); | ||||
|                 dialogBuilder.setView(dialogBinding.getRoot()); | ||||
|                 dialogBuilder.setTitle(R.string.exclude_visibility); | ||||
|  | @ -1208,7 +1208,7 @@ public class PinnedTimelineHelper { | |||
|             } else if (itemId == R.id.action_reply_visibility) { | ||||
|                 AlertDialog.Builder dialogBuilder; | ||||
|                 AlertDialog alertDialog; | ||||
|                 dialogBuilder = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); | ||||
|                 dialogBuilder = new MaterialAlertDialogBuilder(activity); | ||||
|                 DialogBubbleReplyVisibilityBinding dialogBinding = DialogBubbleReplyVisibilityBinding.inflate(activity.getLayoutInflater()); | ||||
|                 dialogBuilder.setView(dialogBinding.getRoot()); | ||||
|                 dialogBuilder.setTitle(R.string.reply_visibility); | ||||
|  | @ -1403,7 +1403,7 @@ public class PinnedTimelineHelper { | |||
|                 } | ||||
|             }); | ||||
|             changes[0] = true; | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(activity); | ||||
|             LayoutInflater inflater = activity.getLayoutInflater(); | ||||
|             View dialogView = inflater.inflate(R.layout.tags_instance, new LinearLayout(activity), false); | ||||
|             dialogBuilder.setView(dialogView); | ||||
|  | @ -1497,7 +1497,7 @@ public class PinnedTimelineHelper { | |||
|                 LayoutInflater inflater; | ||||
|                 View dialogView; | ||||
|                 AlertDialog alertDialog; | ||||
|                 dialogBuilder = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); | ||||
|                 dialogBuilder = new MaterialAlertDialogBuilder(activity); | ||||
|                 inflater = activity.getLayoutInflater(); | ||||
|                 dialogView = inflater.inflate(R.layout.tags_name, new LinearLayout(activity), false); | ||||
|                 dialogBuilder.setView(dialogView); | ||||
|  | @ -1527,7 +1527,7 @@ public class PinnedTimelineHelper { | |||
|                 alertDialog.show(); | ||||
|             } else if (itemId == R.id.action_nitter_manage_accounts) { | ||||
|                 String accounts = remoteInstance.host; | ||||
|                 AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(activity); | ||||
|                 LayoutInflater inflater = activity.getLayoutInflater(); | ||||
|                 View dialogView = inflater.inflate(R.layout.tags_any, new LinearLayout(activity), false); | ||||
|                 dialogBuilder.setView(dialogView); | ||||
|  |  | |||
|  | @ -59,7 +59,7 @@ public class PushHelper { | |||
|                     Runnable myRunnable = () -> { | ||||
|                         List<String> distributors = UnifiedPush.getDistributors(context, new ArrayList<>()); | ||||
|                         if (distributors.size() == 0) { | ||||
|                             AlertDialog.Builder alert = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                             AlertDialog.Builder alert = new MaterialAlertDialogBuilder(context); | ||||
|                             alert.setTitle(R.string.no_distributors_found); | ||||
|                             final TextView message = new TextView(context); | ||||
|                             String link = "https://fedilab.app/wiki/features/push-notifications/"; | ||||
|  | @ -136,7 +136,7 @@ public class PushHelper { | |||
|             return; | ||||
|         } | ||||
| 
 | ||||
|         AlertDialog.Builder alert = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|         AlertDialog.Builder alert = new MaterialAlertDialogBuilder(context); | ||||
|         alert.setTitle(R.string.select_distributors); | ||||
|         String[] distributorsStr = distributors.toArray(new String[0]); | ||||
|         alert.setSingleChoiceItems(distributorsStr, -1, (dialog, item) -> { | ||||
|  |  | |||
|  | @ -640,7 +640,7 @@ public class SpannableHelper { | |||
|                 return; | ||||
|             } | ||||
|         } | ||||
|         AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|         AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context); | ||||
|         builder.setMessage(context.getString(R.string.mute_tag, tag)); | ||||
|         builder | ||||
|                 .setPositiveButton(R.string.yes, (dialog, which) -> { | ||||
|  |  | |||
|  | @ -108,7 +108,7 @@ public class TranslateHelper { | |||
|                 } | ||||
|                 j++; | ||||
|             } | ||||
|             AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context); | ||||
|             builder.setTitle(context.getString(R.string.translate_in)); | ||||
|             builder.setItems(languagesArr, (dialogInterface, i) -> { | ||||
|                 myTransL.translate(statusToTranslate, codesArr[i], params, new Results() { | ||||
|  |  | |||
|  | @ -237,7 +237,7 @@ public class AccountAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder | |||
|                 } else if (finalDoAction == ProfileActivity.action.UNFOLLOW) { | ||||
|                     boolean confirm_unfollow = sharedpreferences.getBoolean(context.getString(R.string.SET_UNFOLLOW_VALIDATION), true); | ||||
|                     if (confirm_unfollow) { | ||||
|                         AlertDialog.Builder unfollowConfirm = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                         AlertDialog.Builder unfollowConfirm = new MaterialAlertDialogBuilder(context); | ||||
|                         unfollowConfirm.setTitle(context.getString(R.string.unfollow_confirm)); | ||||
|                         unfollowConfirm.setMessage(account.acct); | ||||
|                         unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|  |  | |||
|  | @ -158,7 +158,7 @@ public class AnnouncementAdapter extends RecyclerView.Adapter<AnnouncementAdapte | |||
|             emojiPopup.toggle(); | ||||
|         }); | ||||
|         holder.binding.statusAddCustomEmoji.setOnClickListener(v -> { | ||||
|             final AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|             final AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context); | ||||
|             int paddingPixel = 15; | ||||
|             float density = context.getResources().getDisplayMetrics().density; | ||||
|             int paddingDp = (int) (paddingPixel * density); | ||||
|  |  | |||
|  | @ -1111,7 +1111,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder | |||
|                         context.startActivity(intent); | ||||
|                     }); | ||||
|                     composeAttachmentItemBinding.buttonDescription.setOnClickListener(v -> { | ||||
|                         AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                         AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(context); | ||||
|                         builderInner.setTitle(R.string.upload_form_description); | ||||
|                         PopupMediaDescriptionBinding popupMediaDescriptionBinding = PopupMediaDescriptionBinding.inflate(LayoutInflater.from(context), null, false); | ||||
|                         builderInner.setView(popupMediaDescriptionBinding.getRoot()); | ||||
|  | @ -1173,7 +1173,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder | |||
|                         } | ||||
|                     }); | ||||
|                     composeAttachmentItemBinding.buttonRemove.setOnClickListener(v -> { | ||||
|                         AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                         AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(context); | ||||
|                         builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|                         builderInner.setPositiveButton(R.string.delete, (dialog, which) -> { | ||||
|                             attachmentList.remove(attachment); | ||||
|  | @ -1302,7 +1302,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder | |||
|                 holder.binding.buttonMathsComposer.setVisibility(View.VISIBLE); | ||||
|                 holder.binding.buttonMathsComposer.setOnClickListener(v -> { | ||||
|                     int cursorPosition = holder.binding.content.getSelectionStart(); | ||||
|                     AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                     AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context); | ||||
|                     Resources res = context.getResources(); | ||||
|                     String[] formatArr = res.getStringArray(R.array.SET_MATHS_FORMAT); | ||||
|                     builder.setItems(formatArr, (dialogInterface, i) -> { | ||||
|  | @ -1333,7 +1333,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder | |||
|                     holder.binding.buttonLocalOnly.setVisibility(View.VISIBLE); | ||||
|                 } | ||||
|                 holder.binding.buttonTextFormat.setOnClickListener(v -> { | ||||
|                     AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                     AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context); | ||||
|                     builder.setTitle(context.getString(R.string.post_format)); | ||||
|                     Resources res = context.getResources(); | ||||
|                     String[] formatArr = res.getStringArray(R.array.SET_POST_FORMAT); | ||||
|  | @ -1358,7 +1358,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder | |||
|                     builder.create().show(); | ||||
|                 }); | ||||
|                 holder.binding.buttonLocalOnly.setOnClickListener(v -> { | ||||
|                     AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                     AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context); | ||||
|                     builder.setTitle(context.getString(R.string.local_only)); | ||||
|                     Resources res = context.getResources(); | ||||
|                     boolean[] valArr = new boolean[]{false, true}; | ||||
|  | @ -1674,7 +1674,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder | |||
|                 } | ||||
| 
 | ||||
|                 SharedPreferences.Editor editor = sharedpreferences.edit(); | ||||
|                 AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context); | ||||
|                 builder.setTitle(context.getString(R.string.message_language)); | ||||
| 
 | ||||
|                 builder.setSingleChoiceItems(languagesArr, selection, null); | ||||
|  | @ -1708,7 +1708,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder | |||
|      * @param position    - int position | ||||
|      */ | ||||
|     private void displayPollPopup(ComposeViewHolder holder, Status statusDraft, int position) { | ||||
|         AlertDialog.Builder alertPoll = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|         AlertDialog.Builder alertPoll = new MaterialAlertDialogBuilder(context); | ||||
|         alertPoll.setTitle(R.string.create_poll); | ||||
|         ComposePollBinding composePollBinding = ComposePollBinding.inflate(LayoutInflater.from(context), new LinearLayout(context), false); | ||||
|         alertPoll.setView(composePollBinding.getRoot()); | ||||
|  | @ -1951,7 +1951,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder | |||
|      */ | ||||
|     private void displayEmojiPicker(ComposeViewHolder holder, String instance) throws DBException { | ||||
| 
 | ||||
|         final AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|         final AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context); | ||||
|         int paddingPixel = 15; | ||||
|         float density = context.getResources().getDisplayMetrics().density; | ||||
|         int paddingDp = (int) (paddingPixel * density); | ||||
|  |  | |||
|  | @ -76,7 +76,7 @@ public class DomainBlockAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo | |||
|         holder.binding.domainName.setText(domain); | ||||
|         AccountsVM accountsVM = new ViewModelProvider((ViewModelStoreOwner) context).get(AccountsVM.class); | ||||
|         holder.binding.unblockDomain.setOnClickListener(v -> { | ||||
|             AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(context); | ||||
|             alt_bld.setMessage(context.getString(R.string.unblock_domain_confirm, domain)); | ||||
|             alt_bld.setPositiveButton(R.string.yes, (dialog, id) -> { | ||||
|                 accountsVM.removeDomainBlocks(MainActivity.currentInstance, MainActivity.currentToken, domain); | ||||
|  |  | |||
|  | @ -34,7 +34,6 @@ import app.fedilab.android.R; | |||
| import app.fedilab.android.databinding.DrawerFilterBinding; | ||||
| import app.fedilab.android.mastodon.activities.FilterActivity; | ||||
| import app.fedilab.android.mastodon.client.entities.api.Filter; | ||||
| import app.fedilab.android.mastodon.helper.Helper; | ||||
| import app.fedilab.android.mastodon.viewmodel.mastodon.FiltersVM; | ||||
| 
 | ||||
| 
 | ||||
|  | @ -90,7 +89,7 @@ public class FilterAdapter extends RecyclerView.Adapter<FilterAdapter.FilterView | |||
|             } | ||||
|         })); | ||||
|         holder.binding.deleteFilter.setOnClickListener(v -> { | ||||
|             AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context); | ||||
|             builder.setTitle(R.string.action_filter_delete); | ||||
|             builder.setMessage(R.string.action_lists_confirm_delete); | ||||
|             builder.setIcon(android.R.drawable.ic_dialog_alert) | ||||
|  |  | |||
|  | @ -42,7 +42,6 @@ import app.fedilab.android.mastodon.client.entities.app.PinnedTimeline; | |||
| import app.fedilab.android.mastodon.client.entities.app.RemoteInstance; | ||||
| import app.fedilab.android.mastodon.client.entities.app.Timeline; | ||||
| import app.fedilab.android.mastodon.exception.DBException; | ||||
| import app.fedilab.android.mastodon.helper.Helper; | ||||
| import app.fedilab.android.mastodon.helper.itemtouchhelper.ItemTouchHelperAdapter; | ||||
| import app.fedilab.android.mastodon.helper.itemtouchhelper.ItemTouchHelperViewHolder; | ||||
| import app.fedilab.android.mastodon.helper.itemtouchhelper.OnStartDragListener; | ||||
|  | @ -185,7 +184,7 @@ public class ReorderTabAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol | |||
|         } | ||||
|         holder.binding.delete.setOnClickListener(v -> { | ||||
|             if (item.type == Timeline.TimeLineEnum.TAG || item.type == Timeline.TimeLineEnum.REMOTE || item.type == Timeline.TimeLineEnum.LIST) { | ||||
|                 AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(context); | ||||
|                 String title = ""; | ||||
|                 String message = ""; | ||||
|                 alt_bld.setTitle(R.string.action_lists_delete); | ||||
|  |  | |||
|  | @ -571,7 +571,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
|             }); | ||||
|             holder.binding.statusAddCustomEmoji.setOnClickListener(v -> { | ||||
| 
 | ||||
|                 final AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                 final AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context); | ||||
|                 int paddingPixel = 15; | ||||
|                 float density = context.getResources().getDisplayMetrics().density; | ||||
|                 int paddingDp = (int) (paddingPixel * density); | ||||
|  | @ -914,7 +914,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
|             }); | ||||
|             holder.binding.actionButtonBoost.setOnClickListener(v -> { | ||||
|                 if (confirmBoost) { | ||||
|                     AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                     AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(context); | ||||
|                     if (statusToDeal.reblogged) { | ||||
|                         alt_bld.setMessage(context.getString(R.string.reblog_remove)); | ||||
|                     } else { | ||||
|  | @ -984,7 +984,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
|             }); | ||||
|             holder.binding.actionButtonFavorite.setOnClickListener(v -> { | ||||
|                 if (confirmFav) { | ||||
|                     AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                     AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(context); | ||||
|                     if (status.favourited) { | ||||
|                         alt_bld.setMessage(context.getString(R.string.favourite_remove)); | ||||
|                     } else { | ||||
|  | @ -1759,7 +1759,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
|             popup.setOnMenuItemClickListener(item -> { | ||||
|                 int itemId = item.getItemId(); | ||||
|                 if (itemId == R.id.action_redraft) { | ||||
|                     AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                     AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(context); | ||||
|                     builderInner.setTitle(stringArrayConf[1]); | ||||
|                     builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|                     builderInner.setPositiveButton(R.string.yes, (dialog, which) -> { | ||||
|  | @ -1818,7 +1818,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
|                 } else if (itemId == R.id.action_open_browser) { | ||||
|                     Helper.openBrowser(context, statusToDeal.url); | ||||
|                 } else if (itemId == R.id.action_remove) { | ||||
|                     AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                     AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(context); | ||||
|                     builderInner.setTitle(stringArrayConf[0]); | ||||
|                     builderInner.setMessage(statusToDeal.content); | ||||
|                     if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) | ||||
|  | @ -1835,7 +1835,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
|                             })); | ||||
|                     builderInner.show(); | ||||
|                 } else if (itemId == R.id.action_block_domain) { | ||||
|                     AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                     AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(context); | ||||
|                     builderInner.setTitle(stringArrayConf[3]); | ||||
|                     String domain = statusToDeal.account.acct.split("@")[1]; | ||||
|                     builderInner.setMessage(context.getString(R.string.block_domain_confirm_message, domain)); | ||||
|  | @ -1846,7 +1846,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
|                     }); | ||||
|                     builderInner.show(); | ||||
|                 } else if (itemId == R.id.action_mute) { | ||||
|                     AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                     AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(context); | ||||
|                     builderInner.setTitle(stringArrayConf[0]); | ||||
|                     builderInner.setMessage(statusToDeal.account.acct); | ||||
|                     builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|  | @ -1862,7 +1862,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
|                             })); | ||||
|                     builderInner.show(); | ||||
|                 } else if (itemId == R.id.action_mute_home) { | ||||
|                     AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                     AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(context); | ||||
|                     builderInner.setTitle(R.string.mute_home); | ||||
|                     builderInner.setMessage(statusToDeal.account.acct); | ||||
|                     builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|  | @ -1893,7 +1893,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
|                     MastodonHelper.scheduleBoost(context, MastodonHelper.ScheduleType.TIMED_MUTED, statusToDeal, null, null); | ||||
|                     return true; | ||||
|                 } else if (itemId == R.id.action_block) { | ||||
|                     AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                     AlertDialog.Builder builderInner = new MaterialAlertDialogBuilder(context); | ||||
|                     builderInner.setTitle(stringArrayConf[1]); | ||||
|                     builderInner.setMessage(statusToDeal.account.acct); | ||||
|                     builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|  | @ -1982,7 +1982,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> | |||
|                                 } | ||||
|                                 Handler mainHandler = new Handler(Looper.getMainLooper()); | ||||
|                                 Runnable myRunnable = () -> { | ||||
|                                     AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|                                     AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(context); | ||||
|                                     builderSingle.setTitle(context.getString(R.string.choose_accounts)); | ||||
|                                     final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList); | ||||
|                                     final BaseAccount[] accountArray = new BaseAccount[accounts.size()]; | ||||
|  |  | |||
|  | @ -106,7 +106,7 @@ public class StatusDraftAdapter extends RecyclerView.Adapter<StatusDraftAdapter. | |||
| 
 | ||||
| 
 | ||||
|         holder.binding.delete.setOnClickListener(v -> { | ||||
|             AlertDialog.Builder unfollowConfirm = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder unfollowConfirm = new MaterialAlertDialogBuilder(context); | ||||
|             unfollowConfirm.setMessage(context.getString(R.string.remove_draft)); | ||||
|             unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|             unfollowConfirm.setPositiveButton(R.string.delete, (dialog, which) -> { | ||||
|  |  | |||
|  | @ -132,7 +132,7 @@ public class StatusScheduledAdapter extends RecyclerView.Adapter<StatusScheduled | |||
| 
 | ||||
|         }); | ||||
|         holder.binding.delete.setOnClickListener(v -> { | ||||
|             AlertDialog.Builder unfollowConfirm = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); | ||||
|             AlertDialog.Builder unfollowConfirm = new MaterialAlertDialogBuilder(context); | ||||
|             unfollowConfirm.setMessage(context.getString(R.string.remove_scheduled)); | ||||
|             unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|             unfollowConfirm.setPositiveButton(R.string.delete, (dialog, which) -> { | ||||
|  |  | |||
|  | @ -18,14 +18,11 @@ import android.content.SharedPreferences; | |||
| import android.os.Bundle; | ||||
| 
 | ||||
| import androidx.preference.EditTextPreference; | ||||
| import androidx.preference.MultiSelectListPreference; | ||||
| import androidx.preference.PreferenceFragmentCompat; | ||||
| import androidx.preference.PreferenceManager; | ||||
| import androidx.preference.SwitchPreferenceCompat; | ||||
| 
 | ||||
| import app.fedilab.android.BaseMainActivity; | ||||
| import app.fedilab.android.R; | ||||
| import app.fedilab.android.mastodon.helper.Helper; | ||||
| 
 | ||||
| public class FragmentComposeSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener { | ||||
| 
 | ||||
|  | @ -36,20 +33,13 @@ public class FragmentComposeSettings extends PreferenceFragmentCompat implements | |||
|     } | ||||
| 
 | ||||
|     private void createPref() { | ||||
|         SwitchPreferenceCompat SET_WATERMARK = findPreference(getString(R.string.SET_WATERMARK)); | ||||
|         if (SET_WATERMARK != null) { | ||||
|             SET_WATERMARK.getContext().setTheme(Helper.dialogStyle()); | ||||
|         } | ||||
| 
 | ||||
|         SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); | ||||
|         EditTextPreference SET_WATERMARK_TEXT = findPreference(getString(R.string.SET_WATERMARK_TEXT)); | ||||
|         if (SET_WATERMARK_TEXT != null) { | ||||
|             String val = sharedPreferences.getString(getString(R.string.SET_WATERMARK_TEXT) + BaseMainActivity.currentUserID + BaseMainActivity.currentInstance, sharedPreferences.getString(getString(R.string.SET_WATERMARK_TEXT), null)); | ||||
|             SET_WATERMARK_TEXT.setText(val); | ||||
|         } | ||||
|         MultiSelectListPreference SET_SELECTED_LANGUAGE = findPreference(getString(R.string.SET_SELECTED_LANGUAGE)); | ||||
|         if (SET_SELECTED_LANGUAGE != null) { | ||||
|             SET_SELECTED_LANGUAGE.getContext().setTheme(Helper.dialogStyle()); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|  |  | |||
|  | @ -25,7 +25,6 @@ import androidx.preference.SwitchPreferenceCompat; | |||
| 
 | ||||
| import app.fedilab.android.R; | ||||
| import app.fedilab.android.activities.MainActivity; | ||||
| import app.fedilab.android.mastodon.helper.Helper; | ||||
| 
 | ||||
| public class FragmentExtraFeaturesSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener { | ||||
| 
 | ||||
|  | @ -72,14 +71,12 @@ public class FragmentExtraFeaturesSettings extends PreferenceFragmentCompat impl | |||
| 
 | ||||
|         ListPreference SET_POST_FORMAT = findPreference(getString(R.string.SET_POST_FORMAT)); | ||||
|         if (SET_POST_FORMAT != null) { | ||||
|             SET_POST_FORMAT.getContext().setTheme(Helper.dialogStyle()); | ||||
|             String format = sharedpreferences.getString(getString(R.string.SET_POST_FORMAT) + MainActivity.currentUserID + MainActivity.currentInstance, "text/plain"); | ||||
|             SET_POST_FORMAT.setValue(format); | ||||
|         } | ||||
| 
 | ||||
|         ListPreference SET_COMPOSE_LOCAL_ONLY = findPreference(getString(R.string.SET_COMPOSE_LOCAL_ONLY)); | ||||
|         if (SET_COMPOSE_LOCAL_ONLY != null) { | ||||
|             SET_COMPOSE_LOCAL_ONLY.getContext().setTheme(Helper.dialogStyle()); | ||||
|             int localOnly = sharedpreferences.getInt(getString(R.string.SET_COMPOSE_LOCAL_ONLY) + MainActivity.currentUserID + MainActivity.currentInstance, 0); | ||||
|             SET_COMPOSE_LOCAL_ONLY.setValue(String.valueOf(localOnly)); | ||||
|         } | ||||
|  |  | |||
|  | @ -66,7 +66,6 @@ public class FragmentInterfaceSettings extends PreferenceFragmentCompat implemen | |||
|         } | ||||
|         ListPreference SET_LOGO_LAUNCHER = findPreference(getString(R.string.SET_LOGO_LAUNCHER)); | ||||
|         if (SET_LOGO_LAUNCHER != null) { | ||||
|             SET_LOGO_LAUNCHER.getContext().setTheme(Helper.dialogStyle()); | ||||
|             SET_LOGO_LAUNCHER.setIcon(LogoHelper.getDrawable(SET_LOGO_LAUNCHER.getValue())); | ||||
|         } | ||||
|         SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); | ||||
|  |  | |||
|  | @ -18,7 +18,6 @@ import android.annotation.SuppressLint; | |||
| import android.content.SharedPreferences; | ||||
| import android.os.Bundle; | ||||
| 
 | ||||
| import androidx.preference.ListPreference; | ||||
| import androidx.preference.Preference; | ||||
| import androidx.preference.PreferenceFragmentCompat; | ||||
| import androidx.preference.PreferenceManager; | ||||
|  | @ -36,10 +35,6 @@ public class FragmentLanguageSettings extends PreferenceFragmentCompat implement | |||
| 
 | ||||
|     @SuppressLint("ApplySharedPref") | ||||
|     private void createPref() { | ||||
|         ListPreference SET_DEFAULT_LOCALE_NEW = findPreference(getString(R.string.SET_DEFAULT_LOCALE_NEW)); | ||||
|         if (SET_DEFAULT_LOCALE_NEW != null) { | ||||
|             SET_DEFAULT_LOCALE_NEW.getContext().setTheme(Helper.dialogStyle()); | ||||
|         } | ||||
|         Preference SET_TRANSLATE_VALUES_RESET = findPreference(getString(R.string.SET_TRANSLATE_VALUES_RESET)); | ||||
|         SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); | ||||
|         if (SET_TRANSLATE_VALUES_RESET != null) { | ||||
|  |  | |||
|  | @ -36,7 +36,6 @@ import java.util.ArrayList; | |||
| import java.util.List; | ||||
| 
 | ||||
| import app.fedilab.android.R; | ||||
| import app.fedilab.android.mastodon.helper.Helper; | ||||
| import app.fedilab.android.mastodon.helper.PushHelper; | ||||
| import app.fedilab.android.mastodon.helper.settings.TimePreference; | ||||
| import app.fedilab.android.mastodon.helper.settings.TimePreferenceDialogFragment; | ||||
|  | @ -80,9 +79,6 @@ public class FragmentNotificationsSettings extends PreferenceFragmentCompat impl | |||
| 
 | ||||
| 
 | ||||
|         ListPreference SET_NOTIFICATION_TYPE = findPreference(getString(R.string.SET_NOTIFICATION_TYPE)); | ||||
|         if (SET_NOTIFICATION_TYPE != null) { | ||||
|             SET_NOTIFICATION_TYPE.getContext().setTheme(Helper.dialogStyle()); | ||||
|         } | ||||
|         String[] notificationValues = getResources().getStringArray(R.array.SET_NOTIFICATION_TYPE_VALUE); | ||||
|         if (SET_NOTIFICATION_TYPE != null && SET_NOTIFICATION_TYPE.getValue().equals(notificationValues[2])) { | ||||
|             PreferenceCategory notification_sounds = findPreference("notification_sounds"); | ||||
|  | @ -107,10 +103,6 @@ public class FragmentNotificationsSettings extends PreferenceFragmentCompat impl | |||
|             } | ||||
|             return; | ||||
|         } else if (SET_NOTIFICATION_TYPE != null && SET_NOTIFICATION_TYPE.getValue().equals(notificationValues[1])) { | ||||
|             ListPreference SET_NOTIFICATION_DELAY_VALUE = findPreference(getString(R.string.SET_NOTIFICATION_DELAY_VALUE)); | ||||
|             if (SET_NOTIFICATION_DELAY_VALUE != null) { | ||||
|                 SET_NOTIFICATION_DELAY_VALUE.getContext().setTheme(Helper.dialogStyle()); | ||||
|             } | ||||
|             ListPreference SET_PUSH_DISTRIBUTOR = findPreference("SET_PUSH_DISTRIBUTOR"); | ||||
|             if (SET_PUSH_DISTRIBUTOR != null) { | ||||
|                 preferenceScreen.removePreferenceRecursively("SET_PUSH_DISTRIBUTOR"); | ||||
|  | @ -122,7 +114,6 @@ public class FragmentNotificationsSettings extends PreferenceFragmentCompat impl | |||
|             } | ||||
|             ListPreference SET_PUSH_DISTRIBUTOR = findPreference(getString(R.string.SET_PUSH_DISTRIBUTOR)); | ||||
|             if (SET_PUSH_DISTRIBUTOR != null) { | ||||
|                 SET_PUSH_DISTRIBUTOR.getContext().setTheme(Helper.dialogStyle()); | ||||
|                 List<String> distributors = UnifiedPush.getDistributors(requireActivity(), new ArrayList<>()); | ||||
|                 SET_PUSH_DISTRIBUTOR.setValue(UnifiedPush.getDistributor(requireActivity())); | ||||
|                 SET_PUSH_DISTRIBUTOR.setEntries(distributors.toArray(new String[0])); | ||||
|  |  | |||
|  | @ -18,11 +18,9 @@ package app.fedilab.android.mastodon.ui.fragment.settings; | |||
| import android.content.SharedPreferences; | ||||
| import android.os.Bundle; | ||||
| 
 | ||||
| import androidx.preference.EditTextPreference; | ||||
| import androidx.preference.PreferenceFragmentCompat; | ||||
| 
 | ||||
| import app.fedilab.android.R; | ||||
| import app.fedilab.android.mastodon.helper.Helper; | ||||
| 
 | ||||
| public class FragmentPrivacySettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener { | ||||
| 
 | ||||
|  | @ -33,10 +31,6 @@ public class FragmentPrivacySettings extends PreferenceFragmentCompat implements | |||
|     } | ||||
| 
 | ||||
|     private void createPref() { | ||||
|         EditTextPreference SET_INVIDIOUS_HOST = findPreference(getString(R.string.SET_INVIDIOUS_HOST)); | ||||
|         if (SET_INVIDIOUS_HOST != null) { | ||||
|             SET_INVIDIOUS_HOST.getContext().setTheme(Helper.dialogStyle()); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|  |  | |||
|  | @ -82,18 +82,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements | |||
|         if (getPreferenceScreen() == null) { | ||||
|             Toasty.error(requireActivity(), getString(R.string.toast_error), Toasty.LENGTH_SHORT).show(); | ||||
|         } | ||||
|         ListPreference SET_THEME_BASE = findPreference(getString(R.string.SET_THEME_BASE)); | ||||
|         if (SET_THEME_BASE != null) { | ||||
|             SET_THEME_BASE.getContext().setTheme(Helper.dialogStyle()); | ||||
|         } | ||||
|         ListPreference SET_THEME_DEFAULT_LIGHT = findPreference(getString(R.string.SET_THEME_DEFAULT_LIGHT)); | ||||
|         if (SET_THEME_DEFAULT_LIGHT != null) { | ||||
|             SET_THEME_DEFAULT_LIGHT.getContext().setTheme(Helper.dialogStyle()); | ||||
|         } | ||||
|         ListPreference SET_THEME_DEFAULT_DARK = findPreference(getString(R.string.SET_THEME_DEFAULT_DARK)); | ||||
|         if (SET_THEME_DEFAULT_DARK != null) { | ||||
|             SET_THEME_DEFAULT_DARK.getContext().setTheme(Helper.dialogStyle()); | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
|         Preference SET_CUSTOMIZE_LIGHT_COLORS_ACTION = findPreference(getString(R.string.SET_CUSTOMIZE_LIGHT_COLORS_ACTION)); | ||||
|         if (SET_CUSTOMIZE_LIGHT_COLORS_ACTION != null) { | ||||
|  | @ -118,9 +107,8 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements | |||
| 
 | ||||
|         Preference SET_RESET_CUSTOM_COLOR = findPreference(getString(R.string.SET_RESET_CUSTOM_COLOR)); | ||||
|         if (SET_RESET_CUSTOM_COLOR != null) { | ||||
|             SET_RESET_CUSTOM_COLOR.getContext().setTheme(Helper.dialogStyle()); | ||||
|             SET_RESET_CUSTOM_COLOR.setOnPreferenceClickListener(preference -> { | ||||
|                 AlertDialog.Builder resetConfirm = new MaterialAlertDialogBuilder(requireActivity(), Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder resetConfirm = new MaterialAlertDialogBuilder(requireActivity()); | ||||
|                 resetConfirm.setMessage(getString(R.string.reset_color)); | ||||
|                 resetConfirm.setNegativeButton(R.string.no, (dialog, which) -> dialog.dismiss()); | ||||
|                 resetConfirm.setPositiveButton(R.string.reset, (dialog, which) -> { | ||||
|  |  | |||
|  | @ -26,7 +26,6 @@ import androidx.preference.SwitchPreferenceCompat; | |||
| 
 | ||||
| import app.fedilab.android.R; | ||||
| import app.fedilab.android.activities.MainActivity; | ||||
| import app.fedilab.android.mastodon.helper.Helper; | ||||
| 
 | ||||
| public class FragmentTimelinesSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener { | ||||
| 
 | ||||
|  | @ -42,18 +41,11 @@ public class FragmentTimelinesSettings extends PreferenceFragmentCompat implemen | |||
|         SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); | ||||
|         addPreferencesFromResource(R.xml.pref_timelines); | ||||
|         PreferenceScreen preferenceScreen = getPreferenceScreen(); | ||||
|         ListPreference SET_LOAD_MEDIA_TYPE = findPreference(getString(R.string.SET_LOAD_MEDIA_TYPE)); | ||||
|         if (SET_LOAD_MEDIA_TYPE != null) { | ||||
|             SET_LOAD_MEDIA_TYPE.getContext().setTheme(Helper.dialogStyle()); | ||||
|         } | ||||
| 
 | ||||
|         ListPreference SET_TRANSLATOR = findPreference(getString(R.string.SET_TRANSLATOR)); | ||||
|         if (SET_TRANSLATOR != null) { | ||||
|             SET_TRANSLATOR.getContext().setTheme(Helper.dialogStyle()); | ||||
|         } | ||||
| 
 | ||||
|         ListPreference SET_TRANSLATOR_VERSION = findPreference(getString(R.string.SET_TRANSLATOR_VERSION)); | ||||
|         if (SET_TRANSLATOR_VERSION != null) { | ||||
|             SET_TRANSLATOR_VERSION.getContext().setTheme(Helper.dialogStyle()); | ||||
|         } | ||||
| 
 | ||||
|         EditTextPreference SET_TRANSLATOR_API_KEY = findPreference(getString(R.string.SET_TRANSLATOR_API_KEY)); | ||||
|         if (SET_TRANSLATOR != null && SET_TRANSLATOR.getValue().equals("FEDILAB")) { | ||||
|             if (SET_TRANSLATOR_API_KEY != null) { | ||||
|  |  | |||
|  | @ -44,7 +44,6 @@ import app.fedilab.android.BaseMainActivity; | |||
| import app.fedilab.android.R; | ||||
| import app.fedilab.android.databinding.FragmentNotificationContainerBinding; | ||||
| import app.fedilab.android.databinding.PopupNotificationSettingsBinding; | ||||
| import app.fedilab.android.mastodon.helper.Helper; | ||||
| import app.fedilab.android.mastodon.ui.pageadapter.FedilabNotificationPageAdapter; | ||||
| import app.fedilab.android.mastodon.viewmodel.mastodon.NotificationsVM; | ||||
| import es.dmoral.toasty.Toasty; | ||||
|  | @ -89,13 +88,13 @@ public class FragmentNotificationContainer extends Fragment { | |||
|         } | ||||
|         AtomicBoolean changes = new AtomicBoolean(false); | ||||
|         binding.settings.setOnClickListener(v -> { | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(requireActivity(), Helper.dialogStyle()); | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(requireActivity()); | ||||
|             PopupNotificationSettingsBinding dialogView = PopupNotificationSettingsBinding.inflate(getLayoutInflater()); | ||||
|             dialogBuilder.setView(dialogView.getRoot()); | ||||
| 
 | ||||
| 
 | ||||
|             dialogView.clearAllNotif.setOnClickListener(v1 -> { | ||||
|                 AlertDialog.Builder db = new MaterialAlertDialogBuilder(requireActivity(), Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder db = new MaterialAlertDialogBuilder(requireActivity()); | ||||
|                 db.setTitle(R.string.delete_notification_ask_all); | ||||
|                 db.setMessage(R.string.delete_notification_all_warning); | ||||
|                 db.setPositiveButton(R.string.delete_all, (dialog, id) -> { | ||||
|  |  | |||
|  | @ -161,7 +161,7 @@ public class AllPlaylistsActivity extends BaseBarActivity implements PlaylistAda | |||
|     public void manageAlert(Playlist playlistParam) { | ||||
| 
 | ||||
|         playlistToEdit = playlistParam; | ||||
|         AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(AllPlaylistsActivity.this, app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|         AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(AllPlaylistsActivity.this); | ||||
|         bindingDialog = AddPlaylistPeertubeBinding.inflate(LayoutInflater.from(AllPlaylistsActivity.this), null, false); | ||||
|         dialogBuilder.setView(bindingDialog.getRoot()); | ||||
| 
 | ||||
|  |  | |||
|  | @ -93,7 +93,7 @@ public class ManageInstancesActivity extends BaseBarActivity implements AboutIns | |||
|     @SuppressLint("ApplySharedPref") | ||||
|     private void showRadioButtonDialogFullInstances(Activity activity) { | ||||
|         SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(activity); | ||||
|         AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(activity, app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|         AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(activity); | ||||
|         alt_bld.setTitle(R.string.instance_choice); | ||||
|         String instance = HelperInstance.getLiveInstance(activity); | ||||
|         final EditText input = new EditText(activity); | ||||
|  |  | |||
|  | @ -679,7 +679,7 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis | |||
|     } | ||||
| 
 | ||||
|     private void reportAlert(RetrofitPeertubeAPI.ActionType type, AlertDialog alertDialog) { | ||||
|         AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(PeertubeActivity.this, app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|         AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(PeertubeActivity.this); | ||||
|         LayoutInflater inflater1 = getLayoutInflater(); | ||||
|         View dialogView = inflater1.inflate(R.layout.popup_report_peertube, new LinearLayout(PeertubeActivity.this), false); | ||||
|         dialogBuilder.setView(dialogView); | ||||
|  | @ -879,7 +879,7 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis | |||
|         }); | ||||
| 
 | ||||
|         binding.videoInformation.setOnClickListener(v -> { | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(PeertubeActivity.this, app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(PeertubeActivity.this); | ||||
| 
 | ||||
|             PopupVideoInfoPeertubeBinding videoInfo = PopupVideoInfoPeertubeBinding.inflate(getLayoutInflater()); | ||||
| 
 | ||||
|  | @ -1109,7 +1109,7 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis | |||
|                 } else if (itemId == R.id.action_report) { | ||||
|                     AlertDialog alertDialog; | ||||
|                     AlertDialog.Builder dialogBuilder; | ||||
|                     dialogBuilder = new MaterialAlertDialogBuilder(PeertubeActivity.this, app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|                     dialogBuilder = new MaterialAlertDialogBuilder(PeertubeActivity.this); | ||||
|                     LayoutInflater inflater1 = getLayoutInflater(); | ||||
|                     View dialogView = inflater1.inflate(R.layout.popup_report_choice, new LinearLayout(PeertubeActivity.this), false); | ||||
|                     dialogBuilder.setView(dialogView); | ||||
|  | @ -1241,7 +1241,7 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis | |||
|         if (promptNSFW && peertube != null && peertube.isNsfw() && (nsfwAction.compareTo(Helper.BLUR) == 0 || nsfwAction.compareTo(Helper.DO_NOT_LIST) == 0)) { | ||||
|             AlertDialog alertDialog; | ||||
|             AlertDialog.Builder dialogBuilder; | ||||
|             dialogBuilder = new MaterialAlertDialogBuilder(PeertubeActivity.this, app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|             dialogBuilder = new MaterialAlertDialogBuilder(PeertubeActivity.this); | ||||
|             dialogBuilder.setTitle(R.string.nsfw_title_warning); | ||||
|             dialogBuilder.setCancelable(false); | ||||
|             dialogBuilder.setMessage(R.string.nsfw_message_warning); | ||||
|  | @ -2033,7 +2033,7 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis | |||
|             return; | ||||
|         } | ||||
|         if (apiResponse.getPlaylists() != null && apiResponse.getPlaylists().size() > 0) { | ||||
|             AlertDialog.Builder builder = new MaterialAlertDialogBuilder(PeertubeActivity.this, app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|             AlertDialog.Builder builder = new MaterialAlertDialogBuilder(PeertubeActivity.this); | ||||
|             builder.setTitle(R.string.modify_playlists); | ||||
| 
 | ||||
|             List<PlaylistData.Playlist> ownerPlaylists = apiResponse.getPlaylists(); | ||||
|  |  | |||
|  | @ -109,7 +109,7 @@ public class PeertubeEditUploadActivity extends BaseBarActivity { | |||
| 
 | ||||
|         binding.setUploadDelete.setOnClickListener(v -> { | ||||
|             AlertDialog.Builder builderInner; | ||||
|             builderInner = new MaterialAlertDialogBuilder(PeertubeEditUploadActivity.this, app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|             builderInner = new MaterialAlertDialogBuilder(PeertubeEditUploadActivity.this); | ||||
|             builderInner.setMessage(getString(R.string.delete_video_confirmation)); | ||||
|             builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|             builderInner.setPositiveButton(R.string.yes, (dialog, which) -> { | ||||
|  |  | |||
|  | @ -540,7 +540,7 @@ public class PeertubeMainActivity extends PeertubeBaseMainActivity { | |||
|                     instanceConfig = new RetrofitPeertubeAPI(PeertubeMainActivity.this).getConfigInstance(); | ||||
|                 } catch (Error error) { | ||||
|                     runOnUiThread(() -> { | ||||
|                         AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(this, app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|                         AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(this); | ||||
|                         alt_bld.setTitle(R.string.refresh_token_failed); | ||||
|                         alt_bld.setMessage(R.string.refresh_token_failed_message); | ||||
|                         alt_bld.setNegativeButton(R.string.action_logout, (dialog, id) -> { | ||||
|  | @ -683,7 +683,7 @@ public class PeertubeMainActivity extends PeertubeBaseMainActivity { | |||
|     @SuppressLint("ApplySharedPref") | ||||
|     private void showRadioButtonDialog() { | ||||
| 
 | ||||
|         AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(this, app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|         AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(this); | ||||
|         alt_bld.setTitle(R.string.instance_choice); | ||||
|         final SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(PeertubeMainActivity.this); | ||||
|         String acad = HelperInstance.getLiveInstance(PeertubeMainActivity.this); | ||||
|  |  | |||
|  | @ -113,7 +113,7 @@ public class ShowAccountActivity extends BaseBarActivity { | |||
|             PostActionsVM viewModel = new ViewModelProvider(ShowAccountActivity.this).get(PostActionsVM.class); | ||||
|             viewModel.post(MUTE, accountAcct == null ? account.getUsername() + "@" + account.getHost() : accountAcct, null).observe(ShowAccountActivity.this, apiResponse -> manageVIewPostActions(MUTE, apiResponse)); | ||||
|         } else if (item.getItemId() == R.id.action_report) { | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(ShowAccountActivity.this, app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(ShowAccountActivity.this); | ||||
|             LayoutInflater inflater1 = getLayoutInflater(); | ||||
|             View dialogView = inflater1.inflate(R.layout.popup_report_peertube, new LinearLayout(ShowAccountActivity.this), false); | ||||
|             dialogBuilder.setView(dialogView); | ||||
|  |  | |||
|  | @ -134,7 +134,7 @@ public class ShowChannelActivity extends BaseBarActivity { | |||
|             PostActionsVM viewModel = new ViewModelProvider(ShowChannelActivity.this).get(PostActionsVM.class); | ||||
|             viewModel.post(MUTE, channel.getOwnerAccount().getAcct(), null).observe(ShowChannelActivity.this, apiResponse -> manageVIewPostActions(MUTE, apiResponse)); | ||||
|         } else if (item.getItemId() == R.id.action_report) { | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(ShowChannelActivity.this, app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(ShowChannelActivity.this); | ||||
|             LayoutInflater inflater1 = getLayoutInflater(); | ||||
|             View dialogView = inflater1.inflate(R.layout.popup_report_peertube, new LinearLayout(ShowChannelActivity.this), false); | ||||
|             dialogBuilder.setView(dialogView); | ||||
|  | @ -265,7 +265,7 @@ public class ShowChannelActivity extends BaseBarActivity { | |||
|             } else if (doAction == action.UNFOLLOW) { | ||||
|                 boolean confirm_unfollow = sharedpreferences.getBoolean(Helper.SET_UNFOLLOW_VALIDATION, true); | ||||
|                 if (confirm_unfollow) { | ||||
|                     AlertDialog.Builder unfollowConfirm = new MaterialAlertDialogBuilder(ShowChannelActivity.this, app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|                     AlertDialog.Builder unfollowConfirm = new MaterialAlertDialogBuilder(ShowChannelActivity.this); | ||||
|                     unfollowConfirm.setTitle(getString(R.string.unfollow_confirm)); | ||||
|                     unfollowConfirm.setMessage(channel.getAcct()); | ||||
|                     unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|  |  | |||
|  | @ -145,7 +145,7 @@ public class VideosTimelineActivity extends BaseBarActivity { | |||
|             finish(); | ||||
|             return true; | ||||
|         } else if (item.getItemId() == R.id.action_delete) { | ||||
|             MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(VideosTimelineActivity.this, app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|             MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(VideosTimelineActivity.this); | ||||
|             builder.setTitle(R.string.delete_history); | ||||
|             builder.setMessage(R.string.delete_history_confirm); | ||||
|             builder.setIcon(android.R.drawable.ic_dialog_alert) | ||||
|  |  | |||
|  | @ -17,7 +17,6 @@ package app.fedilab.android.peertube.drawer; | |||
| 
 | ||||
| import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY; | ||||
| import static app.fedilab.android.mastodon.helper.Helper.PREF_USER_INSTANCE; | ||||
| import static app.fedilab.android.mastodon.helper.Helper.dialogStyle; | ||||
| 
 | ||||
| import android.annotation.SuppressLint; | ||||
| import android.app.Activity; | ||||
|  | @ -143,7 +142,7 @@ public class AboutInstanceAdapter extends RecyclerView.Adapter<RecyclerView.View | |||
|             popup.setOnMenuItemClickListener(item -> { | ||||
|                 int itemId = item.getItemId(); | ||||
|                 if (itemId == R.id.action_delete) { | ||||
|                     MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context, dialogStyle()); | ||||
|                     MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context); | ||||
|                     builder.setTitle(R.string.delete_instance); | ||||
|                     builder.setMessage(R.string.delete_instance_confirm); | ||||
|                     builder.setIcon(android.R.drawable.ic_dialog_alert) | ||||
|  |  | |||
|  | @ -16,7 +16,6 @@ package app.fedilab.android.peertube.drawer; | |||
| 
 | ||||
| import static app.fedilab.android.mastodon.helper.Helper.PREF_USER_ID; | ||||
| import static app.fedilab.android.mastodon.helper.Helper.PREF_USER_INSTANCE; | ||||
| import static app.fedilab.android.mastodon.helper.Helper.dialogStyle; | ||||
| 
 | ||||
| import android.content.Context; | ||||
| import android.content.Intent; | ||||
|  | @ -90,7 +89,7 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo | |||
|             popup.setOnMenuItemClickListener(item -> { | ||||
|                 int itemId = item.getItemId(); | ||||
|                 if (itemId == R.id.action_delete) { | ||||
|                     MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context, dialogStyle()); | ||||
|                     MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context); | ||||
|                     builder.setTitle(context.getString(R.string.delete_channel) + ": " + channel.getName()); | ||||
|                     builder.setMessage(context.getString(R.string.action_channel_confirm_delete)); | ||||
|                     builder.setIcon(android.R.drawable.ic_dialog_alert) | ||||
|  |  | |||
|  | @ -14,7 +14,7 @@ package app.fedilab.android.peertube.drawer; | |||
|  * You should have received a copy of the GNU General Public License along with Fedilab; if not, | ||||
|  * see <http://www.gnu.org/licenses>. */ | ||||
| 
 | ||||
| import static app.fedilab.android.mastodon.helper.Helper.dialogStyle; | ||||
| 
 | ||||
| import static app.fedilab.android.peertube.client.RetrofitPeertubeAPI.ActionType.MUTE; | ||||
| import static app.fedilab.android.peertube.client.RetrofitPeertubeAPI.ActionType.REPLY; | ||||
| 
 | ||||
|  | @ -163,7 +163,7 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo | |||
|                 int itemId = item.getItemId(); | ||||
|                 MaterialAlertDialogBuilder builder; | ||||
|                 if (itemId == R.id.action_delete) { | ||||
|                     builder = new MaterialAlertDialogBuilder(context, dialogStyle()); | ||||
|                     builder = new MaterialAlertDialogBuilder(context); | ||||
|                     builder.setTitle(R.string.delete_comment); | ||||
|                     builder.setMessage(R.string.delete_comment_confirm); | ||||
|                     builder.setIcon(android.R.drawable.ic_dialog_alert) | ||||
|  | @ -196,7 +196,7 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo | |||
|                         allCommentRemoved.onAllCommentRemoved(); | ||||
|                     } | ||||
|                 } else if (itemId == R.id.action_remove_comments) { | ||||
|                     builder = new MaterialAlertDialogBuilder(context, dialogStyle()); | ||||
|                     builder = new MaterialAlertDialogBuilder(context); | ||||
|                     builder.setTitle(R.string.delete_account_comment); | ||||
|                     builder.setMessage(R.string.delete_account_comment_confirm); | ||||
|                     builder.setIcon(android.R.drawable.ic_dialog_alert) | ||||
|  |  | |||
|  | @ -14,7 +14,7 @@ package app.fedilab.android.peertube.drawer; | |||
|  * You should have received a copy of the GNU General Public License along with Fedilab; if not, | ||||
|  * see <http://www.gnu.org/licenses>. */ | ||||
| 
 | ||||
| import static app.fedilab.android.mastodon.helper.Helper.dialogStyle; | ||||
| 
 | ||||
| import static app.fedilab.android.peertube.client.RetrofitPeertubeAPI.ActionType.FOLLOW; | ||||
| import static app.fedilab.android.peertube.client.RetrofitPeertubeAPI.ActionType.UNFOLLOW; | ||||
| import static app.fedilab.android.peertube.viewmodel.TimelineVM.TimelineType.MY_VIDEOS; | ||||
|  | @ -229,7 +229,7 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde | |||
|                         popup.getMenu().findItem(R.id.action_follow).setTitle(context.getString(R.string.action_follow)); | ||||
|                         boolean confirm_unfollow = sharedpreferences.getBoolean(Helper.SET_UNFOLLOW_VALIDATION, true); | ||||
|                         if (confirm_unfollow) { | ||||
|                             AlertDialog.Builder unfollowConfirm = new MaterialAlertDialogBuilder(context, dialogStyle()); | ||||
|                             AlertDialog.Builder unfollowConfirm = new MaterialAlertDialogBuilder(context); | ||||
|                             unfollowConfirm.setTitle(context.getString(R.string.unfollow_confirm)); | ||||
|                             unfollowConfirm.setMessage(video.getChannel().getAcct()); | ||||
|                             unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); | ||||
|  | @ -259,7 +259,7 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde | |||
|                     intent.putExtras(b); | ||||
|                     context.startActivity(intent); | ||||
|                 } else if (itemId == R.id.action_report) { | ||||
|                     AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(context, dialogStyle()); | ||||
|                     AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(context); | ||||
|                     LayoutInflater inflater1 = ((Activity) context).getLayoutInflater(); | ||||
|                     View dialogView = inflater1.inflate(R.layout.popup_report_peertube, new LinearLayout(context), false); | ||||
|                     dialogBuilder.setView(dialogView); | ||||
|  | @ -323,7 +323,7 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde | |||
|             return; | ||||
|         } | ||||
|         if (apiResponse.getPlaylists() != null && apiResponse.getPlaylists().size() > 0) { | ||||
|             AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context, dialogStyle()); | ||||
|             AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context); | ||||
|             builder.setTitle(R.string.modify_playlists); | ||||
| 
 | ||||
|             List<PlaylistData.Playlist> ownerPlaylists = apiResponse.getPlaylists(); | ||||
|  |  | |||
|  | @ -15,7 +15,7 @@ package app.fedilab.android.peertube.drawer; | |||
|  * see <http://www.gnu.org/licenses>. */ | ||||
| 
 | ||||
| 
 | ||||
| import static app.fedilab.android.mastodon.helper.Helper.dialogStyle; | ||||
| 
 | ||||
| 
 | ||||
| import android.annotation.SuppressLint; | ||||
| import android.content.Context; | ||||
|  | @ -105,7 +105,7 @@ public class PlaylistAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde | |||
|             popup.setOnMenuItemClickListener(item -> { | ||||
|                 int itemId = item.getItemId(); | ||||
|                 if (itemId == R.id.action_delete) { | ||||
|                     MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context, dialogStyle()); | ||||
|                     MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context); | ||||
|                     builder.setTitle(context.getString(R.string.action_lists_delete) + ": " + playlist.getDisplayName()); | ||||
|                     builder.setMessage(context.getString(R.string.action_lists_confirm_delete)); | ||||
|                     builder.setIcon(android.R.drawable.ic_dialog_alert) | ||||
|  |  | |||
|  | @ -14,7 +14,7 @@ package app.fedilab.android.peertube.fragment; | |||
|  * You should have received a copy of the GNU General Public License along with Fedilab; if not, | ||||
|  * see <http://www.gnu.org/licenses>. */ | ||||
| 
 | ||||
| import static app.fedilab.android.mastodon.helper.Helper.dialogStyle; | ||||
| 
 | ||||
| import static app.fedilab.android.peertube.activities.PeertubeUploadActivity.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE; | ||||
| 
 | ||||
| import android.Manifest; | ||||
|  | @ -230,7 +230,7 @@ public class DisplayChannelsFragment extends Fragment implements ChannelListAdap | |||
|     public void manageAlert(ChannelParams oldChannelValues) { | ||||
| 
 | ||||
| 
 | ||||
|         AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(context, dialogStyle()); | ||||
|         AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(context); | ||||
|         bindingDialog = AddChannelPeertubeBinding.inflate(LayoutInflater.from(context), null, false); | ||||
|         dialogBuilder.setView(bindingDialog.getRoot()); | ||||
| 
 | ||||
|  |  | |||
|  | @ -14,7 +14,7 @@ package app.fedilab.android.peertube.fragment; | |||
|  * You should have received a copy of the GNU General Public License along with Fedilab; if not, | ||||
|  * see <http://www.gnu.org/licenses>. */ | ||||
| 
 | ||||
| import static app.fedilab.android.mastodon.helper.Helper.dialogStyle; | ||||
| 
 | ||||
| import static app.fedilab.android.peertube.client.RetrofitPeertubeAPI.DataType.MY_CHANNELS; | ||||
| import static app.fedilab.android.peertube.helper.Helper.peertubeInformation; | ||||
| 
 | ||||
|  | @ -103,7 +103,7 @@ public class DisplayPlaylistsFragment extends Fragment { | |||
|         } | ||||
| 
 | ||||
|         binding.addNew.setOnClickListener(view -> { | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(requireActivity(), dialogStyle()); | ||||
|             AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(requireActivity()); | ||||
|             bindingAlert = AddPlaylistPeertubeBinding.inflate(getLayoutInflater()); | ||||
|             dialogBuilder.setView(bindingAlert.getRoot()); | ||||
| 
 | ||||
|  |  | |||
|  | @ -108,7 +108,7 @@ public class FragmentLoginPickInstancePeertube extends Fragment implements Insta | |||
|             itemsKeyLanguage = new String[languages.size()]; | ||||
| 
 | ||||
|             binding.pickupLanguages.setOnClickListener(v -> { | ||||
|                 AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(requireContext(), app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(requireContext()); | ||||
| 
 | ||||
|                 int i = 0; | ||||
|                 if (languages.size() > 0) { | ||||
|  | @ -175,7 +175,7 @@ public class FragmentLoginPickInstancePeertube extends Fragment implements Insta | |||
| 
 | ||||
| 
 | ||||
|             binding.pickupCategories.setOnClickListener(v -> { | ||||
|                 AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(requireContext(), app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|                 AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(requireContext()); | ||||
|                 int i = 0; | ||||
|                 if (categories.size() > 0) { | ||||
|                     Iterator<Map.Entry<Integer, String>> it = categories.entrySet().iterator(); | ||||
|  |  | |||
|  | @ -172,7 +172,7 @@ public class PeertubeRegisterFragment extends Fragment { | |||
|                             return; | ||||
|                         } | ||||
| 
 | ||||
|                         AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(requireContext(), app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|                         AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(requireContext()); | ||||
|                         dialogBuilder.setCancelable(false); | ||||
|                         dialogBuilder.setPositiveButton(R.string.validate, (dialog, which) -> { | ||||
|                             dialog.dismiss(); | ||||
|  |  | |||
|  | @ -329,18 +329,6 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Shared | |||
| 
 | ||||
|         //****** App theme ******* | ||||
|         final SharedPreferences sharedpref = PreferenceManager.getDefaultSharedPreferences(requireActivity()); | ||||
|         ListPreference SET_THEME_BASE = findPreference(getString(R.string.SET_THEME_BASE)); | ||||
|         if (SET_THEME_BASE != null) { | ||||
|             SET_THEME_BASE.getContext().setTheme(app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|         } | ||||
|         ListPreference SET_THEME_DEFAULT_LIGHT = findPreference(getString(R.string.SET_THEME_DEFAULT_LIGHT)); | ||||
|         if (SET_THEME_DEFAULT_LIGHT != null) { | ||||
|             SET_THEME_DEFAULT_LIGHT.getContext().setTheme(app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|         } | ||||
|         ListPreference SET_THEME_DEFAULT_DARK = findPreference(getString(R.string.SET_THEME_DEFAULT_DARK)); | ||||
|         if (SET_THEME_DEFAULT_DARK != null) { | ||||
|             SET_THEME_DEFAULT_DARK.getContext().setTheme(app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
|         //****** Video mode ******* | ||||
|  |  | |||
|  | @ -19,7 +19,6 @@ import static app.fedilab.android.mastodon.helper.Helper.PREF_USER_ID; | |||
| import static app.fedilab.android.mastodon.helper.Helper.PREF_USER_INSTANCE; | ||||
| import static app.fedilab.android.mastodon.helper.Helper.PREF_USER_SOFTWARE; | ||||
| import static app.fedilab.android.mastodon.helper.Helper.PREF_USER_TOKEN; | ||||
| import static app.fedilab.android.mastodon.helper.Helper.dialogStyle; | ||||
| import static app.fedilab.android.peertube.activities.PeertubeMainActivity.typeOfConnection; | ||||
| 
 | ||||
| import android.Manifest; | ||||
|  | @ -555,7 +554,7 @@ public class Helper { | |||
|      * @param url     String download url | ||||
|      */ | ||||
|     public static void manageDownloads(final Context context, final String url) { | ||||
|         final AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context, dialogStyle()); | ||||
|         final AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context); | ||||
|         final DownloadManager.Request request; | ||||
|         try { | ||||
|             request = new DownloadManager.Request(Uri.parse(url.trim())); | ||||
|  | @ -590,7 +589,7 @@ public class Helper { | |||
|      * @param currentAccount BaseAccount | ||||
|      */ | ||||
|     public static void logoutCurrentUser(Activity activity, BaseAccount currentAccount) { | ||||
|         AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(activity, dialogStyle()); | ||||
|         AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(activity); | ||||
|         alt_bld.setTitle(R.string.action_logout); | ||||
|         if (currentAccount.mastodon_account != null && currentAccount.mastodon_account.username != null && currentAccount.instance != null) { | ||||
|             alt_bld.setMessage(activity.getString(R.string.logout_account_confirmation, currentAccount.mastodon_account.username, currentAccount.instance)); | ||||
|  |  | |||
|  | @ -49,7 +49,7 @@ public class SwitchAccountHelper { | |||
|             e.printStackTrace(); | ||||
|         } | ||||
| 
 | ||||
|         AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(activity, app.fedilab.android.mastodon.helper.Helper.dialogStyle()); | ||||
|         AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(activity); | ||||
|         builderSingle.setTitle(activity.getString(R.string.list_of_accounts)); | ||||
|         if (accounts != null) { | ||||
|             final OwnAccountsAdapter accountsListAdapter = new OwnAccountsAdapter(activity, accounts); | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue