aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-12-08 16:29:22 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-12-08 16:29:22 +0000
commitb38025882d7b03adb0a3acad136b90d4bafdcf0a (patch)
tree259c5a0fc76035bdb403c52e986974aa36d267da /app/src/main/java/ml
parent7cf90856d6120e20a1c39848e0e4e2cbb40f1a67 (diff)
downloadinfinity-for-reddit-b38025882d7b03adb0a3acad136b90d4bafdcf0a.tar
infinity-for-reddit-b38025882d7b03adb0a3acad136b90d4bafdcf0a.tar.gz
infinity-for-reddit-b38025882d7b03adb0a3acad136b90d4bafdcf0a.tar.bz2
infinity-for-reddit-b38025882d7b03adb0a3acad136b90d4bafdcf0a.tar.lz
infinity-for-reddit-b38025882d7b03adb0a3acad136b90d4bafdcf0a.tar.xz
infinity-for-reddit-b38025882d7b03adb0a3acad136b90d4bafdcf0a.tar.zst
infinity-for-reddit-b38025882d7b03adb0a3acad136b90d4bafdcf0a.zip
Add custom theme entries for read posts. Fix crash in ViewUserDetailActivity.
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java26
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/customtheme/CustomThemeSettingsItem.java14
2 files changed, 38 insertions, 2 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java
index d1c32368..d5fb3823 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewUserDetailActivity.java
@@ -106,8 +106,8 @@ import pl.droidsonroids.gif.GifImageView;
import retrofit2.Retrofit;
public class ViewUserDetailActivity extends BaseActivity implements SortTypeSelectionCallback,
- PostLayoutBottomSheetFragment.PostLayoutSelectionCallback, ActivityToolbarInterface,
- FABMoreOptionsBottomSheetFragment.FABOptionSelectionCallback,
+ PostTypeBottomSheetFragment.PostTypeSelectionCallback, PostLayoutBottomSheetFragment.PostLayoutSelectionCallback,
+ ActivityToolbarInterface, FABMoreOptionsBottomSheetFragment.FABOptionSelectionCallback,
RandomBottomSheetFragment.RandomOptionSelectionCallback, MarkPostAsReadInterface {
public static final String EXTRA_USER_NAME_KEY = "EUNK";
@@ -1241,6 +1241,28 @@ public class ViewUserDetailActivity extends BaseActivity implements SortTypeSele
InsertReadPost.insertReadPost(mRedditDataRoomDatabase, mAccountName, post.getId());
}
+ @Override
+ public void postTypeSelected(int postType) {
+ Intent intent;
+ switch (postType) {
+ case PostTypeBottomSheetFragment.TYPE_TEXT:
+ intent = new Intent(this, PostTextActivity.class);
+ startActivity(intent);
+ break;
+ case PostTypeBottomSheetFragment.TYPE_LINK:
+ intent = new Intent(this, PostLinkActivity.class);
+ startActivity(intent);
+ break;
+ case PostTypeBottomSheetFragment.TYPE_IMAGE:
+ intent = new Intent(this, PostImageActivity.class);
+ startActivity(intent);
+ break;
+ case PostTypeBottomSheetFragment.TYPE_VIDEO:
+ intent = new Intent(this, PostVideoActivity.class);
+ startActivity(intent);
+ }
+ }
+
private static class InsertUserDataAsyncTask extends AsyncTask<Void, Void, Void> {
private UserDao userDao;
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/customtheme/CustomThemeSettingsItem.java b/app/src/main/java/ml/docilealligator/infinityforreddit/customtheme/CustomThemeSettingsItem.java
index 56ad8718..e61d87c9 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/customtheme/CustomThemeSettingsItem.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/customtheme/CustomThemeSettingsItem.java
@@ -99,6 +99,16 @@ public class CustomThemeSettingsItem implements Parcelable {
context.getString(R.string.theme_item_post_content_color_detail),
customTheme.postContentColor));
customThemeSettingsItems.add(new CustomThemeSettingsItem(
+ context.getString(R.string.theme_item_read_post_title_color),
+ context.getString(R.string.theme_item_read_post_title_color_detail),
+ customTheme.readPostTitleColor
+ ));
+ customThemeSettingsItems.add(new CustomThemeSettingsItem(
+ context.getString(R.string.theme_item_read_post_content_color),
+ context.getString(R.string.theme_item_read_post_content_color_detail),
+ customTheme.readPostContentColor
+ ));
+ customThemeSettingsItems.add(new CustomThemeSettingsItem(
context.getString(R.string.theme_item_comment_color),
context.getString(R.string.theme_item_comment_color_detail),
customTheme.commentColor));
@@ -131,6 +141,10 @@ public class CustomThemeSettingsItem implements Parcelable {
context.getString(R.string.theme_item_card_view_background_color_detail),
customTheme.cardViewBackgroundColor));
customThemeSettingsItems.add(new CustomThemeSettingsItem(
+ context.getString(R.string.theme_item_read_post_card_view_background_color),
+ context.getString(R.string.theme_item_read_post_card_view_background_color_detail),
+ customTheme.readPostCardViewBackgroundColor));
+ customThemeSettingsItems.add(new CustomThemeSettingsItem(
context.getString(R.string.theme_item_comment_background_color),
context.getString(R.string.theme_item_comment_background_color_detail),
customTheme.commentBackgroundColor));