From 360d7a69523cd929282feb6f55c2fa291aeaa426 Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 2 Dec 2022 10:23:06 +0100 Subject: [PATCH] Fix cards with long title --- .../app/fedilab/android/BaseMainActivity.java | 6 +++--- .../android/activities/CacheActivity.java | 4 ++-- .../android/activities/ComposeActivity.java | 4 ++-- .../android/activities/DraftActivity.java | 3 ++- .../activities/EditProfileActivity.java | 4 ++-- .../android/activities/FilterActivity.java | 3 ++- .../activities/FollowedTagActivity.java | 4 ++-- .../activities/MastodonListActivity.java | 8 ++++---- .../android/activities/ProfileActivity.java | 18 +++++++++--------- .../activities/ReorderTimelinesActivity.java | 2 +- .../android/activities/WebviewActivity.java | 2 +- .../activities/admin/AdminActionActivity.java | 4 ++-- .../admin/AdminDomainBlockActivity.java | 2 +- .../android/helper/CrossActionHelper.java | 6 +++--- .../app/fedilab/android/helper/Helper.java | 2 +- .../fedilab/android/helper/MastodonHelper.java | 2 +- .../app/fedilab/android/helper/PushHelper.java | 4 ++-- .../android/helper/SpannableHelper.java | 2 +- .../android/ui/drawer/AccountAdapter.java | 2 +- .../android/ui/drawer/AnnouncementAdapter.java | 2 +- .../android/ui/drawer/ComposeAdapter.java | 10 +++++----- .../android/ui/drawer/DomainBlockAdapter.java | 3 ++- .../android/ui/drawer/FilterAdapter.java | 3 ++- .../android/ui/drawer/ReorderTabAdapter.java | 3 ++- .../android/ui/drawer/StatusAdapter.java | 18 +++++++++--------- .../android/ui/drawer/StatusDraftAdapter.java | 2 +- .../ui/drawer/StatusScheduledAdapter.java | 2 +- app/src/main/res/layout/drawer_status.xml | 1 + 28 files changed, 66 insertions(+), 60 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/BaseMainActivity.java b/app/src/main/java/app/fedilab/android/BaseMainActivity.java index b9baf8062..e4f38875c 100644 --- a/app/src/main/java/app/fedilab/android/BaseMainActivity.java +++ b/app/src/main/java/app/fedilab/android/BaseMainActivity.java @@ -527,7 +527,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt popup.setOnMenuItemClickListener(item -> { int itemId = item.getItemId(); if (itemId == R.id.action_logout_account) { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(BaseMainActivity.this); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(BaseMainActivity.this, Helper.dialogStyle()); alt_bld.setTitle(R.string.action_logout); if (currentAccount.mastodon_account != null && currentAccount.mastodon_account.username != null && currentAccount.instance != null) { alt_bld.setMessage(getString(R.string.logout_account_confirmation, currentAccount.mastodon_account.username, currentAccount.instance)); @@ -1174,7 +1174,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt itemShowReplies.setChecked(show_replies); editor.apply(); } else if (itemId == R.id.action_filter) { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(BaseMainActivity.this); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(BaseMainActivity.this, Helper.dialogStyle()); LayoutInflater inflater = getLayoutInflater(); View dialogView = inflater.inflate(R.layout.popup_filter_regex, new LinearLayout(BaseMainActivity.this), false); dialogBuilder.setView(dialogView); @@ -1495,7 +1495,7 @@ public abstract class BaseMainActivity extends BaseActivity implements NetworkSt @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.action_logout) { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(BaseMainActivity.this); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(BaseMainActivity.this, Helper.dialogStyle()); alt_bld.setTitle(R.string.action_logout); alt_bld.setMessage(getString(R.string.logout_account_confirmation, account.mastodon_account.username, account.instance)); alt_bld.setPositiveButton(R.string.action_logout, (dialog, id) -> { diff --git a/app/src/main/java/app/fedilab/android/activities/CacheActivity.java b/app/src/main/java/app/fedilab/android/activities/CacheActivity.java index c7541f01c..d7a888b2f 100644 --- a/app/src/main/java/app/fedilab/android/activities/CacheActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/CacheActivity.java @@ -119,7 +119,7 @@ public class CacheActivity extends BaseBarActivity { finish(); return true; } else if (item.getItemId() == R.id.action_clear) { - AlertDialog.Builder deleteConfirm = new AlertDialog.Builder(CacheActivity.this); + AlertDialog.Builder deleteConfirm = new AlertDialog.Builder(CacheActivity.this, Helper.dialogStyle()); deleteConfirm.setTitle(getString(R.string.delete_cache)); deleteConfirm.setMessage(getString(R.string.delete_cache_message)); deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); @@ -129,7 +129,7 @@ public class CacheActivity extends BaseBarActivity { size = size / 1000000.0f; } binding.fileCacheSize.setText(String.format("%s %s", String.format(Locale.getDefault(), "%.2f", size), getString(R.string.cache_units))); - AlertDialog.Builder restartBuilder = new AlertDialog.Builder(CacheActivity.this); + AlertDialog.Builder restartBuilder = new AlertDialog.Builder(CacheActivity.this, Helper.dialogStyle()); restartBuilder.setMessage(getString(R.string.restart_the_app)); restartBuilder.setNegativeButton(R.string.no, (dialogRestart, whichRestart) -> { recreate(); diff --git a/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java b/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java index 276a26f8e..c9cedf5b8 100644 --- a/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ComposeActivity.java @@ -214,7 +214,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana } if (canBeSent(statusDraft)) { if (promptSaveDraft) { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(ComposeActivity.this); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(ComposeActivity.this, Helper.dialogStyle()); alt_bld.setMessage(R.string.save_draft); alt_bld.setPositiveButton(R.string.save, (dialog, id) -> { dialog.dismiss(); @@ -315,7 +315,7 @@ public class ComposeActivity extends BaseActivity implements ComposeAdapter.Mana } else if (item.getItemId() == R.id.action_photo_camera) { photoFileUri = MediaHelper.dispatchTakePictureIntent(ComposeActivity.this); } else if (item.getItemId() == R.id.action_contacts) { - AlertDialog.Builder builderSingle = new AlertDialog.Builder(ComposeActivity.this); + AlertDialog.Builder builderSingle = new AlertDialog.Builder(ComposeActivity.this, Helper.dialogStyle()); builderSingle.setTitle(getString(R.string.select_accounts)); PopupContactBinding popupContactBinding = PopupContactBinding.inflate(getLayoutInflater(), new LinearLayout(ComposeActivity.this), false); diff --git a/app/src/main/java/app/fedilab/android/activities/DraftActivity.java b/app/src/main/java/app/fedilab/android/activities/DraftActivity.java index ed41a6e1e..aab1cb247 100644 --- a/app/src/main/java/app/fedilab/android/activities/DraftActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/DraftActivity.java @@ -43,6 +43,7 @@ import app.fedilab.android.client.entities.api.Status; import app.fedilab.android.client.entities.app.StatusDraft; import app.fedilab.android.databinding.ActivityDraftsBinding; import app.fedilab.android.exception.DBException; +import app.fedilab.android.helper.Helper; import app.fedilab.android.ui.drawer.StatusDraftAdapter; import app.fedilab.android.viewmodel.mastodon.TimelinesVM; @@ -97,7 +98,7 @@ public class DraftActivity extends BaseActivity implements StatusDraftAdapter.Dr finish(); return true; } else if (item.getItemId() == R.id.action_delete) { - AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(DraftActivity.this); + AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(DraftActivity.this, Helper.dialogStyle()); unfollowConfirm.setTitle(getString(R.string.delete_all)); unfollowConfirm.setMessage(getString(R.string.remove_draft)); unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); diff --git a/app/src/main/java/app/fedilab/android/activities/EditProfileActivity.java b/app/src/main/java/app/fedilab/android/activities/EditProfileActivity.java index 9d1a85aae..14455324e 100644 --- a/app/src/main/java/app/fedilab/android/activities/EditProfileActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/EditProfileActivity.java @@ -135,7 +135,7 @@ public class EditProfileActivity extends BaseBarActivity { value = Html.fromHtml(field.value).toString(); fieldItemBinding.value.setText(value); fieldItemBinding.remove.setOnClickListener(v -> { - AlertDialog.Builder deleteConfirm = new AlertDialog.Builder(EditProfileActivity.this); + AlertDialog.Builder deleteConfirm = new AlertDialog.Builder(EditProfileActivity.this, Helper.dialogStyle()); deleteConfirm.setTitle(getString(R.string.delete_field)); deleteConfirm.setMessage(getString(R.string.delete_field_confirm)); deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); @@ -157,7 +157,7 @@ public class EditProfileActivity extends BaseBarActivity { binding.addField.setOnClickListener(view -> { AccountFieldItemBinding fieldItemBinding = AccountFieldItemBinding.inflate(getLayoutInflater()); fieldItemBinding.remove.setOnClickListener(v -> { - AlertDialog.Builder deleteConfirm = new AlertDialog.Builder(EditProfileActivity.this); + AlertDialog.Builder deleteConfirm = new AlertDialog.Builder(EditProfileActivity.this, Helper.dialogStyle()); deleteConfirm.setTitle(getString(R.string.delete_field)); deleteConfirm.setMessage(getString(R.string.delete_field_confirm)); deleteConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); diff --git a/app/src/main/java/app/fedilab/android/activities/FilterActivity.java b/app/src/main/java/app/fedilab/android/activities/FilterActivity.java index 31f539987..2f19ff671 100644 --- a/app/src/main/java/app/fedilab/android/activities/FilterActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/FilterActivity.java @@ -41,6 +41,7 @@ import app.fedilab.android.R; import app.fedilab.android.client.entities.api.Filter; import app.fedilab.android.databinding.ActivityFiltersBinding; import app.fedilab.android.databinding.PopupAddFilterBinding; +import app.fedilab.android.helper.Helper; import app.fedilab.android.ui.drawer.FilterAdapter; import app.fedilab.android.ui.drawer.KeywordAdapter; import app.fedilab.android.viewmodel.mastodon.FiltersVM; @@ -59,7 +60,7 @@ public class FilterActivity extends BaseBarActivity implements FilterAdapter.Del * @param listener - {@link FilterAdapter.FilterAction} */ public static void addEditFilter(Context context, Filter filter, FilterAdapter.FilterAction listener) { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context, Helper.dialogStyle()); PopupAddFilterBinding popupAddFilterBinding = PopupAddFilterBinding.inflate(LayoutInflater.from(context)); FiltersVM filtersVM = new ViewModelProvider((ViewModelStoreOwner) context).get(FiltersVM.class); dialogBuilder.setView(popupAddFilterBinding.getRoot()); diff --git a/app/src/main/java/app/fedilab/android/activities/FollowedTagActivity.java b/app/src/main/java/app/fedilab/android/activities/FollowedTagActivity.java index 0eca77f4e..8dbd904d8 100644 --- a/app/src/main/java/app/fedilab/android/activities/FollowedTagActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/FollowedTagActivity.java @@ -88,7 +88,7 @@ public class FollowedTagActivity extends BaseBarActivity implements FollowedTagA onBackPressed(); return true; } else if (item.getItemId() == R.id.action_unfollow && tag != null) { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(FollowedTagActivity.this); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(FollowedTagActivity.this, Helper.dialogStyle()); alt_bld.setTitle(R.string.action_unfollow_tag); alt_bld.setMessage(R.string.action_unfollow_tag_confirm); alt_bld.setPositiveButton(R.string.unfollow, (dialog, id) -> { @@ -120,7 +120,7 @@ public class FollowedTagActivity extends BaseBarActivity implements FollowedTagA AlertDialog alert = alt_bld.create(); alert.show(); } else if (item.getItemId() == R.id.action_follow_tag) { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(FollowedTagActivity.this); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(FollowedTagActivity.this, Helper.dialogStyle()); PopupAddFollowedTagtBinding popupAddFollowedTagtBinding = PopupAddFollowedTagtBinding.inflate(getLayoutInflater()); dialogBuilder.setView(popupAddFollowedTagtBinding.getRoot()); popupAddFollowedTagtBinding.addTag.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)}); diff --git a/app/src/main/java/app/fedilab/android/activities/MastodonListActivity.java b/app/src/main/java/app/fedilab/android/activities/MastodonListActivity.java index dd1948481..0d4516522 100644 --- a/app/src/main/java/app/fedilab/android/activities/MastodonListActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/MastodonListActivity.java @@ -144,7 +144,7 @@ public class MastodonListActivity extends BaseBarActivity implements MastodonLis onBackPressed(); return true; } else if (item.getItemId() == R.id.action_manage_users) { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MastodonListActivity.this); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MastodonListActivity.this, Helper.dialogStyle()); PopupManageAccountsListBinding popupManageAccountsListBinding = PopupManageAccountsListBinding.inflate(getLayoutInflater()); dialogBuilder.setView(popupManageAccountsListBinding.getRoot()); popupManageAccountsListBinding.loader.setVisibility(View.VISIBLE); @@ -241,7 +241,7 @@ public class MastodonListActivity extends BaseBarActivity implements MastodonLis dialogBuilder.setPositiveButton(R.string.close, (dialog, id) -> dialog.dismiss()); dialogBuilder.create().show(); } else if (item.getItemId() == R.id.action_delete && mastodonList != null) { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(MastodonListActivity.this); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(MastodonListActivity.this, Helper.dialogStyle()); alt_bld.setTitle(R.string.action_lists_delete); alt_bld.setMessage(R.string.action_lists_confirm_delete); alt_bld.setPositiveButton(R.string.delete, (dialog, id) -> { @@ -279,7 +279,7 @@ public class MastodonListActivity extends BaseBarActivity implements MastodonLis AlertDialog alert = alt_bld.create(); alert.show(); } else if (item.getItemId() == R.id.action_add_list) { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MastodonListActivity.this); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MastodonListActivity.this, Helper.dialogStyle()); PopupAddListBinding popupAddListBinding = PopupAddListBinding.inflate(getLayoutInflater()); dialogBuilder.setView(popupAddListBinding.getRoot()); popupAddListBinding.addList.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)}); @@ -319,7 +319,7 @@ public class MastodonListActivity extends BaseBarActivity implements MastodonLis dialogBuilder.setNegativeButton(R.string.cancel, (dialog, id) -> dialog.dismiss()); dialogBuilder.create().show(); } else if (item.getItemId() == R.id.action_edit) { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MastodonListActivity.this); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(MastodonListActivity.this, Helper.dialogStyle()); PopupAddListBinding popupAddListBinding = PopupAddListBinding.inflate(getLayoutInflater()); dialogBuilder.setView(popupAddListBinding.getRoot()); popupAddListBinding.addList.setFilters(new InputFilter[]{new InputFilter.LengthFilter(255)}); diff --git a/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java b/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java index 28ac84b0d..c2f8ea6f6 100644 --- a/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ProfileActivity.java @@ -422,7 +422,7 @@ public class ProfileActivity extends BaseActivity { } else if (doAction == action.UNFOLLOW) { boolean confirm_unfollow = sharedpreferences.getBoolean(getString(R.string.SET_UNFOLLOW_VALIDATION), true); if (confirm_unfollow) { - AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(ProfileActivity.this); + AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); unfollowConfirm.setTitle(getString(R.string.unfollow_confirm)); unfollowConfirm.setMessage(account.acct); unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); @@ -507,7 +507,7 @@ public class ProfileActivity extends BaseActivity { //Recyclerview for identity proof has not been inflated yet if (identityProofsRecycler == null) { identity_proofs_indicator.setOnClickListener(v -> { - AlertDialog.Builder builder = new AlertDialog.Builder(ProfileActivity.this); + AlertDialog.Builder builder = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); identityProofsRecycler = new RecyclerView(ProfileActivity.this); LinearLayoutManager mLayoutManager = new LinearLayoutManager(ProfileActivity.this); identityProofsRecycler.setLayoutManager(mLayoutManager); @@ -596,7 +596,7 @@ public class ProfileActivity extends BaseActivity { binding.personalNote.setText(relationship.note); } binding.personalNote.setOnClickListener(view -> { - AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this); + AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); builderInner.setTitle(R.string.note_for_account); EditText input = new EditText(ProfileActivity.this); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams( @@ -771,7 +771,7 @@ public class ProfileActivity extends BaseActivity { }); return true; } else if (itemId == R.id.action_filter) { - AlertDialog.Builder filterTagDialog = new AlertDialog.Builder(ProfileActivity.this); + AlertDialog.Builder filterTagDialog = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); Set featuredTagsSet = sharedpreferences.getStringSet(getString(R.string.SET_FEATURED_TAGS), null); List tags = new ArrayList<>(); if (featuredTagsSet != null) { @@ -840,7 +840,7 @@ public class ProfileActivity extends BaseActivity { } accountsVM.getListContainingAccount(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, account.id) .observe(ProfileActivity.this, mastodonListUserIs -> { - AlertDialog.Builder builderSingle = new AlertDialog.Builder(ProfileActivity.this); + AlertDialog.Builder builderSingle = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); builderSingle.setTitle(getString(R.string.action_lists_add_to)); builderSingle.setPositiveButton(R.string.close, (dialog, which) -> dialog.dismiss()); String[] listsId = new String[mastodonLists.size()]; @@ -928,7 +928,7 @@ public class ProfileActivity extends BaseActivity { }); return true; } - builderInner = new AlertDialog.Builder(ProfileActivity.this); + builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); builderInner.setTitle(stringArrayConf[0]); builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); @@ -956,7 +956,7 @@ public class ProfileActivity extends BaseActivity { }); return true; } else if (itemId == R.id.action_report) { - AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this); + AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); builderInner.setTitle(R.string.report_account); //Text for report EditText input = new EditText(ProfileActivity.this); @@ -976,7 +976,7 @@ public class ProfileActivity extends BaseActivity { builderInner.show(); return true; } else if (itemId == R.id.action_block) { - AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this); + AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); if (relationship != null) { if (relationship.blocking) { builderInner.setTitle(stringArrayConf[5]); @@ -1016,7 +1016,7 @@ public class ProfileActivity extends BaseActivity { }); builderInner.show(); } else if (itemId == R.id.action_block_instance) { - AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this); + AlertDialog.Builder builderInner = new AlertDialog.Builder(ProfileActivity.this, Helper.dialogStyle()); String domain = account.acct.split("@")[1]; builderInner.setMessage(getString(R.string.block_domain_confirm_message, domain)); builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); diff --git a/app/src/main/java/app/fedilab/android/activities/ReorderTimelinesActivity.java b/app/src/main/java/app/fedilab/android/activities/ReorderTimelinesActivity.java index 05787f285..b728fb841 100644 --- a/app/src/main/java/app/fedilab/android/activities/ReorderTimelinesActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/ReorderTimelinesActivity.java @@ -170,7 +170,7 @@ public class ReorderTimelinesActivity extends BaseBarActivity implements OnStart } private void addInstance() { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(ReorderTimelinesActivity.this); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(ReorderTimelinesActivity.this, Helper.dialogStyle()); PopupSearchInstanceBinding popupSearchInstanceBinding = PopupSearchInstanceBinding.inflate(getLayoutInflater()); dialogBuilder.setView(popupSearchInstanceBinding.getRoot()); TextWatcher textWatcher = autoComplete(popupSearchInstanceBinding); diff --git a/app/src/main/java/app/fedilab/android/activities/WebviewActivity.java b/app/src/main/java/app/fedilab/android/activities/WebviewActivity.java index ab216959f..495a26315 100644 --- a/app/src/main/java/app/fedilab/android/activities/WebviewActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/WebviewActivity.java @@ -190,7 +190,7 @@ public class WebviewActivity extends BaseActivity { final ArrayAdapter arrayAdapter = new ArrayAdapter<>(WebviewActivity.this, R.layout.domains_blocked); arrayAdapter.addAll(domains); - AlertDialog.Builder builder = new AlertDialog.Builder(WebviewActivity.this); + AlertDialog.Builder builder = new AlertDialog.Builder(WebviewActivity.this, Helper.dialogStyle()); builder.setTitle(R.string.list_of_blocked_domains); builder.setNegativeButton(R.string.close, (dialog, which) -> dialog.dismiss()); diff --git a/app/src/main/java/app/fedilab/android/activities/admin/AdminActionActivity.java b/app/src/main/java/app/fedilab/android/activities/admin/AdminActionActivity.java index 1b4799840..2686624ab 100644 --- a/app/src/main/java/app/fedilab/android/activities/admin/AdminActionActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/admin/AdminActionActivity.java @@ -164,7 +164,7 @@ public class AdminActionActivity extends BaseBarActivity { return true; } else if (item.getItemId() == R.id.action_filter) { if (getTitle().toString().equalsIgnoreCase(getString(R.string.accounts))) { - AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdminActionActivity.this); + AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdminActionActivity.this, Helper.dialogStyle()); PopupAdminFilterAccountsBinding binding = PopupAdminFilterAccountsBinding.inflate(getLayoutInflater()); alertDialogBuilder.setView(binding.getRoot()); if (local != null && remote == null) { @@ -258,7 +258,7 @@ public class AdminActionActivity extends BaseBarActivity { AlertDialog alert = alertDialogBuilder.create(); alert.show(); } else { - AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdminActionActivity.this); + AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdminActionActivity.this, Helper.dialogStyle()); PopupAdminFilterReportsBinding binding = PopupAdminFilterReportsBinding.inflate(getLayoutInflater()); alertDialogBuilder.setView(binding.getRoot()); if (resolved == null) { diff --git a/app/src/main/java/app/fedilab/android/activities/admin/AdminDomainBlockActivity.java b/app/src/main/java/app/fedilab/android/activities/admin/AdminDomainBlockActivity.java index 038c27a03..1f5d3afbf 100644 --- a/app/src/main/java/app/fedilab/android/activities/admin/AdminDomainBlockActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/admin/AdminDomainBlockActivity.java @@ -129,7 +129,7 @@ public class AdminDomainBlockActivity extends BaseBarActivity { return true; } else if (itemId == R.id.action_delete) { if (adminDomainBlock.id != null) { - AlertDialog.Builder builder = new AlertDialog.Builder(AdminDomainBlockActivity.this); + AlertDialog.Builder builder = new AlertDialog.Builder(AdminDomainBlockActivity.this, Helper.dialogStyle()); builder.setMessage(getString(R.string.unblock_domain_confirm, adminDomainBlock.domain)); builder .setPositiveButton(R.string.unblock_domain, (dialog, which) -> { diff --git a/app/src/main/java/app/fedilab/android/helper/CrossActionHelper.java b/app/src/main/java/app/fedilab/android/helper/CrossActionHelper.java index cb63be28e..40e621179 100644 --- a/app/src/main/java/app/fedilab/android/helper/CrossActionHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/CrossActionHelper.java @@ -81,7 +81,7 @@ public class CrossActionHelper { } Handler mainHandler = new Handler(Looper.getMainLooper()); Runnable myRunnable = () -> { - AlertDialog.Builder builderSingle = new AlertDialog.Builder(context); + AlertDialog.Builder builderSingle = new AlertDialog.Builder(context, Helper.dialogStyle()); builderSingle.setTitle(context.getString(R.string.choose_accounts)); final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList); final BaseAccount[] accountArray = new BaseAccount[accounts.size()]; @@ -96,7 +96,7 @@ public class CrossActionHelper { boolean confirmBoost = sharedpreferences.getBoolean(context.getString(R.string.SET_NOTIF_VALIDATION), true); BaseAccount selectedAccount = accountArray[which]; if ((actionType == TypeOfCrossAction.REBLOG_ACTION && confirmBoost) || (actionType == TypeOfCrossAction.FAVOURITE_ACTION && confirmFav)) { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(context); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle()); if (actionType == TypeOfCrossAction.REBLOG_ACTION) { alt_bld.setMessage(context.getString(R.string.reblog_add)); } else { @@ -409,7 +409,7 @@ public class CrossActionHelper { context.startActivity(intentToot); ((BaseActivity) context).finish(); } else { - AlertDialog.Builder builderSingle = new AlertDialog.Builder(context); + AlertDialog.Builder builderSingle = new AlertDialog.Builder(context, Helper.dialogStyle()); builderSingle.setTitle(context.getString(R.string.choose_accounts)); final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList); final BaseAccount[] accountArray = new BaseAccount[accounts.size()]; diff --git a/app/src/main/java/app/fedilab/android/helper/Helper.java b/app/src/main/java/app/fedilab/android/helper/Helper.java index c46702ca9..3ad6250ef 100644 --- a/app/src/main/java/app/fedilab/android/helper/Helper.java +++ b/app/src/main/java/app/fedilab/android/helper/Helper.java @@ -474,7 +474,7 @@ public class Helper { * @param url String download url */ public static void manageDownloads(final Context context, final String url) { - final AlertDialog.Builder builder = new AlertDialog.Builder(context); + final AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle()); final DownloadManager.Request request; try { request = new DownloadManager.Request(Uri.parse(url.trim())); diff --git a/app/src/main/java/app/fedilab/android/helper/MastodonHelper.java b/app/src/main/java/app/fedilab/android/helper/MastodonHelper.java index e116bfa2c..954c38ff1 100644 --- a/app/src/main/java/app/fedilab/android/helper/MastodonHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/MastodonHelper.java @@ -357,7 +357,7 @@ public class MastodonHelper { * @param status {@link Status} */ public static void scheduleBoost(Context context, ScheduleType scheduleType, Status status, Account account, TimedMuted listener) { - AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context); + AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context, Helper.dialogStyle()); DatetimePickerBinding binding = DatetimePickerBinding.inflate(((Activity) context).getLayoutInflater()); dialogBuilder.setView(binding.getRoot()); final AlertDialog alertDialogBoost = dialogBuilder.create(); diff --git a/app/src/main/java/app/fedilab/android/helper/PushHelper.java b/app/src/main/java/app/fedilab/android/helper/PushHelper.java index 419b66875..2f32d5177 100644 --- a/app/src/main/java/app/fedilab/android/helper/PushHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/PushHelper.java @@ -57,7 +57,7 @@ public class PushHelper { Runnable myRunnable = () -> { List distributors = UnifiedPush.getDistributors(context, new ArrayList<>()); if (distributors.size() == 0) { - AlertDialog.Builder alert = new AlertDialog.Builder(context); + AlertDialog.Builder alert = new AlertDialog.Builder(context, Helper.dialogStyle()); alert.setTitle(R.string.no_distributors_found); final TextView message = new TextView(context); String link = "https://fedilab.app/wiki/features/push-notifications/"; @@ -134,7 +134,7 @@ public class PushHelper { return; } - AlertDialog.Builder alert = new AlertDialog.Builder(context); + AlertDialog.Builder alert = new AlertDialog.Builder(context, Helper.dialogStyle()); alert.setTitle(R.string.select_distributors); String[] distributorsStr = distributors.toArray(new String[0]); alert.setSingleChoiceItems(distributorsStr, -1, (dialog, item) -> { diff --git a/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java b/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java index d4bc4b51d..1987da189 100644 --- a/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java +++ b/app/src/main/java/app/fedilab/android/helper/SpannableHelper.java @@ -897,7 +897,7 @@ public class SpannableHelper { return; } } - AlertDialog.Builder builder = new AlertDialog.Builder(context); + AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle()); builder.setMessage(context.getString(R.string.mute_tag, tag)); builder .setPositiveButton(R.string.yes, (dialog, which) -> { diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/AccountAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/AccountAdapter.java index 4feaa4aa8..7fdfb581c 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/AccountAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/AccountAdapter.java @@ -200,7 +200,7 @@ public class AccountAdapter extends RecyclerView.Adapter dialog.dismiss()); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/AnnouncementAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/AnnouncementAdapter.java index 218f3a86c..43f7a8973 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/AnnouncementAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/AnnouncementAdapter.java @@ -147,7 +147,7 @@ public class AnnouncementAdapter extends RecyclerView.Adapter { - final AlertDialog.Builder builder = new AlertDialog.Builder(context); + final AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle()); int paddingPixel = 15; float density = context.getResources().getDisplayMetrics().density; int paddingDp = (int) (paddingPixel * density); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java index 36cb47dc9..c95bffe71 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java @@ -952,7 +952,7 @@ public class ComposeAdapter extends RecyclerView.Adapter { - AlertDialog.Builder builderInner = new AlertDialog.Builder(context); + AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle()); builderInner.setTitle(R.string.upload_form_description); PopupMediaDescriptionBinding popupMediaDescriptionBinding = PopupMediaDescriptionBinding.inflate(LayoutInflater.from(context), null, false); builderInner.setView(popupMediaDescriptionBinding.getRoot()); @@ -1009,7 +1009,7 @@ public class ComposeAdapter extends RecyclerView.Adapter { - AlertDialog.Builder builderInner = new AlertDialog.Builder(context); + AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle()); builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); builderInner.setPositiveButton(R.string.delete, (dialog, which) -> { attachmentList.remove(attachment); @@ -1420,7 +1420,7 @@ public class ComposeAdapter extends RecyclerView.Adapter { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(context); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle()); alt_bld.setMessage(context.getString(R.string.unblock_domain_confirm, domain)); alt_bld.setPositiveButton(R.string.yes, (dialog, id) -> { accountsVM.removeDomainBlocks(MainActivity.currentInstance, MainActivity.currentToken, domain); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/FilterAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/FilterAdapter.java index 6bed3b338..954369d44 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/FilterAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/FilterAdapter.java @@ -32,6 +32,7 @@ import app.fedilab.android.R; import app.fedilab.android.activities.FilterActivity; import app.fedilab.android.client.entities.api.Filter; import app.fedilab.android.databinding.DrawerFilterBinding; +import app.fedilab.android.helper.Helper; import app.fedilab.android.viewmodel.mastodon.FiltersVM; @@ -87,7 +88,7 @@ public class FilterAdapter extends RecyclerView.Adapter { - AlertDialog.Builder builder = new AlertDialog.Builder(context); + AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle()); builder.setTitle(R.string.action_filter_delete); builder.setMessage(R.string.action_lists_confirm_delete); builder.setIcon(android.R.drawable.ic_dialog_alert) diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/ReorderTabAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/ReorderTabAdapter.java index bef12491f..e85afc093 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/ReorderTabAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/ReorderTabAdapter.java @@ -39,6 +39,7 @@ import app.fedilab.android.client.entities.app.PinnedTimeline; import app.fedilab.android.client.entities.app.Timeline; import app.fedilab.android.databinding.DrawerReorderBinding; import app.fedilab.android.exception.DBException; +import app.fedilab.android.helper.Helper; import app.fedilab.android.helper.itemtouchhelper.ItemTouchHelperAdapter; import app.fedilab.android.helper.itemtouchhelper.ItemTouchHelperViewHolder; import app.fedilab.android.helper.itemtouchhelper.OnStartDragListener; @@ -169,7 +170,7 @@ public class ReorderTabAdapter extends RecyclerView.Adapter { if (item.type == Timeline.TimeLineEnum.TAG || item.type == Timeline.TimeLineEnum.REMOTE || item.type == Timeline.TimeLineEnum.LIST) { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(context); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle()); String title = ""; String message = ""; alt_bld.setTitle(R.string.action_lists_delete); diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java index 66d4c107d..6a4b1a219 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java @@ -436,7 +436,7 @@ public class StatusAdapter extends RecyclerView.Adapter }); holder.binding.statusAddCustomEmoji.setOnClickListener(v -> { - final AlertDialog.Builder builder = new AlertDialog.Builder(context); + final AlertDialog.Builder builder = new AlertDialog.Builder(context, Helper.dialogStyle()); int paddingPixel = 15; float density = context.getResources().getDisplayMetrics().density; int paddingDp = (int) (paddingPixel * density); @@ -711,7 +711,7 @@ public class StatusAdapter extends RecyclerView.Adapter }); holder.binding.actionButtonBoost.setOnClickListener(v -> { if (confirmBoost) { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(context); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle()); if (statusToDeal.reblogged) { alt_bld.setMessage(context.getString(R.string.reblog_remove)); } else { @@ -781,7 +781,7 @@ public class StatusAdapter extends RecyclerView.Adapter }); holder.binding.actionButtonFavorite.setOnClickListener(v -> { if (confirmFav) { - AlertDialog.Builder alt_bld = new AlertDialog.Builder(context); + AlertDialog.Builder alt_bld = new AlertDialog.Builder(context, Helper.dialogStyle()); if (status.favourited) { alt_bld.setMessage(context.getString(R.string.favourite_remove)); } else { @@ -1663,7 +1663,7 @@ public class StatusAdapter extends RecyclerView.Adapter popup.setOnMenuItemClickListener(item -> { int itemId = item.getItemId(); if (itemId == R.id.action_redraft) { - AlertDialog.Builder builderInner = new AlertDialog.Builder(context); + AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle()); builderInner.setTitle(stringArrayConf[1]); builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); builderInner.setPositiveButton(R.string.yes, (dialog, which) -> { @@ -1719,7 +1719,7 @@ public class StatusAdapter extends RecyclerView.Adapter } else if (itemId == R.id.action_open_browser) { Helper.openBrowser(context, statusToDeal.url); } else if (itemId == R.id.action_remove) { - AlertDialog.Builder builderInner = new AlertDialog.Builder(context); + AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle()); builderInner.setTitle(stringArrayConf[0]); builderInner.setMessage(statusToDeal.content); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) @@ -1736,7 +1736,7 @@ public class StatusAdapter extends RecyclerView.Adapter })); builderInner.show(); } else if (itemId == R.id.action_block_domain) { - AlertDialog.Builder builderInner = new AlertDialog.Builder(context); + AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle()); builderInner.setTitle(stringArrayConf[3]); String domain = statusToDeal.account.acct.split("@")[1]; builderInner.setMessage(context.getString(R.string.block_domain_confirm_message, domain)); @@ -1747,7 +1747,7 @@ public class StatusAdapter extends RecyclerView.Adapter }); builderInner.show(); } else if (itemId == R.id.action_mute) { - AlertDialog.Builder builderInner = new AlertDialog.Builder(context); + AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle()); builderInner.setTitle(stringArrayConf[0]); builderInner.setMessage(statusToDeal.account.acct); builderInner.setNeutralButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); @@ -1786,7 +1786,7 @@ public class StatusAdapter extends RecyclerView.Adapter MastodonHelper.scheduleBoost(context, MastodonHelper.ScheduleType.TIMED_MUTED, statusToDeal, null, null); return true; } else if (itemId == R.id.action_block) { - AlertDialog.Builder builderInner = new AlertDialog.Builder(context); + AlertDialog.Builder builderInner = new AlertDialog.Builder(context, Helper.dialogStyle()); builderInner.setTitle(stringArrayConf[1]); builderInner.setMessage(statusToDeal.account.acct); builderInner.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); @@ -1909,7 +1909,7 @@ public class StatusAdapter extends RecyclerView.Adapter } Handler mainHandler = new Handler(Looper.getMainLooper()); Runnable myRunnable = () -> { - AlertDialog.Builder builderSingle = new AlertDialog.Builder(context); + AlertDialog.Builder builderSingle = new AlertDialog.Builder(context, Helper.dialogStyle()); builderSingle.setTitle(context.getString(R.string.choose_accounts)); final AccountsSearchAdapter accountsSearchAdapter = new AccountsSearchAdapter(context, accountList); final BaseAccount[] accountArray = new BaseAccount[accounts.size()]; diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusDraftAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusDraftAdapter.java index 1942e61cc..134030160 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusDraftAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusDraftAdapter.java @@ -95,7 +95,7 @@ public class StatusDraftAdapter extends RecyclerView.Adapter { - AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(context); + AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(context, Helper.dialogStyle()); unfollowConfirm.setMessage(context.getString(R.string.remove_draft)); unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); unfollowConfirm.setPositiveButton(R.string.delete, (dialog, which) -> { diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusScheduledAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusScheduledAdapter.java index d9cc81560..011fadbe0 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusScheduledAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusScheduledAdapter.java @@ -130,7 +130,7 @@ public class StatusScheduledAdapter extends RecyclerView.Adapter { - AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(context); + AlertDialog.Builder unfollowConfirm = new AlertDialog.Builder(context, Helper.dialogStyle()); unfollowConfirm.setMessage(context.getString(R.string.remove_scheduled)); unfollowConfirm.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss()); unfollowConfirm.setPositiveButton(R.string.delete, (dialog, which) -> { diff --git a/app/src/main/res/layout/drawer_status.xml b/app/src/main/res/layout/drawer_status.xml index aedc310fa..e57868e60 100644 --- a/app/src/main/res/layout/drawer_status.xml +++ b/app/src/main/res/layout/drawer_status.xml @@ -357,6 +357,7 @@