Fix dynamic colors

This commit is contained in:
Thomas 2023-01-30 18:15:12 +01:00
parent 408e51c0a6
commit ca5b37edfe
66 changed files with 141 additions and 418 deletions

View file

@ -100,7 +100,7 @@ public class BasePeertubeActivity extends BaseBarActivity {
if (item.getItemId() == R.id.action_cast) { if (item.getItemId() == R.id.action_cast) {
if (PeertubeBaseMainActivity.chromeCasts != null && PeertubeBaseMainActivity.chromeCasts.size() > 0) { if (PeertubeBaseMainActivity.chromeCasts != null && PeertubeBaseMainActivity.chromeCasts.size() > 0) {
String[] chromecast_choice = new String[PeertubeBaseMainActivity.chromeCasts.size()]; 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); alt_bld.setTitle(R.string.chromecast_choice);
int i = 0; int i = 0;
for (ChromeCast cc : PeertubeBaseMainActivity.chromeCasts) { for (ChromeCast cc : PeertubeBaseMainActivity.chromeCasts) {

View file

@ -605,7 +605,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
popup.setOnMenuItemClickListener(item -> { popup.setOnMenuItemClickListener(item -> {
int itemId = item.getItemId(); int itemId = item.getItemId();
if (itemId == R.id.action_logout_account) { 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); alt_bld.setTitle(R.string.action_logout);
if (currentAccount.mastodon_account != null && currentAccount.instance != null) { if (currentAccount.mastodon_account != null && currentAccount.instance != null) {
alt_bld.setMessage(activity.getString(R.string.logout_account_confirmation, currentAccount.mastodon_account.username, currentAccount.instance)); 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); itemShowDMs.setChecked(show_dms);
editor.apply(); editor.apply();
} else if (itemId == R.id.action_filter) { } 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(); LayoutInflater inflater = getLayoutInflater();
View dialogView = inflater.inflate(R.layout.popup_filter_regex, new LinearLayout(BaseMainActivity.this), false); View dialogView = inflater.inflate(R.layout.popup_filter_regex, new LinearLayout(BaseMainActivity.this), false);
dialogBuilder.setView(dialogView); dialogBuilder.setView(dialogView);
@ -1888,7 +1888,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.action_logout) { 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.setTitle(R.string.action_logout);
alt_bld.setMessage(getString(R.string.logout_account_confirmation, account.mastodon_account.username, account.instance)); alt_bld.setMessage(getString(R.string.logout_account_confirmation, account.mastodon_account.username, account.instance));
alt_bld.setPositiveButton(R.string.action_logout, (dialog, id) -> { alt_bld.setPositiveButton(R.string.action_logout, (dialog, id) -> {

View file

@ -27,8 +27,6 @@ import androidx.multidex.MultiDex;
import androidx.multidex.MultiDexApplication; import androidx.multidex.MultiDexApplication;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
import com.google.android.material.color.DynamicColors;
import net.gotev.uploadservice.UploadServiceConfig; import net.gotev.uploadservice.UploadServiceConfig;
import net.gotev.uploadservice.observer.request.GlobalRequestObserver; import net.gotev.uploadservice.observer.request.GlobalRequestObserver;
@ -54,15 +52,10 @@ public class MainApplication extends MultiDexApplication {
@Override @Override
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(MainApplication.this);
try { try {
webView = new WebView(this); webView = new WebView(this);
} catch (Exception ignored) { } 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.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
StrictMode.setVmPolicy(builder.build()); StrictMode.setVmPolicy(builder.build());
Toasty.Config.getInstance().apply(); Toasty.Config.getInstance().apply();

View file

@ -30,6 +30,7 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.app.AppCompatDelegate;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
import com.google.android.material.color.DynamicColors;
import com.vanniktech.emoji.EmojiManager; import com.vanniktech.emoji.EmojiManager;
import com.vanniktech.emoji.one.EmojiOneProvider; import com.vanniktech.emoji.one.EmojiOneProvider;
@ -53,6 +54,7 @@ public class BaseActivity extends AppCompatActivity {
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
boolean patch_provider = true; boolean patch_provider = true;
final SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this); final SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(this);
try { try {
@ -142,6 +144,10 @@ public class BaseActivity extends AppCompatActivity {
} }
} }
super.onCreate(savedInstanceState); 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) { if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N) {
ThemeHelper.adjustFontScale(this, getResources().getConfiguration()); ThemeHelper.adjustFontScale(this, getResources().getConfiguration());
} }

View file

@ -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);
}
}

View file

@ -30,6 +30,7 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.app.AppCompatDelegate;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
import com.google.android.material.color.DynamicColors;
import com.vanniktech.emoji.EmojiManager; import com.vanniktech.emoji.EmojiManager;
import com.vanniktech.emoji.one.EmojiOneProvider; import com.vanniktech.emoji.one.EmojiOneProvider;
@ -128,6 +129,10 @@ public class BaseBarActivity extends AppCompatActivity {
} }
} }
super.onCreate(savedInstanceState); 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) { if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
Window window = getWindow(); Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);

View file

@ -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);
}
}

View file

@ -30,6 +30,7 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatDelegate; import androidx.appcompat.app.AppCompatDelegate;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
import com.google.android.material.color.DynamicColors;
import com.vanniktech.emoji.EmojiManager; import com.vanniktech.emoji.EmojiManager;
import com.vanniktech.emoji.one.EmojiOneProvider; import com.vanniktech.emoji.one.EmojiOneProvider;
@ -128,6 +129,10 @@ public class BaseTransparentActivity extends AppCompatActivity {
} }
} }
super.onCreate(savedInstanceState); 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) { if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
Window window = getWindow(); Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);

View file

