Upvote ratio and different username color for comments sent by the current account.

This commit is contained in:
Alex Ning 2021-02-26 16:12:14 +08:00
parent 659cfa511d
commit 6f4fc73262
18 changed files with 288 additions and 112 deletions

View File

@ -35,7 +35,7 @@ import ml.docilealligator.infinityforreddit.user.UserData;
@Database(entities = {Account.class, SubredditData.class, SubscribedSubredditData.class, UserData.class, @Database(entities = {Account.class, SubredditData.class, SubscribedSubredditData.class, UserData.class,
SubscribedUserData.class, MultiReddit.class, CustomTheme.class, RecentSearchQuery.class, SubscribedUserData.class, MultiReddit.class, CustomTheme.class, RecentSearchQuery.class,
ReadPost.class, PostFilter.class, PostFilterUsage.class}, version = 17) ReadPost.class, PostFilter.class, PostFilterUsage.class}, version = 18)
public abstract class RedditDataRoomDatabase extends RoomDatabase { public abstract class RedditDataRoomDatabase extends RoomDatabase {
private static RedditDataRoomDatabase INSTANCE; private static RedditDataRoomDatabase INSTANCE;
@ -48,7 +48,8 @@ public abstract class RedditDataRoomDatabase extends RoomDatabase {
.addMigrations(MIGRATION_1_2, MIGRATION_2_3, MIGRATION_3_4, MIGRATION_4_5, .addMigrations(MIGRATION_1_2, MIGRATION_2_3, MIGRATION_3_4, MIGRATION_4_5,
MIGRATION_5_6, MIGRATION_6_7, MIGRATION_7_8, MIGRATION_8_9, MIGRATION_5_6, MIGRATION_6_7, MIGRATION_7_8, MIGRATION_8_9,
MIGRATION_9_10, MIGRATION_10_11, MIGRATION_11_12, MIGRATION_12_13, MIGRATION_9_10, MIGRATION_10_11, MIGRATION_11_12, MIGRATION_12_13,
MIGRATION_13_14, MIGRATION_14_15, MIGRATION_15_16, MIGRATION_16_17) MIGRATION_13_14, MIGRATION_14_15, MIGRATION_15_16, MIGRATION_16_17,
MIGRATION_17_18)
.build(); .build();
} }
} }
@ -316,4 +317,12 @@ public abstract class RedditDataRoomDatabase extends RoomDatabase {
database.execSQL("UPDATE accounts SET is_current_user = 0"); database.execSQL("UPDATE accounts SET is_current_user = 0");
} }
}; };
private static final Migration MIGRATION_17_18 = new Migration(17, 18) {
@Override
public void migrate(@NonNull SupportSQLiteDatabase database) {
database.execSQL("ALTER TABLE custom_themes ADD COLUMN current_user INTEGER DEFAULT " + Color.parseColor("#A202EE") + " NOT NULL");
database.execSQL("ALTER TABLE custom_themes ADD COLUMN upvote_ratio_icon_tint INTEGER DEFAULT " + Color.parseColor("#0256EE") + " NOT NULL");
}
};
} }

View File

