Fix themeing problems for recently-added features.

This commit is contained in:
Alex Ning 2020-07-05 11:34:05 +08:00
parent 90f741e9e1
commit 9ee22c3098
4 changed files with 36 additions and 17 deletions

View File

@ -827,8 +827,9 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
mCommentMarkwon.setMarkdown(((CommentViewHolder) holder).commentMarkdownView, comment.getCommentMarkdown());
((CommentViewHolder) holder).scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
comment.getScore() + comment.getVoteType()));
((CommentViewHolder) holder).topScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
comment.getScore() + comment.getVoteType()) + " pts");
((CommentViewHolder) holder).topScoreTextView.setText(mActivity.getString(R.string.top_score,
Utils.getNVotes(mShowAbsoluteNumberOfVotes,
comment.getScore() + comment.getVoteType())));
((CommentViewHolder) holder).itemView.setPadding(comment.getDepth() * 8, 0, 0, 0);
if (comment.getDepth() > 0) {
@ -927,7 +928,8 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
} else {
((CommentFullyCollapsedViewHolder) holder).commentTimeTextView.setText(Utils.getFormattedTime(mLocale, comment.getCommentTimeMillis(), mTimeFormatPattern));
}
((CommentFullyCollapsedViewHolder) holder).scoreTextView.setText(Integer.toString(comment.getScore()));
((CommentFullyCollapsedViewHolder) holder).scoreTextView.setText(mActivity.getString(R.string.top_score,
Utils.getNVotes(mShowAbsoluteNumberOfVotes, comment.getScore() + comment.getVoteType())));
((CommentFullyCollapsedViewHolder) holder).itemView.setPadding(comment.getDepth() * 8, 0, 0, 0);
if (comment.getDepth() > 0) {
@ -2896,8 +2898,9 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
comment.getScore() + comment.getVoteType()));
topScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
comment.getScore() + comment.getVoteType()) + " pts");
topScoreTextView.setText(mActivity.getString(R.string.top_score,
Utils.getNVotes(mShowAbsoluteNumberOfVotes,
comment.getScore() + comment.getVoteType())));
VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() {
@Override
@ -2915,8 +2918,9 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
downvoteButton.setColorFilter(mCommentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
comment.getScore() + comment.getVoteType()));
topScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
comment.getScore() + comment.getVoteType()) + " pts");
topScoreTextView.setText(mActivity.getString(R.string.top_score,
Utils.getNVotes(mShowAbsoluteNumberOfVotes,
comment.getScore() + comment.getVoteType())));
}
@Override
@ -2958,8 +2962,9 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
comment.getScore() + comment.getVoteType()));
topScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
comment.getScore() + comment.getVoteType()) + " pts");
topScoreTextView.setText(mActivity.getString(R.string.top_score,
Utils.getNVotes(mShowAbsoluteNumberOfVotes,
comment.getScore() + comment.getVoteType())));
VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() {
@Override
@ -2977,8 +2982,9 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
upvoteButton.setColorFilter(mCommentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
comment.getScore() + comment.getVoteType()));
topScoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
comment.getScore() + comment.getVoteType()) + " pts");
topScoreTextView.setText(mActivity.getString(R.string.top_score,
Utils.getNVotes(mShowAbsoluteNumberOfVotes,
comment.getScore() + comment.getVoteType())));
}
@Override
@ -3129,7 +3135,7 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
itemView.setBackgroundColor(mFullyCollapsedCommentBackgroundColor);
usernameTextView.setTextColor(mUsernameColor);
scoreTextView.setTextColor(mCommentIconAndInfoColor);
scoreTextView.setTextColor(mSecondaryTextColor);
commentTimeTextView.setTextColor(mSecondaryTextColor);
if (mShowCommentDivider) {

View File

@ -155,6 +155,14 @@ public class CustomThemeSharedPreferencesUtils {
editor.putInt(COMMENT_VERTICAL_BAR_COLOR_7, customTheme.commentVerticalBarColor7);
editor.putInt(FAB_ICON_COLOR, customTheme.fabIconColor);
editor.putInt(CHIP_TEXT_COLOR, customTheme.chipTextColor);
editor.putInt(LINK_COLOR, customTheme.linkColor);
editor.putInt(RECEIVED_MESSAGE_TEXT_COLOR, customTheme.receivedMessageTextColor);
editor.putInt(SENT_MESSAGE_TEXT_COLOR, customTheme.sentMessageTextColor);
editor.putInt(RECEIVED_MESSAGE_BACKROUND_COLOR, customTheme.receivedMessageBackgroundColor);
editor.putInt(SENT_MESSAGE_BACKGROUND_COLOR, customTheme.sentMessageBackgroundColor);
editor.putInt(SEND_MESSAGE_ICON_COLOR, customTheme.sendMessageIconColor);
editor.putInt(FULLY_COLLAPSED_COMMENT_BACKGROUND_COLOR, customTheme.fullyCollapsedCommentBackgroundColor);
editor.putInt(AWARDED_COMMENT_BACKGROUND_COLOR, customTheme.awardedCommentBackgroundColor);
editor.putBoolean(LIGHT_STATUS_BAR, customTheme.isLightStatusBar);
editor.putBoolean(LIGHT_NAV_BAR, customTheme.isLightNavBar);
editor.putBoolean(CHANGE_STATUS_BAR_ICON_COLOR_AFTER_TOOLBAR_COLLAPSED_IN_IMMERSIVE_INTERFACE, customTheme.isChangeStatusBarIconColorAfterToolbarCollapsedInImmersiveInterface);

View File

@ -18,8 +18,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:paddingStart="16dp"
android:paddingEnd="8dp"
android:textSize="?attr/font_default"
@ -29,7 +29,10 @@
android:id="@+id/score_text_view_item_comment_fully_collapsed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:paddingStart="8dp"
android:paddingEnd="8dp"
android:textSize="?attr/font_default"
android:fontFamily="?attr/font_family" />
@ -38,8 +41,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:paddingStart="8dp"
android:paddingEnd="16dp"
android:textSize="?attr/font_default"

View File

@ -816,4 +816,6 @@
<string name="load_video_in_redgifs">Try loading the video on Redgifs</string>
<string name="top_score">%1$s pts</string>
</resources>