@ -121,7 +121,7 @@ public class CacheActivity extends BaseBarActivity {
finish(); finish();
return true; return true;
} else if (item.getItemId() == R.id.action_clear) { } 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.setTitle(getString(R.string.delete_cache));
deleteConfirm.setMessage(getString(R.string.delete_cache_message)); deleteConfirm.setMessage(getString(R.string.delete_cache_message));
deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
@ -131,7 +131,7 @@ public class CacheActivity extends BaseBarActivity {
size = size / 1000000.0f; size = size / 1000000.0f;
} }
binding.fileCacheSize.setText(String.format("%s %s", String.format(Locale.getDefault(), "%.2f", size), getString(R.string.cache_units))); 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.setMessage(getString(R.string.restart_the_app));
restartBuilder.setNegativeButton(R.string.no, (dialogRestart, whichRestart) -> { restartBuilder.setNegativeButton(R.string.no, (dialogRestart, whichRestart) -> {
recreate(); recreate();

View file

@ -215,7 +215,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
} }
if (canBeSent(statusDraft)) { if (canBeSent(statusDraft)) {
if (promptSaveDraft) { 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.setMessage(R.string.save_draft);
alt_bld.setPositiveButton(R.string.save, (dialog, id) -> { alt_bld.setPositiveButton(R.string.save, (dialog, id) -> {
dialog.dismiss(); dialog.dismiss();
@ -316,7 +316,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana
} else if (item.getItemId() == R.id.action_photo_camera) { } else if (item.getItemId() == R.id.action_photo_camera) {
photoFileUri = MediaHelper.dispatchTakePictureIntent(ComposeActivity.this); photoFileUri = MediaHelper.dispatchTakePictureIntent(ComposeActivity.this);
} else if (item.getItemId() == R.id.action_contacts) { } 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)); builderSingle.setTitle(getString(R.string.select_accounts));
PopupContactBinding popupContactBinding = PopupContactBinding.inflate(getLayoutInflater(), new LinearLayout(ComposeActivity.this), false); PopupContactBinding popupContactBinding = PopupContactBinding.inflate(getLayoutInflater(), new LinearLayout(ComposeActivity.this), false);

View file

@ -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.api.Status;
import app.fedilab.android.mastodon.client.entities.app.StatusDraft; import app.fedilab.android.mastodon.client.entities.app.StatusDraft;
import app.fedilab.android.mastodon.exception.DBException; 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.ui.drawer.StatusDraftAdapter;
import app.fedilab.android.mastodon.viewmodel.mastodon.TimelinesVM; import app.fedilab.android.mastodon.viewmodel.mastodon.TimelinesVM;
@ -100,7 +99,7 @@ public class DraftActivity extends BaseActivity implements StatusDraftAdapter.Dr
finish(); finish();
return true; return true;
} else if (item.getItemId() == R.id.action_delete) { } 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.setTitle(getString(R.string.delete_all));
unfollowConfirm.setMessage(getString(R.string.remove_draft)); unfollowConfirm.setMessage(getString(R.string.remove_draft));
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());

View file

@ -136,7 +136,7 @@ public class EditProfileActivity extends BaseBarActivity {
value = Html.fromHtml(field.value).toString(); value = Html.fromHtml(field.value).toString();
fieldItemBinding.value.setText(value); fieldItemBinding.value.setText(value);
fieldItemBinding.remove.setOnClickListener(v -> { 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.setTitle(getString(R.string.delete_field));
deleteConfirm.setMessage(getString(R.string.delete_field_confirm)); deleteConfirm.setMessage(getString(R.string.delete_field_confirm));
deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
@ -158,7 +158,7 @@ public class EditProfileActivity extends BaseBarActivity {
binding.addField.setOnClickListener(view -> { binding.addField.setOnClickListener(view -> {
AccountFieldItemBinding fieldItemBinding = AccountFieldItemBinding.inflate(getLayoutInflater()); AccountFieldItemBinding fieldItemBinding = AccountFieldItemBinding.inflate(getLayoutInflater());
fieldItemBinding.remove.setOnClickListener(v -> { 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.setTitle(getString(R.string.delete_field));
deleteConfirm.setMessage(getString(R.string.delete_field_confirm)); deleteConfirm.setMessage(getString(R.string.delete_field_confirm));
deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());

View file

@ -44,7 +44,6 @@ import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.databinding.ActivityFiltersBinding; import app.fedilab.android.databinding.ActivityFiltersBinding;
import app.fedilab.android.databinding.PopupAddFilterBinding; import app.fedilab.android.databinding.PopupAddFilterBinding;
import app.fedilab.android.mastodon.client.entities.api.Filter; 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.FilterAdapter;
import app.fedilab.android.mastodon.ui.drawer.KeywordAdapter; import app.fedilab.android.mastodon.ui.drawer.KeywordAdapter;
import app.fedilab.android.mastodon.viewmodel.mastodon.FiltersVM; 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} * @param listener - {@link FilterAdapter.FilterAction}
*/ */
public static void addEditFilter(Context context, Filter filter, FilterAdapter.FilterAction listener) { 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)); PopupAddFilterBinding popupAddFilterBinding = PopupAddFilterBinding.inflate(LayoutInflater.from(context));
FiltersVM filtersVM = new ViewModelProvider((ViewModelStoreOwner) context).get(FiltersVM.class); FiltersVM filtersVM = new ViewModelProvider((ViewModelStoreOwner) context).get(FiltersVM.class);
dialogBuilder.setView(popupAddFilterBinding.getRoot()); dialogBuilder.setView(popupAddFilterBinding.getRoot());

View file

@ -90,7 +90,7 @@ public class FollowedTagActivity extends BaseBarActivity implements FollowedTagA
onBackPressed(); onBackPressed();
return true; return true;
} else if (item.getItemId() == R.id.action_unfollow && tag != null) { } 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.setTitle(R.string.action_unfollow_tag);
alt_bld.setMessage(R.string.action_unfollow_tag_confirm); alt_bld.setMessage(R.string.action_unfollow_tag_confirm);
alt_bld.setPositiveButton(R.string.unfollow, (dialog, id) -> { alt_bld.setPositiveButton(R.string.unfollow, (dialog, id) -> {
@ -122,7 +122,7 @@ public class FollowedTagActivity extends BaseBarActivity implements FollowedTagA
AlertDialog alert = alt_bld.create(); AlertDialog alert = alt_bld.create();
alert.show(); alert.show();
} else if (item.getItemId() == R.id.action_follow_tag) { } 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()); PopupAddFollowedTagtBinding popupAddFollowedTagtBinding = PopupAddFollowedTagtBinding.inflate(getLayoutInflater());
dialogBuilder.setView(popupAddFollowedTagtBinding.getRoot()); dialogBuilder.setView(popupAddFollowedTagtBinding.getRoot());
popupAddFollowedTagtBinding.addTag.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)}); popupAddFollowedTagtBinding.addTag.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)});

View file

@ -173,7 +173,7 @@ public class HashTagActivity extends BaseActivity {
} else if (item.getItemId() == R.id.action_add_timeline) { } else if (item.getItemId() == R.id.action_add_timeline) {
if (pinnedTag) { 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.setMessage(getString(R.string.unpin_timeline_description));
unpinConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); unpinConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
unpinConfirm.setPositiveButton(R.string.yes, (dialog, which) -> { unpinConfirm.setPositiveButton(R.string.yes, (dialog, which) -> {

View file

@ -147,7 +147,7 @@ public class MastodonListActivity extends BaseBarActivity implements MastodonLis
onBackPressed(); onBackPressed();
return true; return true;
} else if (item.getItemId() == R.id.action_user_mute_home) { } 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.setTitle(R.string.put_all_accounts_in_home_muted);
dialogBuilder.setPositiveButton(R.string.mute_them_all, (dialog, id) -> { dialogBuilder.setPositiveButton(R.string.mute_them_all, (dialog, id) -> {
timelinesVM.getAccountsInList(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, mastodonList.id, null, null, 0) 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.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
dialogBuilder.show(); dialogBuilder.show();
} else if (item.getItemId() == R.id.action_manage_users) { } 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()); PopupManageAccountsListBinding popupManageAccountsListBinding = PopupManageAccountsListBinding.inflate(getLayoutInflater());
dialogBuilder.setView(popupManageAccountsListBinding.getRoot()); dialogBuilder.setView(popupManageAccountsListBinding.getRoot());
popupManageAccountsListBinding.loader.setVisibility(View.VISIBLE); 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.setPositiveButton(R.string.close, (dialog, id) -> dialog.dismiss());
dialogBuilder.create().show(); dialogBuilder.create().show();
} else if (item.getItemId() == R.id.action_delete && mastodonList != null) { } 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.setTitle(R.string.action_lists_delete);
alt_bld.setMessage(R.string.action_lists_confirm_delete); alt_bld.setMessage(R.string.action_lists_confirm_delete);
alt_bld.setPositiveButton(R.string.delete, (dialog, id) -> { alt_bld.setPositiveButton(R.string.delete, (dialog, id) -> {
@ -296,7 +296,7 @@ public class MastodonListActivity extends BaseBarActivity implements MastodonLis
AlertDialog alert = alt_bld.create(); AlertDialog alert = alt_bld.create();
alert.show(); alert.show();
} else if (item.getItemId() == R.id.action_add_list) { } 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()); PopupAddListBinding popupAddListBinding = PopupAddListBinding.inflate(getLayoutInflater());
dialogBuilder.setView(popupAddListBinding.getRoot()); dialogBuilder.setView(popupAddListBinding.getRoot());
popupAddListBinding.addList.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)}); 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.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss());
dialogBuilder.create().show(); dialogBuilder.create().show();
} else if (item.getItemId() == R.id.action_edit) { } 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()); PopupAddListBinding popupAddListBinding = PopupAddListBinding.inflate(getLayoutInflater());
dialogBuilder.setView(popupAddListBinding.getRoot()); dialogBuilder.setView(popupAddListBinding.getRoot());
popupAddListBinding.addList.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)}); popupAddListBinding.addList.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)});

View file

@ -477,7 +477,7 @@ public class ProfileActivity extends BaseActivity {
} else if (doAction == action.UNFOLLOW) { } else if (doAction == action.UNFOLLOW) {
boolean confirm_unfollow = sharedpreferences.getBoolean(getString(R.string.SET_UNFOLLOW_VALIDATION), true); boolean confirm_unfollow = sharedpreferences.getBoolean(getString(R.string.SET_UNFOLLOW_VALIDATION), true);
if (confirm_unfollow) { 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.setTitle(getString(R.string.unfollow_confirm));
unfollowConfirm.setMessage(account.acct); unfollowConfirm.setMessage(account.acct);
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); 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 //Recyclerview for identity proof has not been inflated yet
if (identityProofsRecycler == null) { if (identityProofsRecycler == null) {
identity_proofs_indicator.setOnClickListener(v -> { 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); identityProofsRecycler = new RecyclerView(ProfileActivity.this);
LinearLayoutManager mLayoutManager = new LinearLayoutManager(ProfileActivity.this); LinearLayoutManager mLayoutManager = new LinearLayoutManager(ProfileActivity.this);
identityProofsRecycler.setLayoutManager(mLayoutManager); identityProofsRecycler.setLayoutManager(mLayoutManager);
@ -675,7 +675,7 @@ public class ProfileActivity extends BaseActivity {
binding.personalNote.setText(relationship.note); binding.personalNote.setText(relationship.note);
} }
binding.personalNote.setOnClickListener(view -> { 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); builderInner.setTitle(R.string.note_for_account);
EditText input = new EditText(ProfileActivity.this); EditText input = new EditText(ProfileActivity.this);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams( LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
@ -860,7 +860,7 @@ public class ProfileActivity extends BaseActivity {
}); });
return true; return true;
} else if (itemId == R.id.action_filter) { } 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); Set<String> featuredTagsSet = sharedpreferences.getStringSet(getString(R.string.SET_FEATURED_TAGS), null);
List<String> tags = new ArrayList<>(); List<String> tags = new ArrayList<>();
if (featuredTagsSet != null) { if (featuredTagsSet != null) {
@ -941,7 +941,7 @@ public class ProfileActivity extends BaseActivity {
i++; 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.setTitle(getString(R.string.filter_languages));
builder.setMultiChoiceItems(languagesArr, presentArr, (dialog, which, isChecked) -> { builder.setMultiChoiceItems(languagesArr, presentArr, (dialog, which, isChecked) -> {
List<String> languagesFilter = new ArrayList<>(); List<String> languagesFilter = new ArrayList<>();
@ -986,7 +986,7 @@ public class ProfileActivity extends BaseActivity {
} }
accountsVM.getListContainingAccount(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id) accountsVM.getListContainingAccount(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id)
.observe(ProfileActivity.this, mastodonListUserIs -> { .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.setTitle(getString(R.string.action_lists_add_to));
builderSingle.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss()); builderSingle.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss());
String[] listsId = new String[mastodonLists.size()]; String[] listsId = new String[mastodonLists.size()];
@ -1078,7 +1078,7 @@ public class ProfileActivity extends BaseActivity {
}); });
return true; return true;
} }
builderInner = new MaterialAlertDialogBuilder(ProfileActivity.this, Helper.dialogStyle()); builderInner = new MaterialAlertDialogBuilder(ProfileActivity.this);
builderInner.setTitle(stringArrayConf[0]); builderInner.setTitle(stringArrayConf[0]);
builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
@ -1098,7 +1098,7 @@ public class ProfileActivity extends BaseActivity {
builderInner.show(); builderInner.show();
} }
} else if (itemId == R.id.action_mute_home) { } 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.setMessage(account.acct);
builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
if (homeMuted) { if (homeMuted) {
@ -1126,7 +1126,7 @@ public class ProfileActivity extends BaseActivity {
}); });
return true; return true;
} else if (itemId == R.id.action_report) { } 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); builderInner.setTitle(R.string.report_account);
//Text for report //Text for report
EditText input = new EditText(ProfileActivity.this); EditText input = new EditText(ProfileActivity.this);
@ -1146,7 +1146,7 @@ public class ProfileActivity extends BaseActivity {
builderInner.show(); builderInner.show();
return true; return true;
} else if (itemId == R.id.action_block) { } 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 != null) {
if (relationship.blocking) { if (relationship.blocking) {
builderInner.setTitle(stringArrayConf[5]); builderInner.setTitle(stringArrayConf[5]);
@ -1186,7 +1186,7 @@ public class ProfileActivity extends BaseActivity {
}); });
builderInner.show(); builderInner.show();
} else if (itemId == R.id.action_block_instance) { } 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]; String domain = account.acct.split("@")[1];
builderInner.setMessage(getString(R.string.block_domain_confirm_message, domain)); builderInner.setMessage(getString(R.string.block_domain_confirm_message, domain));
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());

