From 2d83545865e97a6d6f55776978fc7ea7a9a9aae2 Mon Sep 17 00:00:00 2001 From: Balazs Toldi Date: Thu, 24 Aug 2023 20:09:52 +0200 Subject: [PATCH] Fix theming on multiple elements Fixed theming on: - Post content on PostImage and PostLink activities - Report content forms Closes #163 --- .../infinityforlemmy/activities/PostImageActivity.java | 6 ++++++ .../infinityforlemmy/activities/PostLinkActivity.java | 3 +++ .../CommentMoreBottomSheetFragment.java | 6 ++++++ .../fragments/ViewPostDetailFragment.java | 10 +++++----- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostImageActivity.java b/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostImageActivity.java index 5137cd52..b373c595 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostImageActivity.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostImageActivity.java @@ -475,6 +475,8 @@ public class PostImageActivity extends BaseActivity implements FlairBottomSheetF nsfwTextView.setTextColor(primaryTextColor); titleEditText.setTextColor(primaryTextColor); titleEditText.setHintTextColor(secondaryTextColor); + contentEditText.setTextColor(primaryTextColor); + contentEditText.setHintTextColor(secondaryTextColor); boolean circleFab = mSharedPreferences.getBoolean(SharedPreferencesUtils.USE_CIRCULAR_FAB, false); applyFABTheme(captureFab, circleFab); applyFABTheme(selectFromLibraryFab, circleFab); @@ -487,6 +489,10 @@ public class PostImageActivity extends BaseActivity implements FlairBottomSheetF titleEditText.setTypeface(typeface); selectAgainTextView.setTypeface(typeface); } + + if (contentTypeface != null) { + contentEditText.setTypeface(contentTypeface); + } } private void loadImage() { diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostLinkActivity.java b/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostLinkActivity.java index 1bbc2153..c50efa9d 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostLinkActivity.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/activities/PostLinkActivity.java @@ -458,6 +458,8 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr titleEditText.setHintTextColor(secondaryTextColor); suggestTitleButton.setBackgroundColor(mCustomThemeWrapper.getColorPrimaryLightTheme()); suggestTitleButton.setTextColor(mCustomThemeWrapper.getButtonTextColor()); + contentEditText.setTextColor(primaryTextColor); + contentEditText.setHintTextColor(secondaryTextColor); linkEditText.setTextColor(primaryTextColor); linkEditText.setHintTextColor(secondaryTextColor); if (typeface != null) { @@ -470,6 +472,7 @@ public class PostLinkActivity extends BaseActivity implements FlairBottomSheetFr } if (contentTypeface != null) { linkEditText.setTypeface(contentTypeface); + contentEditText.setTypeface(contentTypeface); } } diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/bottomsheetfragments/CommentMoreBottomSheetFragment.java b/app/src/main/java/eu/toldi/infinityforlemmy/bottomsheetfragments/CommentMoreBottomSheetFragment.java index 3fc38902..c79a552f 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/bottomsheetfragments/CommentMoreBottomSheetFragment.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/bottomsheetfragments/CommentMoreBottomSheetFragment.java @@ -211,6 +211,12 @@ public class CommentMoreBottomSheetFragment extends LandscapeExpandedRoundedBott LayoutInflater dialog_inflater = LayoutInflater.from(activity); View dialog_view = dialog_inflater.inflate(R.layout.dialog_report, null); EditText reasonEditText = dialog_view.findViewById(R.id.reasonEditText); + reasonEditText.setTextColor(mCustomThemeWrapper.getPrimaryTextColor()); + reasonEditText.setHintTextColor(mCustomThemeWrapper.getSecondaryTextColor()); + if (activity.typeface != null) { + reasonEditText.setTypeface(activity.typeface); + } + reasonEditText.setHighlightColor(mCustomThemeWrapper.getColorAccent()); MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(activity) .setTitle(R.string.report_post) diff --git a/app/src/main/java/eu/toldi/infinityforlemmy/fragments/ViewPostDetailFragment.java b/app/src/main/java/eu/toldi/infinityforlemmy/fragments/ViewPostDetailFragment.java index a91e49bc..063f67c7 100644 --- a/app/src/main/java/eu/toldi/infinityforlemmy/fragments/ViewPostDetailFragment.java +++ b/app/src/main/java/eu/toldi/infinityforlemmy/fragments/ViewPostDetailFragment.java @@ -1155,10 +1155,6 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic .show(); return true; } else if (itemId == R.id.action_report_view_post_detail_fragment) { - if (mAccessToken == null) { - Toast.makeText(activity, R.string.login_first, Toast.LENGTH_SHORT).show(); - return true; - } if (mAccessToken == null) { Toast.makeText(activity, R.string.login_first, Toast.LENGTH_SHORT).show(); return true; @@ -1166,7 +1162,11 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic LayoutInflater inflater = LayoutInflater.from(activity); View view = inflater.inflate(R.layout.dialog_report, null); EditText reasonEditText = view.findViewById(R.id.reasonEditText); - + reasonEditText.setTextColor(mCustomThemeWrapper.getPrimaryTextColor()); + reasonEditText.setHintTextColor(mCustomThemeWrapper.getSecondaryTextColor()); + if (activity.typeface != null) { + reasonEditText.setTypeface(activity.typeface); + } MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(activity) .setTitle(R.string.report_post) .setView(view)