@ -206,6 +206,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
private int mUsernameColor; private int mUsernameColor;
private int mSubmitterColor; private int mSubmitterColor;
private int mModeratorColor; private int mModeratorColor;
private int mCurrentUserColor;
private int mAuthorFlairTextColor; private int mAuthorFlairTextColor;
private int mSpoilerBackgroundColor; private int mSpoilerBackgroundColor;
private int mSpoilerTextColor; private int mSpoilerTextColor;
@ -216,6 +217,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
private int mArchivedTintColor; private int mArchivedTintColor;
private int mLockedTintColor; private int mLockedTintColor;
private int mCrosspostTintColor; private int mCrosspostTintColor;
private int mUpvoteRatioTintColor;
private int mNoPreviewPostTypeBackgroundColor; private int mNoPreviewPostTypeBackgroundColor;
private int mNoPreviewPostTypeIconTint; private int mNoPreviewPostTypeIconTint;
private int mUpvotedColor; private int mUpvotedColor;
@ -532,6 +534,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
mPostTypeTextColor = customThemeWrapper.getPostTypeTextColor(); mPostTypeTextColor = customThemeWrapper.getPostTypeTextColor();
mSubmitterColor = customThemeWrapper.getSubmitter(); mSubmitterColor = customThemeWrapper.getSubmitter();
mModeratorColor = customThemeWrapper.getModerator(); mModeratorColor = customThemeWrapper.getModerator();
mCurrentUserColor = customThemeWrapper.getCurrentUser();
mAuthorFlairTextColor = customThemeWrapper.getAuthorFlairTextColor(); mAuthorFlairTextColor = customThemeWrapper.getAuthorFlairTextColor();
mSpoilerBackgroundColor = customThemeWrapper.getSpoilerBackgroundColor(); mSpoilerBackgroundColor = customThemeWrapper.getSpoilerBackgroundColor();
mSpoilerTextColor = customThemeWrapper.getSpoilerTextColor(); mSpoilerTextColor = customThemeWrapper.getSpoilerTextColor();
@ -540,6 +543,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
mArchivedTintColor = customThemeWrapper.getArchivedIconTint(); mArchivedTintColor = customThemeWrapper.getArchivedIconTint();
mLockedTintColor = customThemeWrapper.getLockedIconTint(); mLockedTintColor = customThemeWrapper.getLockedIconTint();
mCrosspostTintColor = customThemeWrapper.getCrosspostIconTint(); mCrosspostTintColor = customThemeWrapper.getCrosspostIconTint();
mUpvoteRatioTintColor = customThemeWrapper.getUpvoteRatioIconTint();
mNoPreviewPostTypeBackgroundColor = customThemeWrapper.getNoPreviewPostTypeBackgroundColor(); mNoPreviewPostTypeBackgroundColor = customThemeWrapper.getNoPreviewPostTypeBackgroundColor();
mNoPreviewPostTypeIconTint = customThemeWrapper.getNoPreviewPostTypeIconTint(); mNoPreviewPostTypeIconTint = customThemeWrapper.getNoPreviewPostTypeIconTint();
mFlairBackgroundColor = customThemeWrapper.getFlairBackgroundColor(); mFlairBackgroundColor = customThemeWrapper.getFlairBackgroundColor();
@ -857,6 +861,8 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
Utils.setHTMLWithImageToTextView(((PostDetailBaseViewHolder) holder).mAwardsTextView, mPost.getAwards(), true); Utils.setHTMLWithImageToTextView(((PostDetailBaseViewHolder) holder).mAwardsTextView, mPost.getAwards(), true);
} }
((PostDetailBaseViewHolder) holder).mUpvoteRatioTextView.setText(mPost.getUpvoteRatio() + "%");
if (mPost.isNSFW()) { if (mPost.isNSFW()) {
((PostDetailBaseViewHolder) holder).mNSFWTextView.setVisibility(View.VISIBLE); ((PostDetailBaseViewHolder) holder).mNSFWTextView.setVisibility(View.VISIBLE);
} else { } else {
@ -1062,6 +1068,8 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
Drawable moderatorDrawable = Utils.getTintedDrawable(mActivity, R.drawable.ic_verified_user_14dp, mModeratorColor); Drawable moderatorDrawable = Utils.getTintedDrawable(mActivity, R.drawable.ic_verified_user_14dp, mModeratorColor);
((CommentViewHolder) holder).authorTextView.setCompoundDrawablesWithIntrinsicBounds( ((CommentViewHolder) holder).authorTextView.setCompoundDrawablesWithIntrinsicBounds(
moderatorDrawable, null, null, null); moderatorDrawable, null, null, null);
} else if (comment.getAuthor().equals(mAccountName)) {
((CommentViewHolder) holder).authorTextView.setTextColor(mCurrentUserColor);
} }
if (mShowElapsedTime) { if (mShowElapsedTime) {
@ -2073,6 +2081,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
CustomTextView mSpoilerTextView; CustomTextView mSpoilerTextView;
CustomTextView mFlairTextView; CustomTextView mFlairTextView;
TextView mAwardsTextView; TextView mAwardsTextView;
TextView mUpvoteRatioTextView;
ConstraintLayout mBottomConstraintLayout; ConstraintLayout mBottomConstraintLayout;
ImageView mUpvoteButton; ImageView mUpvoteButton;
TextView mScoreTextView; TextView mScoreTextView;
@ -2086,26 +2095,27 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
} }
void setBaseView(AspectRatioGifImageView mIconGifImageView, void setBaseView(AspectRatioGifImageView mIconGifImageView,
TextView mSubredditTextView, TextView mSubredditTextView,
TextView mUserTextView, TextView mUserTextView,
TextView mAuthorFlairTextView, TextView mAuthorFlairTextView,
TextView mPostTimeTextView, TextView mPostTimeTextView,
TextView mTitleTextView, TextView mTitleTextView,
CustomTextView mTypeTextView, CustomTextView mTypeTextView,
ImageView mCrosspostImageView, ImageView mCrosspostImageView,
ImageView mArchivedImageView, ImageView mArchivedImageView,
ImageView mLockedImageView, ImageView mLockedImageView,
CustomTextView mNSFWTextView, CustomTextView mNSFWTextView,
CustomTextView mSpoilerTextView, CustomTextView mSpoilerTextView,
CustomTextView mFlairTextView, CustomTextView mFlairTextView,
TextView mAwardsTextView, TextView mAwardsTextView,
ConstraintLayout mBottomConstraintLayout, TextView mUpvoteRatioTextView,
ImageView mUpvoteButton, ConstraintLayout mBottomConstraintLayout,
TextView mScoreTextView, ImageView mUpvoteButton,
ImageView mDownvoteButton, TextView mScoreTextView,
TextView commentsCountTextView, ImageView mDownvoteButton,
ImageView mSaveButton, TextView commentsCountTextView,
ImageView mShareButton) { ImageView mSaveButton,
ImageView mShareButton) {
this.mIconGifImageView = mIconGifImageView; this.mIconGifImageView = mIconGifImageView;
this.mSubredditTextView = mSubredditTextView; this.mSubredditTextView = mSubredditTextView;
this.mUserTextView = mUserTextView; this.mUserTextView = mUserTextView;
@ -2120,6 +2130,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
this.mSpoilerTextView = mSpoilerTextView; this.mSpoilerTextView = mSpoilerTextView;
this.mFlairTextView = mFlairTextView; this.mFlairTextView = mFlairTextView;
this.mAwardsTextView = mAwardsTextView; this.mAwardsTextView = mAwardsTextView;
this.mUpvoteRatioTextView = mUpvoteRatioTextView;
this.mBottomConstraintLayout = mBottomConstraintLayout; this.mBottomConstraintLayout = mBottomConstraintLayout;
this.mUpvoteButton = mUpvoteButton; this.mUpvoteButton = mUpvoteButton;
this.mScoreTextView = mScoreTextView; this.mScoreTextView = mScoreTextView;
@ -2459,6 +2470,10 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
mLockedImageView.setColorFilter(mLockedTintColor, PorterDuff.Mode.SRC_IN); mLockedImageView.setColorFilter(mLockedTintColor, PorterDuff.Mode.SRC_IN);
mCrosspostImageView.setColorFilter(mCrosspostTintColor, PorterDuff.Mode.SRC_IN); mCrosspostImageView.setColorFilter(mCrosspostTintColor, PorterDuff.Mode.SRC_IN);
mAwardsTextView.setTextColor(mSecondaryTextColor); mAwardsTextView.setTextColor(mSecondaryTextColor);
Drawable upvoteRatioDrawable = Utils.getTintedDrawable(mActivity, R.drawable.ic_upvote_ratio, mUpvoteRatioTintColor);
mUpvoteRatioTextView.setCompoundDrawablesWithIntrinsicBounds(
upvoteRatioDrawable, null, null, null);
mUpvoteRatioTextView.setTextColor(mSecondaryTextColor);
mUpvoteButton.setColorFilter(mPostIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); mUpvoteButton.setColorFilter(mPostIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
mScoreTextView.setTextColor(mPostIconAndInfoColor); mScoreTextView.setTextColor(mPostIconAndInfoColor);
mDownvoteButton.setColorFilter(mPostIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); mDownvoteButton.setColorFilter(mPostIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
@ -2498,6 +2513,8 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
CustomTextView mFlairTextView; CustomTextView mFlairTextView;
@BindView(R.id.awards_text_view_item_post_detail_video_autoplay) @BindView(R.id.awards_text_view_item_post_detail_video_autoplay)
TextView mAwardsTextView; TextView mAwardsTextView;
@BindView(R.id.upvote_ratio_text_view_item_post_detail_video_autoplay)
TextView mUpvoteRatioTextView;
@BindView(R.id.aspect_ratio_frame_layout_item_post_detail_video_autoplay) @BindView(R.id.aspect_ratio_frame_layout_item_post_detail_video_autoplay)
AspectRatioFrameLayout aspectRatioFrameLayout; AspectRatioFrameLayout aspectRatioFrameLayout;
@BindView(R.id.player_view_item_post_detail_video_autoplay) @BindView(R.id.player_view_item_post_detail_video_autoplay)
@ -2548,6 +2565,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
mSpoilerTextView, mSpoilerTextView,
mFlairTextView, mFlairTextView,
mAwardsTextView, mAwardsTextView,
mUpvoteRatioTextView,
mBottomConstraintLayout, mBottomConstraintLayout,
mUpvoteButton, mUpvoteButton,
mScoreTextView, mScoreTextView,
@ -2741,6 +2759,8 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
CustomTextView mFlairTextView; CustomTextView mFlairTextView;
@BindView(R.id.awards_text_view_item_post_detail_video_and_gif_preview) @BindView(R.id.awards_text_view_item_post_detail_video_and_gif_preview)
TextView mAwardsTextView; TextView mAwardsTextView;
@BindView(R.id.upvote_ratio_text_view_item_post_detail_video_and_gif_preview)
TextView mUpvoteRatioTextView;
@BindView(R.id.load_wrapper_item_post_detail_video_and_gif_preview) @BindView(R.id.load_wrapper_item_post_detail_video_and_gif_preview)
RelativeLayout mLoadWrapper; RelativeLayout mLoadWrapper;
@BindView(R.id.progress_bar_item_post_detail_video_and_gif_preview) @BindView(R.id.progress_bar_item_post_detail_video_and_gif_preview)
@ -2781,6 +2801,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
mSpoilerTextView, mSpoilerTextView,
mFlairTextView, mFlairTextView,
mAwardsTextView, mAwardsTextView,
mUpvoteRatioTextView,
mBottomConstraintLayout, mBottomConstraintLayout,
mUpvoteButton, mUpvoteButton,
mScoreTextView, mScoreTextView,
@ -2852,6 +2873,8 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
CustomTextView mFlairTextView; CustomTextView mFlairTextView;
@BindView(R.id.awards_text_view_item_post_detail_image_and_gif_autoplay) @BindView(R.id.awards_text_view_item_post_detail_image_and_gif_autoplay)
TextView mAwardsTextView; TextView mAwardsTextView;
@BindView(R.id.upvote_ratio_text_view_item_post_detail_image_and_gif_autoplay)
TextView mUpvoteRatioTextView;
@BindView(R.id.image_view_wrapper_item_post_detail_image_and_gif_autoplay) @BindView(R.id.image_view_wrapper_item_post_detail_image_and_gif_autoplay)
RelativeLayout mRelativeLayout; RelativeLayout mRelativeLayout;
@BindView(R.id.load_wrapper_item_post_detail_image_and_gif_autoplay) @BindView(R.id.load_wrapper_item_post_detail_image_and_gif_autoplay)
@ -2894,6 +2917,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
mSpoilerTextView, mSpoilerTextView,
mFlairTextView, mFlairTextView,
mAwardsTextView, mAwardsTextView,
mUpvoteRatioTextView,
mBottomConstraintLayout, mBottomConstraintLayout,
mUpvoteButton, mUpvoteButton,
mScoreTextView, mScoreTextView,
@ -2956,6 +2980,8 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
CustomTextView mFlairTextView; CustomTextView mFlairTextView;
@BindView(R.id.awards_text_view_item_post_detail_link) @BindView(R.id.awards_text_view_item_post_detail_link)
TextView mAwardsTextView; TextView mAwardsTextView;
@BindView(R.id.upvote_ratio_text_view_item_post_detail_link)
TextView mUpvoteRatioTextView;
@BindView(R.id.link_text_view_item_post_detail_link) @BindView(R.id.link_text_view_item_post_detail_link)
TextView mLinkTextView; TextView mLinkTextView;
@BindView(R.id.image_view_wrapper_item_post_detail_link) @BindView(R.id.image_view_wrapper_item_post_detail_link)
@ -3000,6 +3026,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
mSpoilerTextView, mSpoilerTextView,
mFlairTextView, mFlairTextView,
mAwardsTextView, mAwardsTextView,
mUpvoteRatioTextView,
mBottomConstraintLayout, mBottomConstraintLayout,
mUpvoteButton, mUpvoteButton,
mScoreTextView, mScoreTextView,
@ -3053,6 +3080,8 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
CustomTextView mFlairTextView; CustomTextView mFlairTextView;
@BindView(R.id.awards_text_view_item_post_detail_no_preview_link) @BindView(R.id.awards_text_view_item_post_detail_no_preview_link)
TextView mAwardsTextView; TextView mAwardsTextView;
@BindView(R.id.upvote_ratio_text_view_item_post_detail_no_preview_link)
TextView mUpvoteRatioTextView;
@BindView(R.id.link_text_view_item_post_detail_no_preview_link) @BindView(R.id.link_text_view_item_post_detail_no_preview_link)
TextView mLinkTextView; TextView mLinkTextView;
@BindView(R.id.image_view_no_preview_post_type_item_post_detail_no_preview_link) @BindView(R.id.image_view_no_preview_post_type_item_post_detail_no_preview_link)
@ -3089,6 +3118,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
mSpoilerTextView, mSpoilerTextView,
mFlairTextView, mFlairTextView,
mAwardsTextView, mAwardsTextView,
mUpvoteRatioTextView,
mBottomConstraintLayout, mBottomConstraintLayout,
mUpvoteButton, mUpvoteButton,
mScoreTextView, mScoreTextView,
@ -3182,6 +3212,8 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
CustomTextView mFlairTextView; CustomTextView mFlairTextView;
@BindView(R.id.awards_text_view_item_post_detail_gallery) @BindView(R.id.awards_text_view_item_post_detail_gallery)
TextView mAwardsTextView; TextView mAwardsTextView;
@BindView(R.id.upvote_ratio_text_view_item_post_detail_gallery)
TextView mUpvoteRatioTextView;
@BindView(R.id.image_view_wrapper_item_post_detail_gallery) @BindView(R.id.image_view_wrapper_item_post_detail_gallery)
RelativeLayout mRelativeLayout; RelativeLayout mRelativeLayout;
@BindView(R.id.load_wrapper_item_post_detail_gallery) @BindView(R.id.load_wrapper_item_post_detail_gallery)
@ -3226,6 +3258,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
mSpoilerTextView, mSpoilerTextView,
mFlairTextView, mFlairTextView,
mAwardsTextView, mAwardsTextView,
mUpvoteRatioTextView,
mBottomConstraintLayout, mBottomConstraintLayout,
mUpvoteButton, mUpvoteButton,
mScoreTextView, mScoreTextView,
@ -3283,6 +3316,8 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
CustomTextView mFlairTextView; CustomTextView mFlairTextView;
@BindView(R.id.awards_text_view_item_post_detail_text) @BindView(R.id.awards_text_view_item_post_detail_text)
TextView mAwardsTextView; TextView mAwardsTextView;
@BindView(R.id.upvote_ratio_text_view_item_post_detail_text)
TextView mUpvoteRatioTextView;
@BindView(R.id.bottom_constraint_layout_item_post_detail_text) @BindView(R.id.bottom_constraint_layout_item_post_detail_text)
ConstraintLayout mBottomConstraintLayout; ConstraintLayout mBottomConstraintLayout;
@BindView(R.id.plus_button_item_post_detail_text) @BindView(R.id.plus_button_item_post_detail_text)
@ -3315,6 +3350,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
mSpoilerTextView, mSpoilerTextView,
mFlairTextView, mFlairTextView,
mAwardsTextView, mAwardsTextView,
mUpvoteRatioTextView,
mBottomConstraintLayout, mBottomConstraintLayout,
mUpvoteButton, mUpvoteButton,
mScoreTextView, mScoreTextView,

View File

@ -113,6 +113,8 @@ public class CustomTheme {
public int lockedIconTint; public int lockedIconTint;
@ColumnInfo(name = "crosspost_icon_tint") @ColumnInfo(name = "crosspost_icon_tint")
public int crosspostIconTint; public int crosspostIconTint;
@ColumnInfo(name = "upvote_ratio_icon_tint")
public int upvoteRatioIconTint;
@ColumnInfo(name = "stickied_post_icon_tint") @ColumnInfo(name = "stickied_post_icon_tint")
public int stickiedPostIconTint; public int stickiedPostIconTint;
@ColumnInfo(name = "no_preview_post_type_icon_tint") @ColumnInfo(name = "no_preview_post_type_icon_tint")
@ -131,6 +133,8 @@ public class CustomTheme {
public int submitter; public int submitter;
@ColumnInfo(name = "moderator") @ColumnInfo(name = "moderator")
public int moderator; public int moderator;
@ColumnInfo(name = "current_user")
public int currentUser;
@ColumnInfo(name = "single_comment_thread_background_color") @ColumnInfo(name = "single_comment_thread_background_color")
public int singleCommentThreadBackgroundColor; public int singleCommentThreadBackgroundColor;
@ColumnInfo(name = "unread_message_background_color") @ColumnInfo(name = "unread_message_background_color")
@ -258,31 +262,33 @@ public class CustomTheme {
customTheme.archivedTint = customThemeSettingsItems.get(55).colorValue; customTheme.archivedTint = customThemeSettingsItems.get(55).colorValue;
customTheme.lockedIconTint = customThemeSettingsItems.get(56).colorValue; customTheme.lockedIconTint = customThemeSettingsItems.get(56).colorValue;
customTheme.crosspostIconTint = customThemeSettingsItems.get(57).colorValue; customTheme.crosspostIconTint = customThemeSettingsItems.get(57).colorValue;
customTheme.stickiedPostIconTint = customThemeSettingsItems.get(58).colorValue; customTheme.upvoteRatioIconTint = customThemeSettingsItems.get(58).colorValue;
customTheme.noPreviewPostTypeIconTint = customThemeSettingsItems.get(59).colorValue; customTheme.stickiedPostIconTint = customThemeSettingsItems.get(59).colorValue;
customTheme.subscribed = customThemeSettingsItems.get(60).colorValue; customTheme.noPreviewPostTypeIconTint = customThemeSettingsItems.get(60).colorValue;
customTheme.unsubscribed = customThemeSettingsItems.get(61).colorValue; customTheme.subscribed = customThemeSettingsItems.get(61).colorValue;
customTheme.username = customThemeSettingsItems.get(62).colorValue; customTheme.unsubscribed = customThemeSettingsItems.get(62).colorValue;
customTheme.subreddit = customThemeSettingsItems.get(63).colorValue; customTheme.username = customThemeSettingsItems.get(63).colorValue;
customTheme.authorFlairTextColor = customThemeSettingsItems.get(64).colorValue; customTheme.subreddit = customThemeSettingsItems.get(64).colorValue;
customTheme.submitter = customThemeSettingsItems.get(65).colorValue; customTheme.authorFlairTextColor = customThemeSettingsItems.get(65).colorValue;
customTheme.moderator = customThemeSettingsItems.get(66).colorValue; customTheme.submitter = customThemeSettingsItems.get(66).colorValue;
customTheme.singleCommentThreadBackgroundColor = customThemeSettingsItems.get(67).colorValue; customTheme.moderator = customThemeSettingsItems.get(67).colorValue;
customTheme.unreadMessageBackgroundColor = customThemeSettingsItems.get(68).colorValue; customTheme.currentUser = customThemeSettingsItems.get(68).colorValue;
customTheme.dividerColor = customThemeSettingsItems.get(69).colorValue; customTheme.singleCommentThreadBackgroundColor = customThemeSettingsItems.get(69).colorValue;
customTheme.noPreviewPostTypeBackgroundColor = customThemeSettingsItems.get(70).colorValue; customTheme.unreadMessageBackgroundColor = customThemeSettingsItems.get(70).colorValue;
customTheme.voteAndReplyUnavailableButtonColor = customThemeSettingsItems.get(71).colorValue; customTheme.dividerColor = customThemeSettingsItems.get(71).colorValue;
customTheme.commentVerticalBarColor1 = customThemeSettingsItems.get(72).colorValue; customTheme.noPreviewPostTypeBackgroundColor = customThemeSettingsItems.get(72).colorValue;
customTheme.commentVerticalBarColor2 = customThemeSettingsItems.get(73).colorValue; customTheme.voteAndReplyUnavailableButtonColor = customThemeSettingsItems.get(73).colorValue;
customTheme.commentVerticalBarColor3 = customThemeSettingsItems.get(74).colorValue; customTheme.commentVerticalBarColor1 = customThemeSettingsItems.get(74).colorValue;
customTheme.commentVerticalBarColor4 = customThemeSettingsItems.get(75).colorValue; customTheme.commentVerticalBarColor2 = customThemeSettingsItems.get(75).colorValue;
customTheme.commentVerticalBarColor5 = customThemeSettingsItems.get(76).colorValue; customTheme.commentVerticalBarColor3 = customThemeSettingsItems.get(76).colorValue;
customTheme.commentVerticalBarColor6 = customThemeSettingsItems.get(77).colorValue; customTheme.commentVerticalBarColor4 = customThemeSettingsItems.get(77).colorValue;
customTheme.commentVerticalBarColor7 = customThemeSettingsItems.get(78).colorValue; customTheme.commentVerticalBarColor5 = customThemeSettingsItems.get(78).colorValue;
customTheme.navBarColor = customThemeSettingsItems.get(79).colorValue; customTheme.commentVerticalBarColor6 = customThemeSettingsItems.get(79).colorValue;
customTheme.isLightStatusBar = customThemeSettingsItems.get(80).isEnabled; customTheme.commentVerticalBarColor7 = customThemeSettingsItems.get(80).colorValue;
customTheme.isLightNavBar = customThemeSettingsItems.get(81).isEnabled; customTheme.navBarColor = customThemeSettingsItems.get(81).colorValue;
customTheme.isChangeStatusBarIconColorAfterToolbarCollapsedInImmersiveInterface = customThemeSettingsItems.get(82).isEnabled; customTheme.isLightStatusBar = customThemeSettingsItems.get(82).isEnabled;
customTheme.isLightNavBar = customThemeSettingsItems.get(83).isEnabled;
customTheme.isChangeStatusBarIconColorAfterToolbarCollapsedInImmersiveInterface = customThemeSettingsItems.get(84).isEnabled;
return customTheme; return customTheme;
} }

View File

@ -290,6 +290,11 @@ public class CustomThemeSettingsItem implements Parcelable {
context.getString(R.string.theme_item_crosspost_icon_tint), context.getString(R.string.theme_item_crosspost_icon_tint),
context.getString(R.string.theme_item_crosspost_icon_tint_detail), context.getString(R.string.theme_item_crosspost_icon_tint_detail),
customTheme.crosspostIconTint)); customTheme.crosspostIconTint));
customThemeSettingsItems.add(new CustomThemeSettingsItem(
context.getString(R.string.theme_item_upvote_ratio_icon_tint),
context.getString(R.string.theme_item_upvote_ratio_icon_tint_detail),
customTheme.upvoteRatioIconTint
));
customThemeSettingsItems.add(new CustomThemeSettingsItem( customThemeSettingsItems.add(new CustomThemeSettingsItem(
context.getString(R.string.theme_item_stickied_post_icon_tint), context.getString(R.string.theme_item_stickied_post_icon_tint),
context.getString(R.string.theme_item_stickied_post_icon_tint_detail), context.getString(R.string.theme_item_stickied_post_icon_tint_detail),
@ -327,6 +332,11 @@ public class CustomThemeSettingsItem implements Parcelable {
context.getString(R.string.theme_item_moderator_color), context.getString(R.string.theme_item_moderator_color),
context.getString(R.string.theme_item_moderator_color_detail), context.getString(R.string.theme_item_moderator_color_detail),
customTheme.moderator)); customTheme.moderator));
customThemeSettingsItems.add(new CustomThemeSettingsItem(
context.getString(R.string.theme_item_current_user_color),
context.getString(R.string.theme_item_current_user_color_detail),
customTheme.currentUser
));
customThemeSettingsItems.add(new CustomThemeSettingsItem( customThemeSettingsItems.add(new CustomThemeSettingsItem(
context.getString(R.string.theme_item_single_comment_thread_background_color), context.getString(R.string.theme_item_single_comment_thread_background_color),
context.getString(R.string.theme_item_single_comment_thread_background_color_detail), context.getString(R.string.theme_item_single_comment_thread_background_color_detail),

View File

@ -277,6 +277,11 @@ public class CustomThemeWrapper {
getDefaultColor("#FF4081", "#FF4081", "#FF4081")); getDefaultColor("#FF4081", "#FF4081", "#FF4081"));
} }
public int getUpvoteRatioIconTint() {
return getThemeSharedPreferences().getInt(CustomThemeSharedPreferencesUtils.UPVOTE_RATIO_ICON_TINT,
getDefaultColor("#0256EE", "#0256EE", "#0256EE"));
}
public int getStickiedPostIconTint() { public int getStickiedPostIconTint() {
return getThemeSharedPreferences().getInt(CustomThemeSharedPreferencesUtils.STICKIED_POST_ICON_TINT, return getThemeSharedPreferences().getInt(CustomThemeSharedPreferencesUtils.STICKIED_POST_ICON_TINT,
getDefaultColor("#0D47A1", "#1565C0", "#1565C0")); getDefaultColor("#0D47A1", "#1565C0", "#1565C0"));
@ -322,6 +327,11 @@ public class CustomThemeWrapper {
getDefaultColor("#00BA81", "#00BA81", "#00BA81")); getDefaultColor("#00BA81", "#00BA81", "#00BA81"));
} }
public int getCurrentUser() {
return getThemeSharedPreferences().getInt(CustomThemeSharedPreferencesUtils.CURRENT_USER,
getDefaultColor("#A202EE", "#A202EE", "#A202EE"));
}
public int getSingleCommentThreadBackgroundColor() { public int getSingleCommentThreadBackgroundColor() {
return getThemeSharedPreferences().getInt(CustomThemeSharedPreferencesUtils.SINGLE_COMMENT_THREAD_BACKGROUND_COLOR, return getThemeSharedPreferences().getInt(CustomThemeSharedPreferencesUtils.SINGLE_COMMENT_THREAD_BACKGROUND_COLOR,
getDefaultColor("#B3E5F9", "#123E77", "#123E77")); getDefaultColor("#B3E5F9", "#123E77", "#123E77"));
@ -544,6 +554,7 @@ public class CustomThemeWrapper {
customTheme.archivedTint = Color.parseColor("#B4009F"); customTheme.archivedTint = Color.parseColor("#B4009F");
customTheme.lockedIconTint = Color.parseColor("#EE7302"); customTheme.lockedIconTint = Color.parseColor("#EE7302");
customTheme.crosspostIconTint = Color.parseColor("#FF4081"); customTheme.crosspostIconTint = Color.parseColor("#FF4081");
customTheme.upvoteRatioIconTint = Color.parseColor("#0256EE");
customTheme.stickiedPostIconTint = Color.parseColor("#0D47A1"); customTheme.stickiedPostIconTint = Color.parseColor("#0D47A1");
customTheme.noPreviewPostTypeIconTint = Color.parseColor("#808080"); customTheme.noPreviewPostTypeIconTint = Color.parseColor("#808080");
customTheme.subscribed = Color.parseColor("#FF4081"); customTheme.subscribed = Color.parseColor("#FF4081");
@ -553,6 +564,7 @@ public class CustomThemeWrapper {
customTheme.authorFlairTextColor = Color.parseColor("#EE02C4"); customTheme.authorFlairTextColor = Color.parseColor("#EE02C4");
customTheme.submitter = Color.parseColor("#EE8A02"); customTheme.submitter = Color.parseColor("#EE8A02");
customTheme.moderator = Color.parseColor("#00BA81"); customTheme.moderator = Color.parseColor("#00BA81");
customTheme.currentUser = Color.parseColor("#A202EE");
customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#B3E5F9"); customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#B3E5F9");
customTheme.unreadMessageBackgroundColor = Color.parseColor("#B3E5F9"); customTheme.unreadMessageBackgroundColor = Color.parseColor("#B3E5F9");
customTheme.dividerColor = Color.parseColor("#E0E0E0"); customTheme.dividerColor = Color.parseColor("#E0E0E0");
@ -633,6 +645,7 @@ public class CustomThemeWrapper {
customTheme.archivedTint = Color.parseColor("#B4009F"); customTheme.archivedTint = Color.parseColor("#B4009F");
customTheme.lockedIconTint = Color.parseColor("#EE7302"); customTheme.lockedIconTint = Color.parseColor("#EE7302");
customTheme.crosspostIconTint = Color.parseColor("#FF4081"); customTheme.crosspostIconTint = Color.parseColor("#FF4081");
customTheme.upvoteRatioIconTint = Color.parseColor("#0256EE");
customTheme.stickiedPostIconTint = Color.parseColor("#1565C0"); customTheme.stickiedPostIconTint = Color.parseColor("#1565C0");
customTheme.noPreviewPostTypeIconTint = Color.parseColor("#808080"); customTheme.noPreviewPostTypeIconTint = Color.parseColor("#808080");
customTheme.subscribed = Color.parseColor("#FF4081"); customTheme.subscribed = Color.parseColor("#FF4081");
@ -642,6 +655,7 @@ public class CustomThemeWrapper {
customTheme.authorFlairTextColor = Color.parseColor("#EE02C4"); customTheme.authorFlairTextColor = Color.parseColor("#EE02C4");
customTheme.submitter = Color.parseColor("#EE8A02"); customTheme.submitter = Color.parseColor("#EE8A02");
customTheme.moderator = Color.parseColor("#00BA81"); customTheme.moderator = Color.parseColor("#00BA81");
customTheme.currentUser = Color.parseColor("#A202EE");
customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#123E77"); customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#123E77");
customTheme.unreadMessageBackgroundColor = Color.parseColor("#123E77"); customTheme.unreadMessageBackgroundColor = Color.parseColor("#123E77");
customTheme.dividerColor = Color.parseColor("#69666C"); customTheme.dividerColor = Color.parseColor("#69666C");
@ -722,6 +736,7 @@ public class CustomThemeWrapper {
customTheme.archivedTint = Color.parseColor("#B4009F"); customTheme.archivedTint = Color.parseColor("#B4009F");
customTheme.lockedIconTint = Color.parseColor("#EE7302"); customTheme.lockedIconTint = Color.parseColor("#EE7302");
customTheme.crosspostIconTint = Color.parseColor("#FF4081"); customTheme.crosspostIconTint = Color.parseColor("#FF4081");
customTheme.upvoteRatioIconTint = Color.parseColor("#0256EE");
customTheme.stickiedPostIconTint = Color.parseColor("#1565C0"); customTheme.stickiedPostIconTint = Color.parseColor("#1565C0");
customTheme.noPreviewPostTypeIconTint = Color.parseColor("#808080"); customTheme.noPreviewPostTypeIconTint = Color.parseColor("#808080");
customTheme.subscribed = Color.parseColor("#FF4081"); customTheme.subscribed = Color.parseColor("#FF4081");
@ -731,6 +746,7 @@ public class CustomThemeWrapper {
customTheme.authorFlairTextColor = Color.parseColor("#EE02C4"); customTheme.authorFlairTextColor = Color.parseColor("#EE02C4");
customTheme.submitter = Color.parseColor("#EE8A02"); customTheme.submitter = Color.parseColor("#EE8A02");
customTheme.moderator = Color.parseColor("#00BA81"); customTheme.moderator = Color.parseColor("#00BA81");
customTheme.currentUser = Color.parseColor("#A202EE");
customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#123E77"); customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#123E77");
customTheme.unreadMessageBackgroundColor = Color.parseColor("#123E77"); customTheme.unreadMessageBackgroundColor = Color.parseColor("#123E77");
customTheme.dividerColor = Color.parseColor("#69666C"); customTheme.dividerColor = Color.parseColor("#69666C");
@ -811,6 +827,7 @@ public class CustomThemeWrapper {
customTheme.archivedTint = Color.parseColor("#B4009F"); customTheme.archivedTint = Color.parseColor("#B4009F");
customTheme.lockedIconTint = Color.parseColor("#EE7302"); customTheme.lockedIconTint = Color.parseColor("#EE7302");
customTheme.crosspostIconTint = Color.parseColor("#FF4081"); customTheme.crosspostIconTint = Color.parseColor("#FF4081");
customTheme.upvoteRatioIconTint = Color.parseColor("#0256EE");
customTheme.stickiedPostIconTint = Color.parseColor("#0D47A1"); customTheme.stickiedPostIconTint = Color.parseColor("#0D47A1");
customTheme.noPreviewPostTypeIconTint = Color.parseColor("#FFFFFF"); customTheme.noPreviewPostTypeIconTint = Color.parseColor("#FFFFFF");
customTheme.subscribed = Color.parseColor("#FF4081"); customTheme.subscribed = Color.parseColor("#FF4081");
@ -820,6 +837,7 @@ public class CustomThemeWrapper {
customTheme.authorFlairTextColor = Color.parseColor("#EE02C4"); customTheme.authorFlairTextColor = Color.parseColor("#EE02C4");
customTheme.submitter = Color.parseColor("#EE8A02"); customTheme.submitter = Color.parseColor("#EE8A02");
customTheme.moderator = Color.parseColor("#00BA81"); customTheme.moderator = Color.parseColor("#00BA81");
customTheme.currentUser = Color.parseColor("#A202EE");
customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#B3E5F9"); customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#B3E5F9");
customTheme.unreadMessageBackgroundColor = Color.parseColor("#B3E5F9"); customTheme.unreadMessageBackgroundColor = Color.parseColor("#B3E5F9");
customTheme.dividerColor = Color.parseColor("#E0E0E0"); customTheme.dividerColor = Color.parseColor("#E0E0E0");
@ -900,6 +918,7 @@ public class CustomThemeWrapper {
customTheme.archivedTint = Color.parseColor("#B4009F"); customTheme.archivedTint = Color.parseColor("#B4009F");
customTheme.lockedIconTint = Color.parseColor("#EE7302"); customTheme.lockedIconTint = Color.parseColor("#EE7302");
customTheme.crosspostIconTint = Color.parseColor("#FF4081"); customTheme.crosspostIconTint = Color.parseColor("#FF4081");
customTheme.upvoteRatioIconTint = Color.parseColor("#0256EE");
customTheme.stickiedPostIconTint = Color.parseColor("#1565C0"); customTheme.stickiedPostIconTint = Color.parseColor("#1565C0");
customTheme.noPreviewPostTypeIconTint = Color.parseColor("#FFFFFF"); customTheme.noPreviewPostTypeIconTint = Color.parseColor("#FFFFFF");
customTheme.subscribed = Color.parseColor("#FF4081"); customTheme.subscribed = Color.parseColor("#FF4081");
@ -909,6 +928,7 @@ public class CustomThemeWrapper {
customTheme.authorFlairTextColor = Color.parseColor("#EE02C4"); customTheme.authorFlairTextColor = Color.parseColor("#EE02C4");
customTheme.submitter = Color.parseColor("#EE8A02"); customTheme.submitter = Color.parseColor("#EE8A02");
customTheme.moderator = Color.parseColor("#00BA81"); customTheme.moderator = Color.parseColor("#00BA81");
customTheme.currentUser = Color.parseColor("#A202EE");
customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#123E77"); customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#123E77");
customTheme.unreadMessageBackgroundColor = Color.parseColor("#123E77"); customTheme.unreadMessageBackgroundColor = Color.parseColor("#123E77");
customTheme.dividerColor = Color.parseColor("#69666C"); customTheme.dividerColor = Color.parseColor("#69666C");
@ -989,6 +1009,7 @@ public class CustomThemeWrapper {
customTheme.archivedTint = Color.parseColor("#B4009F"); customTheme.archivedTint = Color.parseColor("#B4009F");
customTheme.lockedIconTint = Color.parseColor("#EE7302"); customTheme.lockedIconTint = Color.parseColor("#EE7302");
customTheme.crosspostIconTint = Color.parseColor("#FF4081"); customTheme.crosspostIconTint = Color.parseColor("#FF4081");
customTheme.upvoteRatioIconTint = Color.parseColor("#0256EE");
customTheme.stickiedPostIconTint = Color.parseColor("#1565C0"); customTheme.stickiedPostIconTint = Color.parseColor("#1565C0");
customTheme.noPreviewPostTypeIconTint = Color.parseColor("#FFFFFF"); customTheme.noPreviewPostTypeIconTint = Color.parseColor("#FFFFFF");
customTheme.subscribed = Color.parseColor("#FF4081"); customTheme.subscribed = Color.parseColor("#FF4081");
@ -998,6 +1019,7 @@ public class CustomThemeWrapper {
customTheme.authorFlairTextColor = Color.parseColor("#EE02C4"); customTheme.authorFlairTextColor = Color.parseColor("#EE02C4");
customTheme.submitter = Color.parseColor("#EE8A02"); customTheme.submitter = Color.parseColor("#EE8A02");
customTheme.moderator = Color.parseColor("#00BA81"); customTheme.moderator = Color.parseColor("#00BA81");
customTheme.currentUser = Color.parseColor("#A202EE");
customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#123E77"); customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#123E77");
customTheme.unreadMessageBackgroundColor = Color.parseColor("#123E77"); customTheme.unreadMessageBackgroundColor = Color.parseColor("#123E77");
customTheme.dividerColor = Color.parseColor("#69666C"); customTheme.dividerColor = Color.parseColor("#69666C");
@ -1078,6 +1100,7 @@ public class CustomThemeWrapper {
customTheme.archivedTint = Color.parseColor("#B4009F"); customTheme.archivedTint = Color.parseColor("#B4009F");
customTheme.lockedIconTint = Color.parseColor("#EE7302"); customTheme.lockedIconTint = Color.parseColor("#EE7302");
customTheme.crosspostIconTint = Color.parseColor("#FF4081"); customTheme.crosspostIconTint = Color.parseColor("#FF4081");
customTheme.upvoteRatioIconTint = Color.parseColor("#0256EE");
customTheme.stickiedPostIconTint = Color.parseColor("#0D47A1"); customTheme.stickiedPostIconTint = Color.parseColor("#0D47A1");
customTheme.noPreviewPostTypeIconTint = Color.parseColor("#808080"); customTheme.noPreviewPostTypeIconTint = Color.parseColor("#808080");
customTheme.subscribed = Color.parseColor("#FF4081"); customTheme.subscribed = Color.parseColor("#FF4081");
@ -1087,6 +1110,7 @@ public class CustomThemeWrapper {
customTheme.authorFlairTextColor = Color.parseColor("#EE02C4"); customTheme.authorFlairTextColor = Color.parseColor("#EE02C4");
customTheme.submitter = Color.parseColor("#EE8A02"); customTheme.submitter = Color.parseColor("#EE8A02");
customTheme.moderator = Color.parseColor("#00BA81"); customTheme.moderator = Color.parseColor("#00BA81");
customTheme.currentUser = Color.parseColor("#A202EE");
customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#B3E5F9"); customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#B3E5F9");
customTheme.unreadMessageBackgroundColor = Color.parseColor("#B3E5F9"); customTheme.unreadMessageBackgroundColor = Color.parseColor("#B3E5F9");
customTheme.dividerColor = Color.parseColor("#E0E0E0"); customTheme.dividerColor = Color.parseColor("#E0E0E0");
@ -1167,6 +1191,7 @@ public class CustomThemeWrapper {
customTheme.archivedTint = Color.parseColor("#B4009F"); customTheme.archivedTint = Color.parseColor("#B4009F");
customTheme.lockedIconTint = Color.parseColor("#EE7302"); customTheme.lockedIconTint = Color.parseColor("#EE7302");
customTheme.crosspostIconTint = Color.parseColor("#FF4081"); customTheme.crosspostIconTint = Color.parseColor("#FF4081");
customTheme.upvoteRatioIconTint = Color.parseColor("#0256EE");
customTheme.stickiedPostIconTint = Color.parseColor("#1565C0"); customTheme.stickiedPostIconTint = Color.parseColor("#1565C0");
customTheme.noPreviewPostTypeIconTint = Color.parseColor("#808080"); customTheme.noPreviewPostTypeIconTint = Color.parseColor("#808080");
customTheme.subscribed = Color.parseColor("#FF4081"); customTheme.subscribed = Color.parseColor("#FF4081");
@ -1176,6 +1201,7 @@ public class CustomThemeWrapper {
customTheme.authorFlairTextColor = Color.parseColor("#EE02C4"); customTheme.authorFlairTextColor = Color.parseColor("#EE02C4");
customTheme.submitter = Color.parseColor("#EE8A02"); customTheme.submitter = Color.parseColor("#EE8A02");
customTheme.moderator = Color.parseColor("#00BA81"); customTheme.moderator = Color.parseColor("#00BA81");
customTheme.currentUser = Color.parseColor("#A202EE");
customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#123E77"); customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#123E77");
customTheme.unreadMessageBackgroundColor = Color.parseColor("#123E77"); customTheme.unreadMessageBackgroundColor = Color.parseColor("#123E77");
customTheme.dividerColor = Color.parseColor("#69666C"); customTheme.dividerColor = Color.parseColor("#69666C");
@ -1256,6 +1282,7 @@ public class CustomThemeWrapper {
customTheme.archivedTint = Color.parseColor("#B4009F"); customTheme.archivedTint = Color.parseColor("#B4009F");
customTheme.lockedIconTint = Color.parseColor("#EE7302"); customTheme.lockedIconTint = Color.parseColor("#EE7302");
customTheme.crosspostIconTint = Color.parseColor("#FF4081"); customTheme.crosspostIconTint = Color.parseColor("#FF4081");
customTheme.upvoteRatioIconTint = Color.parseColor("#0256EE");
customTheme.stickiedPostIconTint = Color.parseColor("#1565C0"); customTheme.stickiedPostIconTint = Color.parseColor("#1565C0");
customTheme.noPreviewPostTypeIconTint = Color.parseColor("#808080"); customTheme.noPreviewPostTypeIconTint = Color.parseColor("#808080");
customTheme.subscribed = Color.parseColor("#FF4081"); customTheme.subscribed = Color.parseColor("#FF4081");
@ -1265,6 +1292,7 @@ public class CustomThemeWrapper {
customTheme.authorFlairTextColor = Color.parseColor("#EE02C4"); customTheme.authorFlairTextColor = Color.parseColor("#EE02C4");
customTheme.submitter = Color.parseColor("#EE8A02"); customTheme.submitter = Color.parseColor("#EE8A02");
customTheme.moderator = Color.parseColor("#00BA81"); customTheme.moderator = Color.parseColor("#00BA81");
customTheme.currentUser = Color.parseColor("#A202EE");
customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#123E77"); customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#123E77");
customTheme.unreadMessageBackgroundColor = Color.parseColor("#123E77"); customTheme.unreadMessageBackgroundColor = Color.parseColor("#123E77");
customTheme.dividerColor = Color.parseColor("#69666C"); customTheme.dividerColor = Color.parseColor("#69666C");
@ -1345,6 +1373,7 @@ public class CustomThemeWrapper {
customTheme.archivedTint = Color.parseColor("#B4009F"); customTheme.archivedTint = Color.parseColor("#B4009F");
customTheme.lockedIconTint = Color.parseColor("#EE7302"); customTheme.lockedIconTint = Color.parseColor("#EE7302");
customTheme.crosspostIconTint = Color.parseColor("#FF4081"); customTheme.crosspostIconTint = Color.parseColor("#FF4081");
customTheme.upvoteRatioIconTint = Color.parseColor("#0256EE");
customTheme.stickiedPostIconTint = Color.parseColor("#0D47A1"); customTheme.stickiedPostIconTint = Color.parseColor("#0D47A1");
customTheme.noPreviewPostTypeIconTint = Color.parseColor("#FFFFFF"); customTheme.noPreviewPostTypeIconTint = Color.parseColor("#FFFFFF");
customTheme.subscribed = Color.parseColor("#FF4081"); customTheme.subscribed = Color.parseColor("#FF4081");
@ -1354,6 +1383,7 @@ public class CustomThemeWrapper {
customTheme.authorFlairTextColor = Color.parseColor("#EE02C4"); customTheme.authorFlairTextColor = Color.parseColor("#EE02C4");
customTheme.submitter = Color.parseColor("#EE8A02"); customTheme.submitter = Color.parseColor("#EE8A02");
customTheme.moderator = Color.parseColor("#00BA81"); customTheme.moderator = Color.parseColor("#00BA81");
customTheme.currentUser = Color.parseColor("#A202EE");
customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#5F5B85"); customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#5F5B85");
customTheme.unreadMessageBackgroundColor = Color.parseColor("#5F5B85"); customTheme.unreadMessageBackgroundColor = Color.parseColor("#5F5B85");
customTheme.dividerColor = Color.parseColor("#69666C"); customTheme.dividerColor = Color.parseColor("#69666C");
@ -1434,6 +1464,7 @@ public class CustomThemeWrapper {
customTheme.archivedTint = Color.parseColor("#B4009F"); customTheme.archivedTint = Color.parseColor("#B4009F");
customTheme.lockedIconTint = Color.parseColor("#EE7302"); customTheme.lockedIconTint = Color.parseColor("#EE7302");
customTheme.crosspostIconTint = Color.parseColor("#FF4081"); customTheme.crosspostIconTint = Color.parseColor("#FF4081");
customTheme.upvoteRatioIconTint = Color.parseColor("#0256EE");
customTheme.stickiedPostIconTint = Color.parseColor("#0D47A1"); customTheme.stickiedPostIconTint = Color.parseColor("#0D47A1");
customTheme.noPreviewPostTypeIconTint = Color.parseColor("#808080"); customTheme.noPreviewPostTypeIconTint = Color.parseColor("#808080");
customTheme.subscribed = Color.parseColor("#FF4081"); customTheme.subscribed = Color.parseColor("#FF4081");
@ -1443,6 +1474,7 @@ public class CustomThemeWrapper {
customTheme.authorFlairTextColor = Color.parseColor("#EE02C4"); customTheme.authorFlairTextColor = Color.parseColor("#EE02C4");
customTheme.submitter = Color.parseColor("#EE8A02"); customTheme.submitter = Color.parseColor("#EE8A02");
customTheme.moderator = Color.parseColor("#00BA81"); customTheme.moderator = Color.parseColor("#00BA81");
customTheme.currentUser = Color.parseColor("#A202EE");
customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#25D5E5"); customTheme.singleCommentThreadBackgroundColor = Color.parseColor("#25D5E5");
customTheme.unreadMessageBackgroundColor = Color.parseColor("#25D5E5"); customTheme.unreadMessageBackgroundColor = Color.parseColor("#25D5E5");
customTheme.dividerColor = Color.parseColor("#E0E0E0"); customTheme.dividerColor = Color.parseColor("#E0E0E0");

View File

@ -59,6 +59,7 @@ public class ParsePost {
int score = data.getInt(JSONUtils.SCORE_KEY); int score = data.getInt(JSONUtils.SCORE_KEY);
int voteType; int voteType;
int nComments = data.getInt(JSONUtils.NUM_COMMENTS_KEY); int nComments = data.getInt(JSONUtils.NUM_COMMENTS_KEY);
int upvoteRatio = (int) (data.getDouble(JSONUtils.UPVOTE_RATIO) * 100);
boolean hidden = data.getBoolean(JSONUtils.HIDDEN_KEY); boolean hidden = data.getBoolean(JSONUtils.HIDDEN_KEY);
boolean spoiler = data.getBoolean(JSONUtils.SPOILER_KEY); boolean spoiler = data.getBoolean(JSONUtils.SPOILER_KEY);
boolean nsfw = data.getBoolean(JSONUtils.NSFW_KEY); boolean nsfw = data.getBoolean(JSONUtils.NSFW_KEY);
@ -137,7 +138,7 @@ public class ParsePost {
Post post = parseData(data, permalink, id, fullName, subredditName, subredditNamePrefixed, Post post = parseData(data, permalink, id, fullName, subredditName, subredditNamePrefixed,
author, authorFlair, authorFlairHTMLBuilder.toString(), author, authorFlair, authorFlairHTMLBuilder.toString(),
postTime, title, previews, postTime, title, previews,
score, voteType, nComments, flair, awardingsBuilder.toString(), nAwards, hidden, score, voteType, nComments, upvoteRatio, flair, awardingsBuilder.toString(), nAwards, hidden,
spoiler, nsfw, stickied, archived, locked, saved, true); spoiler, nsfw, stickied, archived, locked, saved, true);
post.setCrosspostParentId(crosspostParent.getId()); post.setCrosspostParentId(crosspostParent.getId());
return post; return post;
@ -145,7 +146,7 @@ public class ParsePost {
return parseData(data, permalink, id, fullName, subredditName, subredditNamePrefixed, return parseData(data, permalink, id, fullName, subredditName, subredditNamePrefixed,
author, authorFlair, authorFlairHTMLBuilder.toString(), author, authorFlair, authorFlairHTMLBuilder.toString(),
postTime, title, previews, postTime, title, previews,
score, voteType, nComments, flair, awardingsBuilder.toString(), nAwards, hidden, score, voteType, nComments, upvoteRatio, flair, awardingsBuilder.toString(), nAwards, hidden,
spoiler, nsfw, stickied, archived, locked, saved, false); spoiler, nsfw, stickied, archived, locked, saved, false);
} }
} }
@ -154,7 +155,7 @@ public class ParsePost {
String subredditName, String subredditNamePrefixed, String author, String subredditName, String subredditNamePrefixed, String author,
String authorFlair, String authorFlairHTML, String authorFlair, String authorFlairHTML,
long postTimeMillis, String title, ArrayList<Post.Preview> previews, long postTimeMillis, String title, ArrayList<Post.Preview> previews,
int score, int voteType, int nComments, String flair, int score, int voteType, int nComments, int upvoteRatio, String flair,
String awards, int nAwards, boolean hidden, boolean spoiler, String awards, int nAwards, boolean hidden, boolean spoiler,
boolean nsfw, boolean stickied, boolean archived, boolean locked, boolean nsfw, boolean stickied, boolean archived, boolean locked,
boolean saved, boolean isCrosspost) throws JSONException { boolean saved, boolean isCrosspost) throws JSONException {
@ -168,9 +169,9 @@ public class ParsePost {
//Text post //Text post
int postType = Post.TEXT_TYPE; int postType = Post.TEXT_TYPE;
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, post = new Post(id, fullName, subredditName, subredditNamePrefixed, author,
authorFlair, authorFlairHTML, postTimeMillis, authorFlair, authorFlairHTML, postTimeMillis, title, permalink, score, postType,
title, permalink, score, postType, voteType, nComments, flair, awards, nAwards, voteType, nComments, upvoteRatio, flair, awards, nAwards, hidden, spoiler, nsfw,
hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost); stickied, archived, locked, saved, isCrosspost);
if (data.isNull(JSONUtils.SELFTEXT_KEY)) { if (data.isNull(JSONUtils.SELFTEXT_KEY)) {
post.setSelfText(""); post.setSelfText("");
} else { } else {
@ -193,9 +194,9 @@ public class ParsePost {
int postType = Post.IMAGE_TYPE; int postType = Post.IMAGE_TYPE;
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, post = new Post(id, fullName, subredditName, subredditNamePrefixed, author,
authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score, postType, voteType, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score,
nComments, flair, awards, nAwards, hidden, spoiler, nsfw, stickied, archived, postType, voteType, nComments, upvoteRatio, flair, awards, nAwards, hidden,
locked, saved, isCrosspost); spoiler, nsfw, stickied, archived, locked, saved, isCrosspost);
if (previews.isEmpty()) { if (previews.isEmpty()) {
previews.add(new Post.Preview(url, 0, 0)); previews.add(new Post.Preview(url, 0, 0));
@ -205,10 +206,9 @@ public class ParsePost {
//No preview link post //No preview link post
int postType = Post.NO_PREVIEW_LINK_TYPE; int postType = Post.NO_PREVIEW_LINK_TYPE;
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, post = new Post(id, fullName, subredditName, subredditNamePrefixed, author,
authorFlair, authorFlairHTML, postTimeMillis, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score,
title, url, permalink, score, postType, postType, voteType, nComments, upvoteRatio, flair, awards, nAwards, hidden,
voteType, nComments, flair, awards, nAwards, hidden, spoiler, nsfw, stickied, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost);
archived, locked, saved, isCrosspost);
if (data.isNull(JSONUtils.SELFTEXT_KEY)) { if (data.isNull(JSONUtils.SELFTEXT_KEY)) {
post.setSelfText(""); post.setSelfText("");
} else { } else {
@ -244,10 +244,10 @@ public class ParsePost {
String videoUrl = Html.fromHtml(redditVideoObject.getString(JSONUtils.HLS_URL_KEY)).toString(); String videoUrl = Html.fromHtml(redditVideoObject.getString(JSONUtils.HLS_URL_KEY)).toString();
String videoDownloadUrl = redditVideoObject.getString(JSONUtils.FALLBACK_URL_KEY); String videoDownloadUrl = redditVideoObject.getString(JSONUtils.FALLBACK_URL_KEY);
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFlair,
authorFlair, authorFlairHTML, postTimeMillis, title, permalink, score, postType, voteType, authorFlairHTML, postTimeMillis, title, permalink, score, postType, voteType,
nComments, flair, awards, nAwards, hidden, spoiler, nsfw, stickied, archived, locked, nComments, upvoteRatio, flair, awards, nAwards, hidden, spoiler, nsfw, stickied,
saved, isCrosspost); archived, locked, saved, isCrosspost);
post.setPreviews(previews); post.setPreviews(previews);
post.setVideoUrl(videoUrl); post.setVideoUrl(videoUrl);
@ -261,10 +261,10 @@ public class ParsePost {
String videoDownloadUrl = data.getJSONObject(JSONUtils.PREVIEW_KEY) String videoDownloadUrl = data.getJSONObject(JSONUtils.PREVIEW_KEY)
.getJSONObject(JSONUtils.REDDIT_VIDEO_PREVIEW_KEY).getString(JSONUtils.FALLBACK_URL_KEY); .getJSONObject(JSONUtils.REDDIT_VIDEO_PREVIEW_KEY).getString(JSONUtils.FALLBACK_URL_KEY);
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, authorFlair,
authorFlair, authorFlairHTML, postTimeMillis, title, permalink, score, postType, voteType, authorFlairHTML, postTimeMillis, title, permalink, score, postType, voteType,
nComments, flair, awards, nAwards, hidden, spoiler, nsfw, stickied, archived, nComments, upvoteRatio, flair, awards, nAwards, hidden, spoiler, nsfw, stickied,
locked, saved, isCrosspost); archived, locked, saved, isCrosspost);
post.setPreviews(previews); post.setPreviews(previews);
post.setVideoUrl(videoUrl); post.setVideoUrl(videoUrl);
post.setVideoDownloadUrl(videoDownloadUrl); post.setVideoDownloadUrl(videoDownloadUrl);
@ -274,10 +274,9 @@ public class ParsePost {
int postType = Post.IMAGE_TYPE; int postType = Post.IMAGE_TYPE;
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, post = new Post(id, fullName, subredditName, subredditNamePrefixed, author,
authorFlair, authorFlairHTML, postTimeMillis, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score,
title, url, permalink, score, postType, postType, voteType, nComments, upvoteRatio, flair, awards, nAwards,
voteType, nComments, flair, awards, nAwards, hidden, spoiler, nsfw, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost);
stickied, archived, locked, saved, isCrosspost);
if (previews.isEmpty()) { if (previews.isEmpty()) {
previews.add(new Post.Preview(url, 0, 0)); previews.add(new Post.Preview(url, 0, 0));
@ -287,10 +286,9 @@ public class ParsePost {
//Gif post //Gif post
int postType = Post.GIF_TYPE; int postType = Post.GIF_TYPE;
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, post = new Post(id, fullName, subredditName, subredditNamePrefixed, author,
authorFlair, authorFlairHTML, postTimeMillis, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score,
title, url, permalink, score, postType, voteType, nComments, upvoteRatio, flair, awards, nAwards,
postType, voteType, nComments, flair, awards, nAwards, hidden, spoiler, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost);
nsfw, stickied, archived, locked, saved, isCrosspost);
post.setPreviews(previews); post.setPreviews(previews);
post.setVideoUrl(url); post.setVideoUrl(url);
@ -299,9 +297,9 @@ public class ParsePost {
int postType = Post.VIDEO_TYPE; int postType = Post.VIDEO_TYPE;
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, post = new Post(id, fullName, subredditName, subredditNamePrefixed, author,
authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score, postType, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score,
voteType, nComments, flair, awards, nAwards, hidden, spoiler, nsfw, stickied, postType, voteType, nComments, upvoteRatio, flair, awards, nAwards,
archived, locked, saved, isCrosspost); hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost);
post.setPreviews(previews); post.setPreviews(previews);
post.setVideoUrl(url); post.setVideoUrl(url);
post.setVideoDownloadUrl(url); post.setVideoDownloadUrl(url);
@ -311,10 +309,9 @@ public class ParsePost {
int postType = Post.TEXT_TYPE; int postType = Post.TEXT_TYPE;
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, post = new Post(id, fullName, subredditName, subredditNamePrefixed, author,
authorFlair, authorFlairHTML, postTimeMillis, authorFlair, authorFlairHTML, postTimeMillis, title, permalink, score,
title, permalink, score, postType, voteType, nComments, flair, postType, voteType, nComments, upvoteRatio, flair, awards, nAwards,
awards, nAwards, hidden, spoiler, nsfw, stickied, archived, locked, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost);
saved, isCrosspost);
//Need attention //Need attention
post.setPreviews(previews); post.setPreviews(previews);
@ -340,10 +337,9 @@ public class ParsePost {
int postType = Post.LINK_TYPE; int postType = Post.LINK_TYPE;
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, post = new Post(id, fullName, subredditName, subredditNamePrefixed, author,
authorFlair, authorFlairHTML, postTimeMillis, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score,
title, url, permalink, score, postType, voteType, nComments, upvoteRatio, flair, awards, nAwards,
postType, voteType, nComments, flair, awards, nAwards, hidden, spoiler, hidden, spoiler, nsfw, stickied, archived, locked, saved, isCrosspost);
nsfw, stickied, archived, locked, saved, isCrosspost);
if (data.isNull(JSONUtils.SELFTEXT_KEY)) { if (data.isNull(JSONUtils.SELFTEXT_KEY)) {
post.setSelfText(""); post.setSelfText("");
} else { } else {
@ -360,9 +356,9 @@ public class ParsePost {
int postType = Post.IMAGE_TYPE; int postType = Post.IMAGE_TYPE;
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, post = new Post(id, fullName, subredditName, subredditNamePrefixed, author,
authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score, postType, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score,
voteType, nComments, flair, awards, nAwards, hidden, spoiler, nsfw, stickied, postType, voteType, nComments, upvoteRatio, flair, awards, nAwards, hidden,
archived, locked, saved, isCrosspost); spoiler, nsfw, stickied, archived, locked, saved, isCrosspost);
if (previews.isEmpty()) { if (previews.isEmpty()) {
previews.add(new Post.Preview(url, 0, 0)); previews.add(new Post.Preview(url, 0, 0));
@ -373,9 +369,9 @@ public class ParsePost {
int postType = Post.VIDEO_TYPE; int postType = Post.VIDEO_TYPE;
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, post = new Post(id, fullName, subredditName, subredditNamePrefixed, author,
authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score, postType, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score,
voteType, nComments, flair, awards, nAwards, hidden, spoiler, nsfw, stickied, postType, voteType, nComments, upvoteRatio, flair, awards, nAwards, hidden,
archived, locked, saved, isCrosspost); spoiler, nsfw, stickied, archived, locked, saved, isCrosspost);
post.setPreviews(previews); post.setPreviews(previews);
post.setVideoUrl(url); post.setVideoUrl(url);
post.setVideoDownloadUrl(url); post.setVideoDownloadUrl(url);
@ -384,9 +380,9 @@ public class ParsePost {
int postType = Post.NO_PREVIEW_LINK_TYPE; int postType = Post.NO_PREVIEW_LINK_TYPE;
post = new Post(id, fullName, subredditName, subredditNamePrefixed, author, post = new Post(id, fullName, subredditName, subredditNamePrefixed, author,
authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score, postType, voteType, authorFlair, authorFlairHTML, postTimeMillis, title, url, permalink, score,
nComments, flair, awards, nAwards, hidden, spoiler, nsfw, stickied, archived, postType, voteType, nComments, upvoteRatio, flair, awards, nAwards, hidden,
locked, saved, isCrosspost); spoiler, nsfw, stickied, archived, locked, saved, isCrosspost);
//Need attention //Need attention
} }
} }

View File

@ -63,6 +63,7 @@ public class Post implements Parcelable {
private int postType; private int postType;
private int voteType; private int voteType;
private int nComments; private int nComments;
private int upvoteRatio;
private boolean hidden; private boolean hidden;
private boolean spoiler; private boolean spoiler;
private boolean nsfw; private boolean nsfw;
@ -79,11 +80,11 @@ public class Post implements Parcelable {
private ArrayList<Gallery> gallery = new ArrayList<>(); private ArrayList<Gallery> gallery = new ArrayList<>();
public Post(String id, String fullName, String subredditName, String subredditNamePrefixed, public Post(String id, String fullName, String subredditName, String subredditNamePrefixed,
String author, String authorFlair, String authorFlairHTML, String author, String authorFlair, String authorFlairHTML, long postTimeMillis,
long postTimeMillis, String title, String title, String permalink, int score, int postType, int voteType, int nComments,
String permalink, int score, int postType, int voteType, int nComments, String flair, int upvoteRatio, String flair, String awards, int nAwards, boolean hidden, boolean spoiler,
String awards, int nAwards, boolean hidden, boolean spoiler, boolean nsfw, boolean stickied, boolean nsfw, boolean stickied, boolean archived, boolean locked, boolean saved,
boolean archived, boolean locked, boolean saved, boolean isCrosspost) { boolean isCrosspost) {
this.id = id; this.id = id;
this.fullName = fullName; this.fullName = fullName;
this.subredditName = subredditName; this.subredditName = subredditName;
@ -99,6 +100,7 @@ public class Post implements Parcelable {
this.postType = postType; this.postType = postType;
this.voteType = voteType; this.voteType = voteType;
this.nComments = nComments; this.nComments = nComments;
this.upvoteRatio = upvoteRatio;
this.flair = flair; this.flair = flair;
this.awards = awards; this.awards = awards;
this.nAwards = nAwards; this.nAwards = nAwards;
@ -114,11 +116,11 @@ public class Post implements Parcelable {
} }
public Post(String id, String fullName, String subredditName, String subredditNamePrefixed, public Post(String id, String fullName, String subredditName, String subredditNamePrefixed,
String author, String authorFlair, String authorFlairHTML, String author, String authorFlair, String authorFlairHTML, long postTimeMillis, String title,
long postTimeMillis, String title,
String url, String permalink, int score, int postType, int voteType, int nComments, String url, String permalink, int score, int postType, int voteType, int nComments,
String flair, String awards, int nAwards, boolean hidden, boolean spoiler, boolean nsfw, int upvoteRatio, String flair, String awards, int nAwards, boolean hidden, boolean spoiler,
boolean stickied, boolean archived, boolean locked, boolean saved, boolean isCrosspost) { boolean nsfw, boolean stickied, boolean archived, boolean locked, boolean saved,
boolean isCrosspost) {
this.id = id; this.id = id;
this.fullName = fullName; this.fullName = fullName;
this.subredditName = subredditName; this.subredditName = subredditName;
@ -135,6 +137,7 @@ public class Post implements Parcelable {
this.postType = postType; this.postType = postType;
this.voteType = voteType; this.voteType = voteType;
this.nComments = nComments; this.nComments = nComments;
this.upvoteRatio = upvoteRatio;
this.flair = flair; this.flair = flair;
this.awards = awards; this.awards = awards;
this.nAwards = nAwards; this.nAwards = nAwards;
@ -180,6 +183,7 @@ public class Post implements Parcelable {
postType = in.readInt(); postType = in.readInt();
voteType = in.readInt(); voteType = in.readInt();
nComments = in.readInt(); nComments = in.readInt();
upvoteRatio = in.readInt();
hidden = in.readByte() != 0; hidden = in.readByte() != 0;
spoiler = in.readByte() != 0; spoiler = in.readByte() != 0;
nsfw = in.readByte() != 0; nsfw = in.readByte() != 0;
@ -401,6 +405,14 @@ public class Post implements Parcelable {
this.nComments = nComments; this.nComments = nComments;
} }
public int getUpvoteRatio() {
return upvoteRatio;
}
public void setUpvoteRatio(int upvoteRatio) {
this.upvoteRatio = upvoteRatio;
}
public boolean isHidden() { public boolean isHidden() {
return hidden; return hidden;
} }
@ -531,6 +543,7 @@ public class Post implements Parcelable {
parcel.writeInt(postType); parcel.writeInt(postType);
parcel.writeInt(voteType); parcel.writeInt(voteType);
parcel.writeInt(nComments); parcel.writeInt(nComments);
parcel.writeInt(upvoteRatio);
parcel.writeByte((byte) (hidden ? 1 : 0)); parcel.writeByte((byte) (hidden ? 1 : 0));
parcel.writeByte((byte) (spoiler ? 1 : 0)); parcel.writeByte((byte) (spoiler ? 1 : 0));
parcel.writeByte((byte) (nsfw ? 1 : 0)); parcel.writeByte((byte) (nsfw ? 1 : 0));

View File

@ -60,6 +60,7 @@ public class CustomThemeSharedPreferencesUtils {
public static final String ARCHIVED_ICON_TINT = "archivedIconTint"; public static final String ARCHIVED_ICON_TINT = "archivedIconTint";
public static final String LOCKED_ICON_TINT = "lockedIconTint"; public static final String LOCKED_ICON_TINT = "lockedIconTint";
public static final String CROSSPOST_ICON_TINT = "crosspostIconTint"; public static final String CROSSPOST_ICON_TINT = "crosspostIconTint";
public static final String UPVOTE_RATIO_ICON_TINT = "upvoteRatioIconTint";
public static final String STICKIED_POST_ICON_TINT = "stickiedPost"; public static final String STICKIED_POST_ICON_TINT = "stickiedPost";
public static final String NO_PREVIEW_POST_TYPE_ICON_TINT = "noPreviewPostTypeIconTint"; public static final String NO_PREVIEW_POST_TYPE_ICON_TINT = "noPreviewPostTypeIconTint";
public static final String SUBSCRIBED = "subscribed"; public static final String SUBSCRIBED = "subscribed";
@ -69,6 +70,7 @@ public class CustomThemeSharedPreferencesUtils {
public static final String AUTHOR_FLAIR_TEXT_COLOR = "authorFlairTextColor"; public static final String AUTHOR_FLAIR_TEXT_COLOR = "authorFlairTextColor";
public static final String SUBMITTER = "submitter"; public static final String SUBMITTER = "submitter";
public static final String MODERATOR = "moderator"; public static final String MODERATOR = "moderator";
public static final String CURRENT_USER = "currentUser";
public static final String SINGLE_COMMENT_THREAD_BACKGROUND_COLOR = "singleCommentThreadBackgroundColor"; public static final String SINGLE_COMMENT_THREAD_BACKGROUND_COLOR = "singleCommentThreadBackgroundColor";
public static final String UNREAD_MESSAGE_BACKGROUND_COLOR = "unreadMessageBackgroundColor"; public static final String UNREAD_MESSAGE_BACKGROUND_COLOR = "unreadMessageBackgroundColor";
public static final String DIVIDER_COLOR = "dividerColor"; public static final String DIVIDER_COLOR = "dividerColor";
@ -140,6 +142,7 @@ public class CustomThemeSharedPreferencesUtils {
editor.putInt(ARCHIVED_ICON_TINT, customTheme.archivedTint); editor.putInt(ARCHIVED_ICON_TINT, customTheme.archivedTint);
editor.putInt(LOCKED_ICON_TINT, customTheme.lockedIconTint); editor.putInt(LOCKED_ICON_TINT, customTheme.lockedIconTint);
editor.putInt(CROSSPOST_ICON_TINT, customTheme.crosspostIconTint); editor.putInt(CROSSPOST_ICON_TINT, customTheme.crosspostIconTint);
editor.putInt(UPVOTE_RATIO_ICON_TINT, customTheme.upvoteRatioIconTint);
editor.putInt(STICKIED_POST_ICON_TINT, customTheme.stickiedPostIconTint); editor.putInt(STICKIED_POST_ICON_TINT, customTheme.stickiedPostIconTint);
editor.putInt(NO_PREVIEW_POST_TYPE_ICON_TINT, customTheme.noPreviewPostTypeIconTint); editor.putInt(NO_PREVIEW_POST_TYPE_ICON_TINT, customTheme.noPreviewPostTypeIconTint);
editor.putInt(SUBSCRIBED, customTheme.subscribed); editor.putInt(SUBSCRIBED, customTheme.subscribed);
@ -149,6 +152,7 @@ public class CustomThemeSharedPreferencesUtils {
editor.putInt(AUTHOR_FLAIR_TEXT_COLOR, customTheme.authorFlairTextColor); editor.putInt(AUTHOR_FLAIR_TEXT_COLOR, customTheme.authorFlairTextColor);
editor.putInt(SUBMITTER, customTheme.submitter); editor.putInt(SUBMITTER, customTheme.submitter);
editor.putInt(MODERATOR, customTheme.moderator); editor.putInt(MODERATOR, customTheme.moderator);
editor.putInt(CURRENT_USER, customTheme.currentUser);
editor.putInt(SINGLE_COMMENT_THREAD_BACKGROUND_COLOR, customTheme.singleCommentThreadBackgroundColor); editor.putInt(SINGLE_COMMENT_THREAD_BACKGROUND_COLOR, customTheme.singleCommentThreadBackgroundColor);
editor.putInt(UNREAD_MESSAGE_BACKGROUND_COLOR, customTheme.unreadMessageBackgroundColor); editor.putInt(UNREAD_MESSAGE_BACKGROUND_COLOR, customTheme.unreadMessageBackgroundColor);
editor.putInt(DIVIDER_COLOR, customTheme.dividerColor); editor.putInt(DIVIDER_COLOR, customTheme.dividerColor);

View File

@ -132,4 +132,5 @@ public class JSONUtils {
public static final String CONTENT_URLS_KEY = "content_urls";; public static final String CONTENT_URLS_KEY = "content_urls";;
public static final String WEBM_KEY = "webm"; public static final String WEBM_KEY = "webm";
public static final String WEBM_URL_KEY = "webmUrl"; public static final String WEBM_URL_KEY = "webmUrl";
public static final String UPVOTE_RATIO = "upvote_ratio";
} }

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="18dp"
android:height="18dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,2a10,10 0,1 0,10 10A10,10 0,0 0,12 2zM18,11.8a0.9,0.9 0,0 1,-0.1 0.5l-2.1,4.9a1.34,1.34 0,0 1,-1.3 0.8L9,18a2,2 0,0 1,-2 -2v-5a1.28,1.28 0,0 1,0.4 -1L12,5l0.69,0.69a1.08,1.08 0,0 1,0.3 0.7v0.2L12.41,10L17,10a1,1 0,0 1,1 1z"
android:fillColor="#000000"/>
</vector>

View File

@ -109,7 +109,8 @@
android:padding="16dp" android:padding="16dp"
app:flChildSpacing="16dp" app:flChildSpacing="16dp"
app:flChildSpacingForLastRow="align" app:flChildSpacingForLastRow="align"
app:flRowSpacing="8dp"> app:flRowSpacing="8dp"
app:flRowVerticalGravity="center">
<com.libRG.CustomTextView <com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post_detail_gallery" android:id="@+id/type_text_view_item_post_detail_gallery"
@ -163,6 +164,13 @@
app:lib_setRoundedView="true" app:lib_setRoundedView="true"
app:lib_setShape="rectangle" /> app:lib_setShape="rectangle" />
<TextView
android:id="@+id/upvote_ratio_text_view_item_post_detail_gallery"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="?attr/font_12"
android:fontFamily="?attr/font_family" />
<ImageView <ImageView
android:id="@+id/archived_image_view_item_post_detail_gallery" android:id="@+id/archived_image_view_item_post_detail_gallery"
android:layout_width="20dp" android:layout_width="20dp"

View File

@ -109,7 +109,8 @@
android:padding="16dp" android:padding="16dp"
app:flChildSpacing="16dp" app:flChildSpacing="16dp"
app:flChildSpacingForLastRow="align" app:flChildSpacingForLastRow="align"
app:flRowSpacing="8dp"> app:flRowSpacing="8dp"
app:flRowVerticalGravity="center">
<com.libRG.CustomTextView <com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post_detail_image_and_gif_autoplay" android:id="@+id/type_text_view_item_post_detail_image_and_gif_autoplay"
@ -163,6 +164,13 @@
app:lib_setRoundedView="true" app:lib_setRoundedView="true"
app:lib_setShape="rectangle" /> app:lib_setShape="rectangle" />
<TextView
android:id="@+id/upvote_ratio_text_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="?attr/font_12"
android:fontFamily="?attr/font_family" />
<ImageView <ImageView
android:id="@+id/archived_image_view_item_post_detail_image_and_gif_autoplay" android:id="@+id/archived_image_view_item_post_detail_image_and_gif_autoplay"
android:layout_width="20dp" android:layout_width="20dp"

View File

@ -109,7 +109,8 @@
android:padding="16dp" android:padding="16dp"
app:flChildSpacing="16dp" app:flChildSpacing="16dp"
app:flChildSpacingForLastRow="align" app:flChildSpacingForLastRow="align"
app:flRowSpacing="8dp"> app:flRowSpacing="8dp"
app:flRowVerticalGravity="center">
<com.libRG.CustomTextView <com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post_detail_link" android:id="@+id/type_text_view_item_post_detail_link"
@ -163,6 +164,13 @@
app:lib_setRoundedView="true" app:lib_setRoundedView="true"
app:lib_setShape="rectangle" /> app:lib_setShape="rectangle" />
<TextView
android:id="@+id/upvote_ratio_text_view_item_post_detail_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="?attr/font_12"
android:fontFamily="?attr/font_family" />
<ImageView <ImageView
android:id="@+id/archived_image_view_item_post_detail_link" android:id="@+id/archived_image_view_item_post_detail_link"
android:layout_width="20dp" android:layout_width="20dp"

View File

@ -118,7 +118,8 @@
android:padding="16dp" android:padding="16dp"
app:flChildSpacing="16dp" app:flChildSpacing="16dp"
app:flChildSpacingForLastRow="align" app:flChildSpacingForLastRow="align"
app:flRowSpacing="8dp"> app:flRowSpacing="8dp"
app:flRowVerticalGravity="center">
<com.libRG.CustomTextView <com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post_detail_no_preview_link" android:id="@+id/type_text_view_item_post_detail_no_preview_link"
@ -172,6 +173,13 @@
app:lib_setRoundedView="true" app:lib_setRoundedView="true"
app:lib_setShape="rectangle" /> app:lib_setShape="rectangle" />
<TextView
android:id="@+id/upvote_ratio_text_view_item_post_detail_no_preview_link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="?attr/font_12"
android:fontFamily="?attr/font_family" />
<ImageView <ImageView
android:id="@+id/archived_image_view_item_post_detail_no_preview_link" android:id="@+id/archived_image_view_item_post_detail_no_preview_link"
android:layout_width="20dp" android:layout_width="20dp"

View File

@ -118,7 +118,8 @@
android:padding="16dp" android:padding="16dp"
app:flChildSpacing="16dp" app:flChildSpacing="16dp"
app:flChildSpacingForLastRow="align" app:flChildSpacingForLastRow="align"
app:flRowSpacing="8dp"> app:flRowSpacing="8dp"
app:flRowVerticalGravity="center">
<com.libRG.CustomTextView <com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post_detail_text" android:id="@+id/type_text_view_item_post_detail_text"
@ -172,6 +173,13 @@
app:lib_setRoundedView="true" app:lib_setRoundedView="true"
app:lib_setShape="rectangle" /> app:lib_setShape="rectangle" />
<TextView
android:id="@+id/upvote_ratio_text_view_item_post_detail_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="?attr/font_12"
android:fontFamily="?attr/font_family" />
<ImageView <ImageView
android:id="@+id/archived_image_view_item_post_detail_text" android:id="@+id/archived_image_view_item_post_detail_text"
android:layout_width="20dp" android:layout_width="20dp"

View File

@ -109,7 +109,8 @@
android:padding="16dp" android:padding="16dp"
app:flChildSpacing="16dp" app:flChildSpacing="16dp"
app:flChildSpacingForLastRow="align" app:flChildSpacingForLastRow="align"
app:flRowSpacing="8dp"> app:flRowSpacing="8dp"
app:flRowVerticalGravity="center">
<com.libRG.CustomTextView <com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post_detail_video_and_gif_preview" android:id="@+id/type_text_view_item_post_detail_video_and_gif_preview"
@ -162,6 +163,13 @@
app:lib_setRoundedView="true" app:lib_setRoundedView="true"
app:lib_setShape="rectangle" /> app:lib_setShape="rectangle" />
<TextView
android:id="@+id/upvote_ratio_text_view_item_post_detail_video_and_gif_preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="?attr/font_12"
android:fontFamily="?attr/font_family" />
<ImageView <ImageView
android:id="@+id/archived_image_view_item_post_detail_video_and_gif_preview" android:id="@+id/archived_image_view_item_post_detail_video_and_gif_preview"
android:layout_width="20dp" android:layout_width="20dp"

View File

@ -109,7 +109,8 @@
android:padding="16dp" android:padding="16dp"
app:flChildSpacing="16dp" app:flChildSpacing="16dp"
app:flChildSpacingForLastRow="align" app:flChildSpacingForLastRow="align"
app:flRowSpacing="8dp"> app:flRowSpacing="8dp"
app:flRowVerticalGravity="center">
<com.libRG.CustomTextView <com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post_detail_video_autoplay" android:id="@+id/type_text_view_item_post_detail_video_autoplay"
@ -163,6 +164,13 @@
app:lib_setRoundedView="true" app:lib_setRoundedView="true"
app:lib_setShape="rectangle" /> app:lib_setShape="rectangle" />
<TextView
android:id="@+id/upvote_ratio_text_view_item_post_detail_video_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="?attr/font_12"
android:fontFamily="?attr/font_family" />
<ImageView <ImageView
android:id="@+id/archived_image_view_item_post_detail_video_autoplay" android:id="@+id/archived_image_view_item_post_detail_video_autoplay"
android:layout_width="20dp" android:layout_width="20dp"

View File

@ -758,6 +758,8 @@
<string name="theme_item_locked_icon_tint_detail">Applied to: Locked icon</string> <string name="theme_item_locked_icon_tint_detail">Applied to: Locked icon</string>
<string name="theme_item_crosspost_icon_tint">Crosspost Icon Color</string> <string name="theme_item_crosspost_icon_tint">Crosspost Icon Color</string>
<string name="theme_item_crosspost_icon_tint_detail">Applied to: Crosspost icon</string> <string name="theme_item_crosspost_icon_tint_detail">Applied to: Crosspost icon</string>
<string name="theme_item_upvote_ratio_icon_tint">Upvote Ratio Icon Color</string>
<string name="theme_item_upvote_ratio_icon_tint_detail">Applied to: Upvote ratio icon</string>
<string name="theme_item_stickied_post_icon_tint">Stickied Post Icon Color</string> <string name="theme_item_stickied_post_icon_tint">Stickied Post Icon Color</string>
<string name="theme_item_stickied_post_icon_tint_detail">Applied to: Stickied post icon</string> <string name="theme_item_stickied_post_icon_tint_detail">Applied to: Stickied post icon</string>
<string name="theme_item_no_preview_post_type_icon_tint">No-preview Post Type Icon Color</string> <string name="theme_item_no_preview_post_type_icon_tint">No-preview Post Type Icon Color</string>
@ -776,6 +778,8 @@
<string name="theme_item_submitter_color_detail">Applied to: Submitter in comments</string> <string name="theme_item_submitter_color_detail">Applied to: Submitter in comments</string>
<string name="theme_item_moderator_color">Moderator</string> <string name="theme_item_moderator_color">Moderator</string>
<string name="theme_item_moderator_color_detail">Applied to: Moderator in comments</string> <string name="theme_item_moderator_color_detail">Applied to: Moderator in comments</string>
<string name="theme_item_current_user_color">Current User</string>
<string name="theme_item_current_user_color_detail">Applied to: Current user in comments</string>
<string name="theme_item_single_comment_thread_background_color">Single Comment Thread Background Color</string> <string name="theme_item_single_comment_thread_background_color">Single Comment Thread Background Color</string>
<string name="theme_item_single_comment_thread_background_color_detail">Applied to: Single Comment</string> <string name="theme_item_single_comment_thread_background_color_detail">Applied to: Single Comment</string>
<string name="theme_item_unread_message_background_color">Unread Message Background Color</string> <string name="theme_item_unread_message_background_color">Unread Message Background Color</string>