View file

@ -170,7 +170,7 @@ public class ReorderTimelinesActivity extends BaseBarActivity implements OnStart
} }
private void addInstance() { private void addInstance() {
AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(ReorderTimelinesActivity.this, Helper.dialogStyle()); AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(ReorderTimelinesActivity.this);
PopupSearchInstanceBinding popupSearchInstanceBinding = PopupSearchInstanceBinding.inflate(getLayoutInflater()); PopupSearchInstanceBinding popupSearchInstanceBinding = PopupSearchInstanceBinding.inflate(getLayoutInflater());
dialogBuilder.setView(popupSearchInstanceBinding.getRoot()); dialogBuilder.setView(popupSearchInstanceBinding.getRoot());
TextWatcher textWatcher = autoComplete(popupSearchInstanceBinding); TextWatcher textWatcher = autoComplete(popupSearchInstanceBinding);

View file

@ -165,7 +165,7 @@ public class AdminActionActivity extends BaseBarActivity {
return true; return true;
} else if (item.getItemId() == R.id.action_filter) { } else if (item.getItemId() == R.id.action_filter) {
if (getTitle().toString().equalsIgnoreCase(getString(R.string.accounts))) { 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()); PopupAdminFilterAccountsBinding binding = PopupAdminFilterAccountsBinding.inflate(getLayoutInflater());
alertDialogBuilder.setView(binding.getRoot()); alertDialogBuilder.setView(binding.getRoot());
if (local != null && remote == null) { if (local != null && remote == null) {
@ -259,7 +259,7 @@ public class AdminActionActivity extends BaseBarActivity {
AlertDialog alert = alertDialogBuilder.create(); AlertDialog alert = alertDialogBuilder.create();
alert.show(); alert.show();
} else { } else {
AlertDialog.Builder alertDialogBuilder = new MaterialAlertDialogBuilder(AdminActionActivity.this, Helper.dialogStyle()); AlertDialog.Builder alertDialogBuilder = new MaterialAlertDialogBuilder(AdminActionActivity.this);
PopupAdminFilterReportsBinding binding = PopupAdminFilterReportsBinding.inflate(getLayoutInflater()); PopupAdminFilterReportsBinding binding = PopupAdminFilterReportsBinding.inflate(getLayoutInflater());
alertDialogBuilder.setView(binding.getRoot()); alertDialogBuilder.setView(binding.getRoot());
if (resolved == null) { if (resolved == null) {

View file

@ -129,7 +129,7 @@ public class AdminDomainBlockActivity extends BaseBarActivity {
return true; return true;
} else if (itemId == R.id.action_delete) { } else if (itemId == R.id.action_delete) {
if (adminDomainBlock.id != null) { 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.setMessage(getString(R.string.unblock_domain_confirm, adminDomainBlock.domain));
builder builder
.setPositiveButton(R.string.unblock_domain, (dialog, which) -> { .setPositiveButton(R.string.unblock_domain, (dialog, which) -> {

View file

@ -84,7 +84,7 @@ public class CrossActionHelper {
} }
Handler mainHandler = new Handler(Looper.getMainLooper()); Handler mainHandler = new Handler(Looper.getMainLooper());
Runnable myRunnable = () -> { Runnable myRunnable = () -> {
AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(context);
builderSingle.setTitle(context.getString(R.string.choose_accounts)); builderSingle.setTitle(context.getString(R.string.choose_accounts));
final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList); final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList);
final BaseAccount[] accountArray = new BaseAccount[accounts.size()]; 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); boolean confirmBoost = sharedpreferences.getBoolean(context.getString(R.string.SET_NOTIF_VALIDATION), true);
BaseAccount selectedAccount = accountArray[which]; BaseAccount selectedAccount = accountArray[which];
if ((actionType == TypeOfCrossAction.REBLOG_ACTION && confirmBoost) || (actionType == TypeOfCrossAction.FAVOURITE_ACTION && confirmFav)) { 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) { if (actionType == TypeOfCrossAction.REBLOG_ACTION) {
alt_bld.setMessage(context.getString(R.string.reblog_add)); alt_bld.setMessage(context.getString(R.string.reblog_add));
} else { } else {
@ -420,7 +420,7 @@ public class CrossActionHelper {
context.startActivity(intentToot); context.startActivity(intentToot);
((BaseActivity) context).finish(); ((BaseActivity) context).finish();
} else { } else {
AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(context);
builderSingle.setTitle(context.getString(R.string.choose_accounts)); builderSingle.setTitle(context.getString(R.string.choose_accounts));
final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList); final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList);
final BaseAccount[] accountArray = new BaseAccount[accounts.size()]; final BaseAccount[] accountArray = new BaseAccount[accounts.size()];

View file

@ -416,7 +416,7 @@ public class Helper {
* @param url String download url * @param url String download url
*/ */
public static void manageDownloads(final Context context, final String 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; final DownloadManager.Request request;
try { try {
request = new DownloadManager.Request(Uri.parse(url.trim())); request = new DownloadManager.Request(Uri.parse(url.trim()));
@ -1811,7 +1811,7 @@ public class Helper {
is.close(); is.close();
String json = new String(buffer, StandardCharsets.UTF_8); String json = new String(buffer, StandardCharsets.UTF_8);
Gson gson = new Gson(); Gson gson = new Gson();
AlertDialog.Builder dialogBuilderOptin = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); AlertDialog.Builder dialogBuilderOptin = new MaterialAlertDialogBuilder(activity);
PopupReleaseNotesBinding binding = PopupReleaseNotesBinding.inflate(activity.getLayoutInflater()); PopupReleaseNotesBinding binding = PopupReleaseNotesBinding.inflate(activity.getLayoutInflater());
dialogBuilderOptin.setView(binding.getRoot()); dialogBuilderOptin.setView(binding.getRoot());
try { try {

View file

@ -412,7 +412,7 @@ public class MastodonHelper {
* @param status {@link Status} * @param status {@link Status}
*/ */
public static void scheduleBoost(Context context, ScheduleType scheduleType, Status status, Account account, TimedMuted listener) { 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()); DatetimePickerBinding binding = DatetimePickerBinding.inflate(((Activity) context).getLayoutInflater());
dialogBuilder.setView(binding.getRoot()); dialogBuilder.setView(binding.getRoot());
final AlertDialog alertDialogBoost = dialogBuilder.create(); final AlertDialog alertDialogBoost = dialogBuilder.create();

View file

@ -278,7 +278,7 @@ public class MediaHelper {
AudioRecorder mAudioRecorder = AudioRecorder.getInstance(); AudioRecorder mAudioRecorder = AudioRecorder.getInstance();
File mAudioFile = new File(filePath); File mAudioFile = new File(filePath);
PopupRecordBinding binding = PopupRecordBinding.inflate(activity.getLayoutInflater()); PopupRecordBinding binding = PopupRecordBinding.inflate(activity.getLayoutInflater());
AlertDialog.Builder audioPopup = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); AlertDialog.Builder audioPopup = new MaterialAlertDialogBuilder(activity);
audioPopup.setView(binding.getRoot()); audioPopup.setView(binding.getRoot());
AlertDialog alert = audioPopup.create(); AlertDialog alert = audioPopup.create();
alert.show(); alert.show();
@ -326,7 +326,7 @@ public class MediaHelper {
* @param listener - OnSchedule * @param listener - OnSchedule
*/ */
public static void scheduleMessage(Activity activity, OnSchedule listener) { 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()); DatetimePickerBinding binding = DatetimePickerBinding.inflate(activity.getLayoutInflater());
dialogBuilder.setView(binding.getRoot()); dialogBuilder.setView(binding.getRoot());

View file

@ -697,7 +697,7 @@ public class PinnedTimelineHelper {
itemShowDMs.setChecked(show_dms); itemShowDMs.setChecked(show_dms);
editor.apply(); editor.apply();
} else if (itemId == R.id.action_filter) { } 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(); LayoutInflater inflater = activity.getLayoutInflater();
View dialogView = inflater.inflate(R.layout.popup_filter_regex, new LinearLayout(activity), false); View dialogView = inflater.inflate(R.layout.popup_filter_regex, new LinearLayout(activity), false);
dialogBuilder.setView(dialogView); dialogBuilder.setView(dialogView);
@ -886,7 +886,7 @@ public class PinnedTimelineHelper {
e.printStackTrace(); e.printStackTrace();
} }
} else if (itemId == R.id.action_any) { } 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(); LayoutInflater inflater = activity.getLayoutInflater();
View dialogView = inflater.inflate(R.layout.tags_any, new LinearLayout(activity), false); View dialogView = inflater.inflate(R.layout.tags_any, new LinearLayout(activity), false);
dialogBuilder.setView(dialogView); dialogBuilder.setView(dialogView);
@ -915,7 +915,7 @@ public class PinnedTimelineHelper {
LayoutInflater inflater; LayoutInflater inflater;
View dialogView; View dialogView;
AlertDialog alertDialog; AlertDialog alertDialog;
dialogBuilder = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); dialogBuilder = new MaterialAlertDialogBuilder(activity);
inflater = activity.getLayoutInflater(); inflater = activity.getLayoutInflater();
dialogView = inflater.inflate(R.layout.tags_all, new LinearLayout(activity), false); dialogView = inflater.inflate(R.layout.tags_all, new LinearLayout(activity), false);
dialogBuilder.setView(dialogView); dialogBuilder.setView(dialogView);
@ -944,7 +944,7 @@ public class PinnedTimelineHelper {
LayoutInflater inflater; LayoutInflater inflater;
View dialogView; View dialogView;
AlertDialog alertDialog; AlertDialog alertDialog;
dialogBuilder = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); dialogBuilder = new MaterialAlertDialogBuilder(activity);
inflater = activity.getLayoutInflater(); inflater = activity.getLayoutInflater();
dialogView = inflater.inflate(R.layout.tags_all, new LinearLayout(activity), false); dialogView = inflater.inflate(R.layout.tags_all, new LinearLayout(activity), false);
dialogBuilder.setView(dialogView); dialogBuilder.setView(dialogView);
@ -973,7 +973,7 @@ public class PinnedTimelineHelper {
LayoutInflater inflater; LayoutInflater inflater;
View dialogView; View dialogView;
AlertDialog alertDialog; AlertDialog alertDialog;
dialogBuilder = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); dialogBuilder = new MaterialAlertDialogBuilder(activity);
inflater = activity.getLayoutInflater(); inflater = activity.getLayoutInflater();
dialogView = inflater.inflate(R.layout.tags_name, new LinearLayout(activity), false); dialogView = inflater.inflate(R.layout.tags_name, new LinearLayout(activity), false);
dialogBuilder.setView(dialogView); dialogBuilder.setView(dialogView);
@ -1114,7 +1114,7 @@ public class PinnedTimelineHelper {
e.printStackTrace(); e.printStackTrace();
} }
} else if (itemId == R.id.action_exclude_visibility) { } 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()); DialogBubbleExcludeVisibilityBinding dialogBinding = DialogBubbleExcludeVisibilityBinding.inflate(activity.getLayoutInflater());
dialogBuilder.setView(dialogBinding.getRoot()); dialogBuilder.setView(dialogBinding.getRoot());
dialogBuilder.setTitle(R.string.exclude_visibility); dialogBuilder.setTitle(R.string.exclude_visibility);
@ -1208,7 +1208,7 @@ public class PinnedTimelineHelper {
} else if (itemId == R.id.action_reply_visibility) { } else if (itemId == R.id.action_reply_visibility) {
AlertDialog.Builder dialogBuilder; AlertDialog.Builder dialogBuilder;
AlertDialog alertDialog; AlertDialog alertDialog;
dialogBuilder = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); dialogBuilder = new MaterialAlertDialogBuilder(activity);
DialogBubbleReplyVisibilityBinding dialogBinding = DialogBubbleReplyVisibilityBinding.inflate(activity.getLayoutInflater()); DialogBubbleReplyVisibilityBinding dialogBinding = DialogBubbleReplyVisibilityBinding.inflate(activity.getLayoutInflater());
dialogBuilder.setView(dialogBinding.getRoot()); dialogBuilder.setView(dialogBinding.getRoot());
dialogBuilder.setTitle(R.string.reply_visibility); dialogBuilder.setTitle(R.string.reply_visibility);
@ -1403,7 +1403,7 @@ public class PinnedTimelineHelper {
} }
}); });
changes[0] = true; changes[0] = true;
AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(activity);
LayoutInflater inflater = activity.getLayoutInflater(); LayoutInflater inflater = activity.getLayoutInflater();
View dialogView = inflater.inflate(R.layout.tags_instance, new LinearLayout(activity), false); View dialogView = inflater.inflate(R.layout.tags_instance, new LinearLayout(activity), false);
dialogBuilder.setView(dialogView); dialogBuilder.setView(dialogView);
@ -1497,7 +1497,7 @@ public class PinnedTimelineHelper {
LayoutInflater inflater; LayoutInflater inflater;
View dialogView; View dialogView;
AlertDialog alertDialog; AlertDialog alertDialog;
dialogBuilder = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); dialogBuilder = new MaterialAlertDialogBuilder(activity);
inflater = activity.getLayoutInflater(); inflater = activity.getLayoutInflater();
dialogView = inflater.inflate(R.layout.tags_name, new LinearLayout(activity), false); dialogView = inflater.inflate(R.layout.tags_name, new LinearLayout(activity), false);
dialogBuilder.setView(dialogView); dialogBuilder.setView(dialogView);
@ -1527,7 +1527,7 @@ public class PinnedTimelineHelper {
alertDialog.show(); alertDialog.show();
} else if (itemId == R.id.action_nitter_manage_accounts) { } else if (itemId == R.id.action_nitter_manage_accounts) {
String accounts = remoteInstance.host; String accounts = remoteInstance.host;
AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(activity, Helper.dialogStyle()); AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(activity);
LayoutInflater inflater = activity.getLayoutInflater(); LayoutInflater inflater = activity.getLayoutInflater();
View dialogView = inflater.inflate(R.layout.tags_any, new LinearLayout(activity), false); View dialogView = inflater.inflate(R.layout.tags_any, new LinearLayout(activity), false);
dialogBuilder.setView(dialogView); dialogBuilder.setView(dialogView);

View file

@ -59,7 +59,7 @@ public class PushHelper {
Runnable myRunnable = () -> { Runnable myRunnable = () -> {
List<String> distributors = UnifiedPush.getDistributors(context, new ArrayList<>()); List<String> distributors = UnifiedPush.getDistributors(context, new ArrayList<>());
if (distributors.size() == 0) { 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); alert.setTitle(R.string.no_distributors_found);
final TextView message = new TextView(context); final TextView message = new TextView(context);
String link = "https://fedilab.app/wiki/features/push-notifications/"; String link = "https://fedilab.app/wiki/features/push-notifications/";
@ -136,7 +136,7 @@ public class PushHelper {
return; return;
} }
AlertDialog.Builder alert = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); AlertDialog.Builder alert = new MaterialAlertDialogBuilder(context);
alert.setTitle(R.string.select_distributors); alert.setTitle(R.string.select_distributors);
String[] distributorsStr = distributors.toArray(new String[0]); String[] distributorsStr = distributors.toArray(new String[0]);
alert.setSingleChoiceItems(distributorsStr, -1, (dialog, item) -> { alert.setSingleChoiceItems(distributorsStr, -1, (dialog, item) -> {

View file

@ -640,7 +640,7 @@ public class SpannableHelper {
return; 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.setMessage(context.getString(R.string.mute_tag, tag));
builder builder
.setPositiveButton(R.string.yes, (dialog, which) -> { .setPositiveButton(R.string.yes, (dialog, which) -> {

View file

@ -108,7 +108,7 @@ public class TranslateHelper {
} }
j++; j++;
} }
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context);
builder.setTitle(context.getString(R.string.translate_in)); builder.setTitle(context.getString(R.string.translate_in));
builder.setItems(languagesArr, (dialogInterface, i) -> { builder.setItems(languagesArr, (dialogInterface, i) -> {
myTransL.translate(statusToTranslate, codesArr[i], params, new Results() { myTransL.translate(statusToTranslate, codesArr[i], params, new Results() {

View file

@ -237,7 +237,7 @@ public class AccountAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
} else if (finalDoAction == ProfileActivity.action.UNFOLLOW) { } else if (finalDoAction == ProfileActivity.action.UNFOLLOW) {
boolean confirm_unfollow = sharedpreferences.getBoolean(context.getString(R.string.SET_UNFOLLOW_VALIDATION), true); boolean confirm_unfollow = sharedpreferences.getBoolean(context.getString(R.string.SET_UNFOLLOW_VALIDATION), true);
if (confirm_unfollow) { 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.setTitle(context.getString(R.string.unfollow_confirm));
unfollowConfirm.setMessage(account.acct); unfollowConfirm.setMessage(account.acct);
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());

View file

@ -158,7 +158,7 @@ public class AnnouncementAdapter extends RecyclerView.Adapter<AnnouncementAdapte
emojiPopup.toggle(); emojiPopup.toggle();
}); });
holder.binding.statusAddCustomEmoji.setOnClickListener(v -> { holder.binding.statusAddCustomEmoji.setOnClickListener(v -> {
final AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); final AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context);
int paddingPixel = 15; int paddingPixel = 15;
float density = context.getResources().getDisplayMetrics().density; float density = context.getResources().getDisplayMetrics().density;
int paddingDp = (int) (paddingPixel * density); int paddingDp = (int) (paddingPixel * density);

View file

@ -1111,7 +1111,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
context.startActivity(intent); context.startActivity(intent);
}); });
composeAttachmentItemBinding.buttonDescription.setOnClickListener(v -> { 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); builderInner.setTitle(R.string.upload_form_description);
PopupMediaDescriptionBinding popupMediaDescriptionBinding = PopupMediaDescriptionBinding.inflate(LayoutInflater.from(context), null, false); PopupMediaDescriptionBinding popupMediaDescriptionBinding = PopupMediaDescriptionBinding.inflate(LayoutInflater.from(context), null, false);
builderInner.setView(popupMediaDescriptionBinding.getRoot()); builderInner.setView(popupMediaDescriptionBinding.getRoot());
@ -1173,7 +1173,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
} }
}); });
composeAttachmentItemBinding.buttonRemove.setOnClickListener(v -> { 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.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
builderInner.setPositiveButton(R.string.delete, (dialog, which) -> { builderInner.setPositiveButton(R.string.delete, (dialog, which) -> {
attachmentList.remove(attachment); attachmentList.remove(attachment);
@ -1302,7 +1302,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
holder.binding.buttonMathsComposer.setVisibility(View.VISIBLE); holder.binding.buttonMathsComposer.setVisibility(View.VISIBLE);
holder.binding.buttonMathsComposer.setOnClickListener(v -> { holder.binding.buttonMathsComposer.setOnClickListener(v -> {
int cursorPosition = holder.binding.content.getSelectionStart(); int cursorPosition = holder.binding.content.getSelectionStart();
AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context);
Resources res = context.getResources(); Resources res = context.getResources();
String[] formatArr = res.getStringArray(R.array.SET_MATHS_FORMAT); String[] formatArr = res.getStringArray(R.array.SET_MATHS_FORMAT);
builder.setItems(formatArr, (dialogInterface, i) -> { 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.buttonLocalOnly.setVisibility(View.VISIBLE);
} }
holder.binding.buttonTextFormat.setOnClickListener(v -> { 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)); builder.setTitle(context.getString(R.string.post_format));
Resources res = context.getResources(); Resources res = context.getResources();
String[] formatArr = res.getStringArray(R.array.SET_POST_FORMAT); String[] formatArr = res.getStringArray(R.array.SET_POST_FORMAT);
@ -1358,7 +1358,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
builder.create().show(); builder.create().show();
}); });
holder.binding.buttonLocalOnly.setOnClickListener(v -> { 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)); builder.setTitle(context.getString(R.string.local_only));
Resources res = context.getResources(); Resources res = context.getResources();
boolean[] valArr = new boolean[]{false, true}; boolean[] valArr = new boolean[]{false, true};
@ -1674,7 +1674,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
} }
SharedPreferences.Editor editor = sharedpreferences.edit(); 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.setTitle(context.getString(R.string.message_language));
builder.setSingleChoiceItems(languagesArr, selection, null); builder.setSingleChoiceItems(languagesArr, selection, null);
@ -1708,7 +1708,7 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
* @param position - int position * @param position - int position
*/ */
private void displayPollPopup(ComposeViewHolder holder, Status statusDraft, 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); alertPoll.setTitle(R.string.create_poll);
ComposePollBinding composePollBinding = ComposePollBinding.inflate(LayoutInflater.from(context), new LinearLayout(context), false); ComposePollBinding composePollBinding = ComposePollBinding.inflate(LayoutInflater.from(context), new LinearLayout(context), false);
alertPoll.setView(composePollBinding.getRoot()); 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 { 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; int paddingPixel = 15;
float density = context.getResources().getDisplayMetrics().density; float density = context.getResources().getDisplayMetrics().density;
int paddingDp = (int) (paddingPixel * density); int paddingDp = (int) (paddingPixel * density);

View file

@ -76,7 +76,7 @@ public class DomainBlockAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
holder.binding.domainName.setText(domain); holder.binding.domainName.setText(domain);
AccountsVM accountsVM = new ViewModelProvider((ViewModelStoreOwner) context).get(AccountsVM.class); AccountsVM accountsVM = new ViewModelProvider((ViewModelStoreOwner) context).get(AccountsVM.class);
holder.binding.unblockDomain.setOnClickListener(v -> { 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.setMessage(context.getString(R.string.unblock_domain_confirm, domain));
alt_bld.setPositiveButton(R.string.yes, (dialog, id) -> { alt_bld.setPositiveButton(R.string.yes, (dialog, id) -> {
accountsVM.removeDomainBlocks(MainActivity.currentInstance, MainActivity.currentToken, domain); accountsVM.removeDomainBlocks(MainActivity.currentInstance, MainActivity.currentToken, domain);

View file

@ -34,7 +34,6 @@ import app.fedilab.android.R;
import app.fedilab.android.databinding.DrawerFilterBinding; import app.fedilab.android.databinding.DrawerFilterBinding;
import app.fedilab.android.mastodon.activities.FilterActivity; import app.fedilab.android.mastodon.activities.FilterActivity;
import app.fedilab.android.mastodon.client.entities.api.Filter; import app.fedilab.android.mastodon.client.entities.api.Filter;
import app.fedilab.android.mastodon.helper.Helper;
import app.fedilab.android.mastodon.viewmodel.mastodon.FiltersVM; 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 -> { 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.setTitle(R.string.action_filter_delete);
builder.setMessage(R.string.action_lists_confirm_delete); builder.setMessage(R.string.action_lists_confirm_delete);
builder.setIcon(android.R.drawable.ic_dialog_alert) builder.setIcon(android.R.drawable.ic_dialog_alert)

View file

@ -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.RemoteInstance;
import app.fedilab.android.mastodon.client.entities.app.Timeline; import app.fedilab.android.mastodon.client.entities.app.Timeline;
import app.fedilab.android.mastodon.exception.DBException; 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.ItemTouchHelperAdapter;
import app.fedilab.android.mastodon.helper.itemtouchhelper.ItemTouchHelperViewHolder; import app.fedilab.android.mastodon.helper.itemtouchhelper.ItemTouchHelperViewHolder;
import app.fedilab.android.mastodon.helper.itemtouchhelper.OnStartDragListener; 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 -> { holder.binding.delete.setOnClickListener(v -> {
if (item.type == Timeline.TimeLineEnum.TAG || item.type == Timeline.TimeLineEnum.REMOTE || item.type == Timeline.TimeLineEnum.LIST) { 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 title = "";
String message = ""; String message = "";
alt_bld.setTitle(R.string.action_lists_delete); alt_bld.setTitle(R.string.action_lists_delete);

View file

@ -571,7 +571,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
}); });
holder.binding.statusAddCustomEmoji.setOnClickListener(v -> { holder.binding.statusAddCustomEmoji.setOnClickListener(v -> {
final AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); final AlertDialog.Builder builder = new MaterialAlertDialogBuilder(context);
int paddingPixel = 15; int paddingPixel = 15;
float density = context.getResources().getDisplayMetrics().density; float density = context.getResources().getDisplayMetrics().density;
int paddingDp = (int) (paddingPixel * density); int paddingDp = (int) (paddingPixel * density);
@ -914,7 +914,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
}); });
holder.binding.actionButtonBoost.setOnClickListener(v -> { holder.binding.actionButtonBoost.setOnClickListener(v -> {
if (confirmBoost) { if (confirmBoost) {
AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(context);
if (statusToDeal.reblogged) { if (statusToDeal.reblogged) {
alt_bld.setMessage(context.getString(R.string.reblog_remove)); alt_bld.setMessage(context.getString(R.string.reblog_remove));
} else { } else {
@ -984,7 +984,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
}); });
holder.binding.actionButtonFavorite.setOnClickListener(v -> { holder.binding.actionButtonFavorite.setOnClickListener(v -> {
if (confirmFav) { if (confirmFav) {
AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); AlertDialog.Builder alt_bld = new MaterialAlertDialogBuilder(context);
if (status.favourited) { if (status.favourited) {
alt_bld.setMessage(context.getString(R.string.favourite_remove)); alt_bld.setMessage(context.getString(R.string.favourite_remove));
} else { } else {
@ -1759,7 +1759,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
popup.setOnMenuItemClickListener(item -> { popup.setOnMenuItemClickListener(item -> {
int itemId = item.getItemId(); int itemId = item.getItemId();
if (itemId == R.id.action_redraft) { 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.setTitle(stringArrayConf[1]);
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
builderInner.setPositiveButton(R.string.yes, (dialog, which) -> { 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) { } else if (itemId == R.id.action_open_browser) {
Helper.openBrowser(context, statusToDeal.url); Helper.openBrowser(context, statusToDeal.url);
} else if (itemId == R.id.action_remove) { } 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.setTitle(stringArrayConf[0]);
builderInner.setMessage(statusToDeal.content); builderInner.setMessage(statusToDeal.content);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
@ -1835,7 +1835,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
})); }));
builderInner.show(); builderInner.show();
} else if (itemId == R.id.action_block_domain) { } 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]); builderInner.setTitle(stringArrayConf[3]);
String domain = statusToDeal.account.acct.split("@")[1]; String domain = statusToDeal.account.acct.split("@")[1];
builderInner.setMessage(context.getString(R.string.block_domain_confirm_message, domain)); 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(); builderInner.show();
} else if (itemId == R.id.action_mute) { } 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.setTitle(stringArrayConf[0]);
builderInner.setMessage(statusToDeal.account.acct); builderInner.setMessage(statusToDeal.account.acct);
builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
@ -1862,7 +1862,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
})); }));
builderInner.show(); builderInner.show();
} else if (itemId == R.id.action_mute_home) { } 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.setTitle(R.string.mute_home);
builderInner.setMessage(statusToDeal.account.acct); builderInner.setMessage(statusToDeal.account.acct);
builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); 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); MastodonHelper.scheduleBoost(context, MastodonHelper.ScheduleType.TIMED_MUTED, statusToDeal, null, null);
return true; return true;
} else if (itemId == R.id.action_block) { } 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.setTitle(stringArrayConf[1]);
builderInner.setMessage(statusToDeal.account.acct); builderInner.setMessage(statusToDeal.account.acct);
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); 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()); Handler mainHandler = new Handler(Looper.getMainLooper());
Runnable myRunnable = () -> { Runnable myRunnable = () -> {
AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(context, Helper.dialogStyle()); AlertDialog.Builder builderSingle = new MaterialAlertDialogBuilder(context);
builderSingle.setTitle(context.getString(R.string.choose_accounts)); builderSingle.setTitle(context.getString(R.string.choose_accounts));
final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList); final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList);
final BaseAccount[] accountArray = new BaseAccount[accounts.size()]; final BaseAccount[] accountArray = new BaseAccount[accounts.size()];

View file

@ -106,7 +106,7 @@ public class StatusDraftAdapter extends RecyclerView.Adapter<StatusDraftAdapter.
holder.binding.delete.setOnClickListener(v -> { 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.setMessage(context.getString(R.string.remove_draft));
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
unfollowConfirm.setPositiveButton(R.string.delete, (dialog, which) -> { unfollowConfirm.setPositiveButton(R.string.delete, (dialog, which) -> {

View file

@ -132,7 +132,7 @@ public class StatusScheduledAdapter extends RecyclerView.Adapter<StatusScheduled
}); });
holder.binding.delete.setOnClickListener(v -> { 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.setMessage(context.getString(R.string.remove_scheduled));
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
unfollowConfirm.setPositiveButton(R.string.delete, (dialog, which) -> { unfollowConfirm.setPositiveButton(R.string.delete, (dialog, which) -> {

View file

@ -18,14 +18,11 @@ import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import androidx.preference.EditTextPreference; import androidx.preference.EditTextPreference;
import androidx.preference.MultiSelectListPreference;
import androidx.preference.PreferenceFragmentCompat; import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
import androidx.preference.SwitchPreferenceCompat;
import app.fedilab.android.BaseMainActivity; import app.fedilab.android.BaseMainActivity;
import app.fedilab.android.R; import app.fedilab.android.R;
import app.fedilab.android.mastodon.helper.Helper;
public class FragmentComposeSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener { public class FragmentComposeSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
@ -36,20 +33,13 @@ public class FragmentComposeSettings extends PreferenceFragmentCompat implements
} }
private void createPref() { 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()); SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
EditTextPreference SET_WATERMARK_TEXT = findPreference(getString(R.string.SET_WATERMARK_TEXT)); EditTextPreference SET_WATERMARK_TEXT = findPreference(getString(R.string.SET_WATERMARK_TEXT));
if (SET_WATERMARK_TEXT != null) { 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)); 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); 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 @Override

View file

@ -25,7 +25,6 @@ import androidx.preference.SwitchPreferenceCompat;
import app.fedilab.android.R; import app.fedilab.android.R;
import app.fedilab.android.activities.MainActivity; import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.mastodon.helper.Helper;
public class FragmentExtraFeaturesSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener { 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)); ListPreference SET_POST_FORMAT = findPreference(getString(R.string.SET_POST_FORMAT));
if (SET_POST_FORMAT != null) { 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"); String format = sharedpreferences.getString(getString(R.string.SET_POST_FORMAT) + MainActivity.currentUserID + MainActivity.currentInstance, "text/plain");
SET_POST_FORMAT.setValue(format); SET_POST_FORMAT.setValue(format);
} }
ListPreference SET_COMPOSE_LOCAL_ONLY = findPreference(getString(R.string.SET_COMPOSE_LOCAL_ONLY)); ListPreference SET_COMPOSE_LOCAL_ONLY = findPreference(getString(R.string.SET_COMPOSE_LOCAL_ONLY));
if (SET_COMPOSE_LOCAL_ONLY != null) { 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); int localOnly = sharedpreferences.getInt(getString(R.string.SET_COMPOSE_LOCAL_ONLY) + MainActivity.currentUserID + MainActivity.currentInstance, 0);
SET_COMPOSE_LOCAL_ONLY.setValue(String.valueOf(localOnly)); SET_COMPOSE_LOCAL_ONLY.setValue(String.valueOf(localOnly));
} }

View file

@ -66,7 +66,6 @@ public class FragmentInterfaceSettings extends PreferenceFragmentCompat implemen
} }
ListPreference SET_LOGO_LAUNCHER = findPreference(getString(R.string.SET_LOGO_LAUNCHER)); ListPreference SET_LOGO_LAUNCHER = findPreference(getString(R.string.SET_LOGO_LAUNCHER));
if (SET_LOGO_LAUNCHER != null) { if (SET_LOGO_LAUNCHER != null) {
SET_LOGO_LAUNCHER.getContext().setTheme(Helper.dialogStyle());
SET_LOGO_LAUNCHER.setIcon(LogoHelper.getDrawable(SET_LOGO_LAUNCHER.getValue())); SET_LOGO_LAUNCHER.setIcon(LogoHelper.getDrawable(SET_LOGO_LAUNCHER.getValue()));
} }
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());

View file

@ -18,7 +18,6 @@ import android.annotation.SuppressLint;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import androidx.preference.ListPreference;
import androidx.preference.Preference; import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat; import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
@ -36,10 +35,6 @@ public class FragmentLanguageSettings extends PreferenceFragmentCompat implement
@SuppressLint("ApplySharedPref") @SuppressLint("ApplySharedPref")
private void createPref() { 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)); Preference SET_TRANSLATE_VALUES_RESET = findPreference(getString(R.string.SET_TRANSLATE_VALUES_RESET));
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
if (SET_TRANSLATE_VALUES_RESET != null) { if (SET_TRANSLATE_VALUES_RESET != null) {

View file

@ -36,7 +36,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import app.fedilab.android.R; 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.PushHelper;
import app.fedilab.android.mastodon.helper.settings.TimePreference; import app.fedilab.android.mastodon.helper.settings.TimePreference;
import app.fedilab.android.mastodon.helper.settings.TimePreferenceDialogFragment; 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)); 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); String[] notificationValues = getResources().getStringArray(R.array.SET_NOTIFICATION_TYPE_VALUE);
if (SET_NOTIFICATION_TYPE != null && SET_NOTIFICATION_TYPE.getValue().equals(notificationValues[2])) { if (SET_NOTIFICATION_TYPE != null && SET_NOTIFICATION_TYPE.getValue().equals(notificationValues[2])) {
PreferenceCategory notification_sounds = findPreference("notification_sounds"); PreferenceCategory notification_sounds = findPreference("notification_sounds");
@ -107,10 +103,6 @@ public class FragmentNotificationsSettings extends PreferenceFragmentCompat impl
} }
return; return;
} else if (SET_NOTIFICATION_TYPE != null && SET_NOTIFICATION_TYPE.getValue().equals(notificationValues[1])) { } 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"); ListPreference SET_PUSH_DISTRIBUTOR = findPreference("SET_PUSH_DISTRIBUTOR");
if (SET_PUSH_DISTRIBUTOR != null) { if (SET_PUSH_DISTRIBUTOR != null) {
preferenceScreen.removePreferenceRecursively("SET_PUSH_DISTRIBUTOR"); 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)); ListPreference SET_PUSH_DISTRIBUTOR = findPreference(getString(R.string.SET_PUSH_DISTRIBUTOR));
if (SET_PUSH_DISTRIBUTOR != null) { if (SET_PUSH_DISTRIBUTOR != null) {
SET_PUSH_DISTRIBUTOR.getContext().setTheme(Helper.dialogStyle());
List<String> distributors = UnifiedPush.getDistributors(requireActivity(), new ArrayList<>()); List<String> distributors = UnifiedPush.getDistributors(requireActivity(), new ArrayList<>());
SET_PUSH_DISTRIBUTOR.setValue(UnifiedPush.getDistributor(requireActivity())); SET_PUSH_DISTRIBUTOR.setValue(UnifiedPush.getDistributor(requireActivity()));
SET_PUSH_DISTRIBUTOR.setEntries(distributors.toArray(new String[0])); SET_PUSH_DISTRIBUTOR.setEntries(distributors.toArray(new String[0]));

View file

@ -18,11 +18,9 @@ package app.fedilab.android.mastodon.ui.fragment.settings;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.os.Bundle; import android.os.Bundle;
import androidx.preference.EditTextPreference;
import androidx.preference.PreferenceFragmentCompat; import androidx.preference.PreferenceFragmentCompat;
import app.fedilab.android.R; import app.fedilab.android.R;
import app.fedilab.android.mastodon.helper.Helper;
public class FragmentPrivacySettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener { public class FragmentPrivacySettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
@ -33,10 +31,6 @@ public class FragmentPrivacySettings extends PreferenceFragmentCompat implements
} }
private void createPref() { 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 @Override

View file

@ -82,18 +82,7 @@ public class FragmentThemingSettings extends PreferenceFragmentCompat implements
if (getPreferenceScreen() == null) { if (getPreferenceScreen() == null) {
Toasty.error(requireActivity(), getString(R.string.toast_error), Toasty.LENGTH_SHORT).show(); 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)); Preference SET_CUSTOMIZE_LIGHT_COLORS_ACTION = findPreference(getString(R.string.SET_CUSTOMIZE_LIGHT_COLORS_ACTION));
if (SET_CUSTOMIZE_LIGHT_COLORS_ACTION != null) { 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)); Preference SET_RESET_CUSTOM_COLOR = findPreference(getString(R.string.SET_RESET_CUSTOM_COLOR));
if (SET_RESET_CUSTOM_COLOR != null) { if (SET_RESET_CUSTOM_COLOR != null) {
SET_RESET_CUSTOM_COLOR.getContext().setTheme(Helper.dialogStyle());
SET_RESET_CUSTOM_COLOR.setOnPreferenceClickListener(preference -> { 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.setMessage(getString(R.string.reset_color));
resetConfirm.setNegativeButton(R.string.no, (dialog, which) -> dialog.dismiss()); resetConfirm.setNegativeButton(R.string.no, (dialog, which) -> dialog.dismiss());
resetConfirm.setPositiveButton(R.string.reset, (dialog, which) -> { resetConfirm.setPositiveButton(R.string.reset, (dialog, which) -> {

View file

@ -26,7 +26,6 @@ import androidx.preference.SwitchPreferenceCompat;
import app.fedilab.android.R; import app.fedilab.android.R;
import app.fedilab.android.activities.MainActivity; import app.fedilab.android.activities.MainActivity;
import app.fedilab.android.mastodon.helper.Helper;
public class FragmentTimelinesSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener { public class FragmentTimelinesSettings extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener {
@ -42,18 +41,11 @@ public class FragmentTimelinesSettings extends PreferenceFragmentCompat implemen
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity()); SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(requireActivity());
addPreferencesFromResource(R.xml.pref_timelines); addPreferencesFromResource(R.xml.pref_timelines);
PreferenceScreen preferenceScreen = getPreferenceScreen(); 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)); 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)); 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)); 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 != null && SET_TRANSLATOR.getValue().equals("FEDILAB")) {
if (SET_TRANSLATOR_API_KEY != null) { if (SET_TRANSLATOR_API_KEY != null) {

View file

@ -44,7 +44,6 @@ import app.fedilab.android.BaseMainActivity;
import app.fedilab.android.R; import app.fedilab.android.R;
import app.fedilab.android.databinding.FragmentNotificationContainerBinding; import app.fedilab.android.databinding.FragmentNotificationContainerBinding;
import app.fedilab.android.databinding.PopupNotificationSettingsBinding; 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.ui.pageadapter.FedilabNotificationPageAdapter;
import app.fedilab.android.mastodon.viewmodel.mastodon.NotificationsVM; import app.fedilab.android.mastodon.viewmodel.mastodon.NotificationsVM;
import es.dmoral.toasty.Toasty; import es.dmoral.toasty.Toasty;
@ -89,13 +88,13 @@ public class FragmentNotificationContainer extends Fragment {
} }
AtomicBoolean changes = new AtomicBoolean(false); AtomicBoolean changes = new AtomicBoolean(false);
binding.settings.setOnClickListener(v -> { binding.settings.setOnClickListener(v -> {
AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(requireActivity(), Helper.dialogStyle()); AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(requireActivity());
PopupNotificationSettingsBinding dialogView = PopupNotificationSettingsBinding.inflate(getLayoutInflater()); PopupNotificationSettingsBinding dialogView = PopupNotificationSettingsBinding.inflate(getLayoutInflater());
dialogBuilder.setView(dialogView.getRoot()); dialogBuilder.setView(dialogView.getRoot());
dialogView.clearAllNotif.setOnClickListener(v1 -> { 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.setTitle(R.string.delete_notification_ask_all);
db.setMessage(R.string.delete_notification_all_warning); db.setMessage(R.string.delete_notification_all_warning);
db.setPositiveButton(R.string.delete_all, (dialog, id) -> { db.setPositiveButton(R.string.delete_all, (dialog, id) -> {

View file

@ -161,7 +161,7 @@ public class AllPlaylistsActivity extends BaseBarActivity implements PlaylistAda
public void manageAlert(Playlist playlistParam) { public void manageAlert(Playlist playlistParam) {
playlistToEdit = 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); bindingDialog = AddPlaylistPeertubeBinding.inflate(LayoutInflater.from(AllPlaylistsActivity.this), null, false);
dialogBuilder.setView(bindingDialog.getRoot()); dialogBuilder.setView(bindingDialog.getRoot());

View file

@ -93,7 +93,7 @@ public class ManageInstancesActivity extends BaseBarActivity implements AboutIns
@SuppressLint("ApplySharedPref") @SuppressLint("ApplySharedPref")
private void showRadioButtonDialogFullInstances(Activity activity) { private void showRadioButtonDialogFullInstances(Activity activity) {
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(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); alt_bld.setTitle(R.string.instance_choice);
String instance = HelperInstance.getLiveInstance(activity); String instance = HelperInstance.getLiveInstance(activity);
final EditText input = new EditText(activity); final EditText input = new EditText(activity);

View file

@ -679,7 +679,7 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis
} }
private void reportAlert(RetrofitPeertubeAPI.ActionType type, AlertDialog alertDialog) { 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(); LayoutInflater inflater1 = getLayoutInflater();
View dialogView = inflater1.inflate(R.layout.popup_report_peertube, new LinearLayout(PeertubeActivity.this), false); View dialogView = inflater1.inflate(R.layout.popup_report_peertube, new LinearLayout(PeertubeActivity.this), false);
dialogBuilder.setView(dialogView); dialogBuilder.setView(dialogView);
@ -879,7 +879,7 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis
}); });
binding.videoInformation.setOnClickListener(v -> { 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()); PopupVideoInfoPeertubeBinding videoInfo = PopupVideoInfoPeertubeBinding.inflate(getLayoutInflater());
@ -1109,7 +1109,7 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis
} else if (itemId == R.id.action_report) { } else if (itemId == R.id.action_report) {
AlertDialog alertDialog; AlertDialog alertDialog;
AlertDialog.Builder dialogBuilder; AlertDialog.Builder dialogBuilder;
dialogBuilder = new MaterialAlertDialogBuilder(PeertubeActivity.this, app.fedilab.android.mastodon.helper.Helper.dialogStyle()); dialogBuilder = new MaterialAlertDialogBuilder(PeertubeActivity.this);
LayoutInflater inflater1 = getLayoutInflater(); LayoutInflater inflater1 = getLayoutInflater();
View dialogView = inflater1.inflate(R.layout.popup_report_choice, new LinearLayout(PeertubeActivity.this), false); View dialogView = inflater1.inflate(R.layout.popup_report_choice, new LinearLayout(PeertubeActivity.this), false);
dialogBuilder.setView(dialogView); 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)) { if (promptNSFW && peertube != null && peertube.isNsfw() && (nsfwAction.compareTo(Helper.BLUR) == 0 || nsfwAction.compareTo(Helper.DO_NOT_LIST) == 0)) {
AlertDialog alertDialog; AlertDialog alertDialog;
AlertDialog.Builder dialogBuilder; 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.setTitle(R.string.nsfw_title_warning);
dialogBuilder.setCancelable(false); dialogBuilder.setCancelable(false);
dialogBuilder.setMessage(R.string.nsfw_message_warning); dialogBuilder.setMessage(R.string.nsfw_message_warning);
@ -2033,7 +2033,7 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis
return; return;
} }
if (apiResponse.getPlaylists() != null && apiResponse.getPlaylists().size() > 0) { 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); builder.setTitle(R.string.modify_playlists);
List<PlaylistData.Playlist> ownerPlaylists = apiResponse.getPlaylists(); List<PlaylistData.Playlist> ownerPlaylists = apiResponse.getPlaylists();

View file

@ -109,7 +109,7 @@ public class PeertubeEditUploadActivity extends BaseBarActivity {
binding.setUploadDelete.setOnClickListener(v -> { binding.setUploadDelete.setOnClickListener(v -> {
AlertDialog.Builder builderInner; 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.setMessage(getString(R.string.delete_video_confirmation));
builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
builderInner.setPositiveButton(R.string.yes, (dialog, which) -> { builderInner.setPositiveButton(R.string.yes, (dialog, which) -> {

View file

@ -540,7 +540,7 @@ public class PeertubeMainActivity extends PeertubeBaseMainActivity {
instanceConfig = new RetrofitPeertubeAPI(PeertubeMainActivity.this).getConfigInstance(); instanceConfig = new RetrofitPeertubeAPI(PeertubeMainActivity.this).getConfigInstance();
} catch (Error error) { } catch (Error error) {
runOnUiThread(() -> { 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.setTitle(R.string.refresh_token_failed);
alt_bld.setMessage(R.string.refresh_token_failed_message); alt_bld.setMessage(R.string.refresh_token_failed_message);
alt_bld.setNegativeButton(R.string.action_logout, (dialog, id) -> { alt_bld.setNegativeButton(R.string.action_logout, (dialog, id) -> {
@ -683,7 +683,7 @@ public class PeertubeMainActivity extends PeertubeBaseMainActivity {
@SuppressLint("ApplySharedPref") @SuppressLint("ApplySharedPref")
private void showRadioButtonDialog() { 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); alt_bld.setTitle(R.string.instance_choice);
final SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(PeertubeMainActivity.this); final SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(PeertubeMainActivity.this);
String acad = HelperInstance.getLiveInstance(PeertubeMainActivity.this); String acad = HelperInstance.getLiveInstance(PeertubeMainActivity.this);

View file

@ -113,7 +113,7 @@ public class ShowAccountActivity extends BaseBarActivity {
PostActionsVM viewModel = new ViewModelProvider(ShowAccountActivity.this).get(PostActionsVM.class); 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)); 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) { } 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(); LayoutInflater inflater1 = getLayoutInflater();
View dialogView = inflater1.inflate(R.layout.popup_report_peertube, new LinearLayout(ShowAccountActivity.this), false); View dialogView = inflater1.inflate(R.layout.popup_report_peertube, new LinearLayout(ShowAccountActivity.this), false);
dialogBuilder.setView(dialogView); dialogBuilder.setView(dialogView);

View file

@ -134,7 +134,7 @@ public class ShowChannelActivity extends BaseBarActivity {
PostActionsVM viewModel = new ViewModelProvider(ShowChannelActivity.this).get(PostActionsVM.class); PostActionsVM viewModel = new ViewModelProvider(ShowChannelActivity.this).get(PostActionsVM.class);
viewModel.post(MUTE, channel.getOwnerAccount().getAcct(), null).observe(ShowChannelActivity.this, apiResponse -> manageVIewPostActions(MUTE, apiResponse)); viewModel.post(MUTE, channel.getOwnerAccount().getAcct(), null).observe(ShowChannelActivity.this, apiResponse -> manageVIewPostActions(MUTE, apiResponse));
} else if (item.getItemId() == R.id.action_report) { } 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(); LayoutInflater inflater1 = getLayoutInflater();
View dialogView = inflater1.inflate(R.layout.popup_report_peertube, new LinearLayout(ShowChannelActivity.this), false); View dialogView = inflater1.inflate(R.layout.popup_report_peertube, new LinearLayout(ShowChannelActivity.this), false);
dialogBuilder.setView(dialogView); dialogBuilder.setView(dialogView);
@ -265,7 +265,7 @@ public class ShowChannelActivity extends BaseBarActivity {
} else if (doAction == action.UNFOLLOW) { } else if (doAction == action.UNFOLLOW) {
boolean confirm_unfollow = sharedpreferences.getBoolean(Helper.SET_UNFOLLOW_VALIDATION, true); boolean confirm_unfollow = sharedpreferences.getBoolean(Helper.SET_UNFOLLOW_VALIDATION, true);
if (confirm_unfollow) { 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.setTitle(getString(R.string.unfollow_confirm));
unfollowConfirm.setMessage(channel.getAcct()); unfollowConfirm.setMessage(channel.getAcct());
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());

View file

@ -145,7 +145,7 @@ public class VideosTimelineActivity extends BaseBarActivity {
finish(); finish();
return true; return true;
} else if (item.getItemId() == R.id.action_delete) { } 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.setTitle(R.string.delete_history);
builder.setMessage(R.string.delete_history_confirm); builder.setMessage(R.string.delete_history_confirm);
builder.setIcon(android.R.drawable.ic_dialog_alert) builder.setIcon(android.R.drawable.ic_dialog_alert)

View file

@ -17,7 +17,6 @@ package app.fedilab.android.peertube.drawer;
import static androidx.core.text.HtmlCompat.FROM_HTML_MODE_LEGACY; 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.PREF_USER_INSTANCE;
import static app.fedilab.android.mastodon.helper.Helper.dialogStyle;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.app.Activity; import android.app.Activity;
@ -143,7 +142,7 @@ public class AboutInstanceAdapter extends RecyclerView.Adapter<RecyclerView.View
popup.setOnMenuItemClickListener(item -> { popup.setOnMenuItemClickListener(item -> {
int itemId = item.getItemId(); int itemId = item.getItemId();
if (itemId == R.id.action_delete) { if (itemId == R.id.action_delete) {
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context, dialogStyle()); MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context);
builder.setTitle(R.string.delete_instance); builder.setTitle(R.string.delete_instance);
builder.setMessage(R.string.delete_instance_confirm); builder.setMessage(R.string.delete_instance_confirm);
builder.setIcon(android.R.drawable.ic_dialog_alert) builder.setIcon(android.R.drawable.ic_dialog_alert)

View file

@ -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_ID;
import static app.fedilab.android.mastodon.helper.Helper.PREF_USER_INSTANCE; 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.Context;
import android.content.Intent; import android.content.Intent;
@ -90,7 +89,7 @@ public class ChannelListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
popup.setOnMenuItemClickListener(item -> { popup.setOnMenuItemClickListener(item -> {
int itemId = item.getItemId(); int itemId = item.getItemId();
if (itemId == R.id.action_delete) { 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.setTitle(context.getString(R.string.delete_channel) + ": " + channel.getName());
builder.setMessage(context.getString(R.string.action_channel_confirm_delete)); builder.setMessage(context.getString(R.string.action_channel_confirm_delete));
builder.setIcon(android.R.drawable.ic_dialog_alert) builder.setIcon(android.R.drawable.ic_dialog_alert)

View file

@ -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, * You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */ * 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.MUTE;
import static app.fedilab.android.peertube.client.RetrofitPeertubeAPI.ActionType.REPLY; 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(); int itemId = item.getItemId();
MaterialAlertDialogBuilder builder; MaterialAlertDialogBuilder builder;
if (itemId == R.id.action_delete) { if (itemId == R.id.action_delete) {
builder = new MaterialAlertDialogBuilder(context, dialogStyle()); builder = new MaterialAlertDialogBuilder(context);
builder.setTitle(R.string.delete_comment); builder.setTitle(R.string.delete_comment);
builder.setMessage(R.string.delete_comment_confirm); builder.setMessage(R.string.delete_comment_confirm);
builder.setIcon(android.R.drawable.ic_dialog_alert) builder.setIcon(android.R.drawable.ic_dialog_alert)
@ -196,7 +196,7 @@ public class CommentListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHo
allCommentRemoved.onAllCommentRemoved(); allCommentRemoved.onAllCommentRemoved();
} }
} else if (itemId == R.id.action_remove_comments) { } 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.setTitle(R.string.delete_account_comment);
builder.setMessage(R.string.delete_account_comment_confirm); builder.setMessage(R.string.delete_account_comment_confirm);
builder.setIcon(android.R.drawable.ic_dialog_alert) builder.setIcon(android.R.drawable.ic_dialog_alert)

View file

@ -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, * You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */ * 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.FOLLOW;
import static app.fedilab.android.peertube.client.RetrofitPeertubeAPI.ActionType.UNFOLLOW; import static app.fedilab.android.peertube.client.RetrofitPeertubeAPI.ActionType.UNFOLLOW;
import static app.fedilab.android.peertube.viewmodel.TimelineVM.TimelineType.MY_VIDEOS; 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)); popup.getMenu().findItem(R.id.action_follow).setTitle(context.getString(R.string.action_follow));
boolean confirm_unfollow = sharedpreferences.getBoolean(Helper.SET_UNFOLLOW_VALIDATION, true); boolean confirm_unfollow = sharedpreferences.getBoolean(Helper.SET_UNFOLLOW_VALIDATION, true);
if (confirm_unfollow) { 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.setTitle(context.getString(R.string.unfollow_confirm));
unfollowConfirm.setMessage(video.getChannel().getAcct()); unfollowConfirm.setMessage(video.getChannel().getAcct());
unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
@ -259,7 +259,7 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
intent.putExtras(b); intent.putExtras(b);
context.startActivity(intent); context.startActivity(intent);
} else if (itemId == R.id.action_report) { } 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(); LayoutInflater inflater1 = ((Activity) context).getLayoutInflater();
View dialogView = inflater1.inflate(R.layout.popup_report_peertube, new LinearLayout(context), false); View dialogView = inflater1.inflate(R.layout.popup_report_peertube, new LinearLayout(context), false);
dialogBuilder.setView(dialogView); dialogBuilder.setView(dialogView);
@ -323,7 +323,7 @@ public class PeertubeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
return; return;
} }
if (apiResponse.getPlaylists() != null && apiResponse.getPlaylists().size() > 0) { 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); builder.setTitle(R.string.modify_playlists);
List<PlaylistData.Playlist> ownerPlaylists = apiResponse.getPlaylists(); List<PlaylistData.Playlist> ownerPlaylists = apiResponse.getPlaylists();

View file

@ -15,7 +15,7 @@ package app.fedilab.android.peertube.drawer;
* see <http://www.gnu.org/licenses>. */ * see <http://www.gnu.org/licenses>. */
import static app.fedilab.android.mastodon.helper.Helper.dialogStyle;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
@ -105,7 +105,7 @@ public class PlaylistAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
popup.setOnMenuItemClickListener(item -> { popup.setOnMenuItemClickListener(item -> {
int itemId = item.getItemId(); int itemId = item.getItemId();
if (itemId == R.id.action_delete) { 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.setTitle(context.getString(R.string.action_lists_delete) + ": " + playlist.getDisplayName());
builder.setMessage(context.getString(R.string.action_lists_confirm_delete)); builder.setMessage(context.getString(R.string.action_lists_confirm_delete));
builder.setIcon(android.R.drawable.ic_dialog_alert) builder.setIcon(android.R.drawable.ic_dialog_alert)

View file

@ -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, * You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */ * 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 static app.fedilab.android.peertube.activities.PeertubeUploadActivity.MY_PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE;
import android.Manifest; import android.Manifest;
@ -230,7 +230,7 @@ public class DisplayChannelsFragment extends Fragment implements ChannelListAdap
public void manageAlert(ChannelParams oldChannelValues) { 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); bindingDialog = AddChannelPeertubeBinding.inflate(LayoutInflater.from(context), null, false);
dialogBuilder.setView(bindingDialog.getRoot()); dialogBuilder.setView(bindingDialog.getRoot());

View file

@ -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, * You should have received a copy of the GNU General Public License along with Fedilab; if not,
* see <http://www.gnu.org/licenses>. */ * 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.client.RetrofitPeertubeAPI.DataType.MY_CHANNELS;
import static app.fedilab.android.peertube.helper.Helper.peertubeInformation; import static app.fedilab.android.peertube.helper.Helper.peertubeInformation;
@ -103,7 +103,7 @@ public class DisplayPlaylistsFragment extends Fragment {
} }
binding.addNew.setOnClickListener(view -> { binding.addNew.setOnClickListener(view -> {
AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(requireActivity(), dialogStyle()); AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(requireActivity());
bindingAlert = AddPlaylistPeertubeBinding.inflate(getLayoutInflater()); bindingAlert = AddPlaylistPeertubeBinding.inflate(getLayoutInflater());
dialogBuilder.setView(bindingAlert.getRoot()); dialogBuilder.setView(bindingAlert.getRoot());

View file

@ -108,7 +108,7 @@ public class FragmentLoginPickInstancePeertube extends Fragment implements Insta
itemsKeyLanguage = new String[languages.size()]; itemsKeyLanguage = new String[languages.size()];
binding.pickupLanguages.setOnClickListener(v -> { 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; int i = 0;
if (languages.size() > 0) { if (languages.size() > 0) {
@ -175,7 +175,7 @@ public class FragmentLoginPickInstancePeertube extends Fragment implements Insta
binding.pickupCategories.setOnClickListener(v -> { 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; int i = 0;
if (categories.size() > 0) { if (categories.size() > 0) {
Iterator<Map.Entry<Integer, String>> it = categories.entrySet().iterator(); Iterator<Map.Entry<Integer, String>> it = categories.entrySet().iterator();

View file

@ -172,7 +172,7 @@ public class PeertubeRegisterFragment extends Fragment {
return; return;
} }
AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(requireContext(), app.fedilab.android.mastodon.helper.Helper.dialogStyle()); AlertDialog.Builder dialogBuilder = new MaterialAlertDialogBuilder(requireContext());
dialogBuilder.setCancelable(false); dialogBuilder.setCancelable(false);
dialogBuilder.setPositiveButton(R.string.validate, (dialog, which) -> { dialogBuilder.setPositiveButton(R.string.validate, (dialog, which) -> {
dialog.dismiss(); dialog.dismiss();

View file

@ -329,18 +329,6 @@ public class SettingsFragment extends PreferenceFragmentCompat implements Shared
//****** App theme ******* //****** App theme *******
final SharedPreferences sharedpref = PreferenceManager.getDefaultSharedPreferences(requireActivity()); 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 ******* //****** Video mode *******

View file

@ -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_INSTANCE;
import static app.fedilab.android.mastodon.helper.Helper.PREF_USER_SOFTWARE; 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.PREF_USER_TOKEN;
import static app.fedilab.android.mastodon.helper.Helper.dialogStyle;
import static app.fedilab.android.peertube.activities.PeertubeMainActivity.typeOfConnection; import static app.fedilab.android.peertube.activities.PeertubeMainActivity.typeOfConnection;
import android.Manifest; import android.Manifest;
@ -555,7 +554,7 @@ public class Helper {
* @param url String download url * @param url String download url
*/ */
public static void manageDownloads(final Context context, final String 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; final DownloadManager.Request request;
try { try {
request = new DownloadManager.Request(Uri.parse(url.trim())); request = new DownloadManager.Request(Uri.parse(url.trim()));
@ -590,7 +589,7 @@ public class Helper {
* @param currentAccount BaseAccount * @param currentAccount BaseAccount
*/ */
public static void logoutCurrentUser(Activity activity, BaseAccount currentAccount) { 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); alt_bld.setTitle(R.string.action_logout);
if (currentAccount.mastodon_account != null && currentAccount.mastodon_account.username != null && currentAccount.instance != null) { 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)); alt_bld.setMessage(activity.getString(R.string.logout_account_confirmation, currentAccount.mastodon_account.username, currentAccount.instance));

View file

@ -49,7 +49,7 @@ public class SwitchAccountHelper {
e.printStackTrace(); 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)); builderSingle.setTitle(activity.getString(R.string.list_of_accounts));
if (accounts != null) { if (accounts != null) {
final OwnAccountsAdapter accountsListAdapter = new OwnAccountsAdapter(activity, accounts); final OwnAccountsAdapter accountsListAdapter = new OwnAccountsAdapter(activity, accounts);