aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-10-19 16:17:58 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-10-19 16:17:58 +0000
commit840a10f636dbeeeaaba45e6d3eb274e0865a58c3 (patch)
treedb89bab76dfd8f3df91aa257f6ef1bf98ee9d3b2 /app/src/main
parent5787a1f7ca5a59664d6fb4019a9d616a53be58cf (diff)
downloadinfinity-for-reddit-840a10f636dbeeeaaba45e6d3eb274e0865a58c3.tar
infinity-for-reddit-840a10f636dbeeeaaba45e6d3eb274e0865a58c3.tar.gz
infinity-for-reddit-840a10f636dbeeeaaba45e6d3eb274e0865a58c3.tar.bz2
infinity-for-reddit-840a10f636dbeeeaaba45e6d3eb274e0865a58c3.tar.lz
infinity-for-reddit-840a10f636dbeeeaaba45e6d3eb274e0865a58c3.tar.xz
infinity-for-reddit-840a10f636dbeeeaaba45e6d3eb274e0865a58c3.tar.zst
infinity-for-reddit-840a10f636dbeeeaaba45e6d3eb274e0865a58c3.zip
Fix an issue of respecting subreddit recommended comment sort type. Fix a layout issue.
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java21
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java8
2 files changed, 15 insertions, 14 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java
index fe1b851e..daf0cbb7 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/ViewPostDetailActivity.java
@@ -510,7 +510,15 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
mSingleCommentId = getIntent().getStringExtra(EXTRA_SINGLE_COMMENT_ID);
if (savedInstanceState == null) {
- if (!mRespectSubredditRecommendedSortType) {
+ if (mSingleCommentId != null) {
+ isSingleCommentThreadMode = true;
+ }
+ mMessageFullname = getIntent().getStringExtra(EXTRA_MESSAGE_FULLNAME);
+ mNewAccountName = getIntent().getStringExtra(EXTRA_NEW_ACCOUNT_NAME);
+ }
+
+ if (savedInstanceState == null) {
+ if (!mRespectSubredditRecommendedSortType || isSingleCommentThreadMode) {
sortType = mSortTypeSharedPreferences.getString(SharedPreferencesUtils.SORT_TYPE_POST_COMMENT, SortType.Type.BEST.value.toUpperCase());
if (sortType != null) {
mToolbar.setTitle(new SortType(SortType.Type.valueOf(sortType)).getType().fullName);
@@ -523,14 +531,6 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
}
}
- if (savedInstanceState == null) {
- if (mSingleCommentId != null) {
- isSingleCommentThreadMode = true;
- }
- mMessageFullname = getIntent().getStringExtra(EXTRA_MESSAGE_FULLNAME);
- mNewAccountName = getIntent().getStringExtra(EXTRA_NEW_ACCOUNT_NAME);
- }
-
orientation = resources.getConfiguration().orientation;
if (!mNullAccessToken && mAccessToken == null) {
@@ -1329,9 +1329,10 @@ public class ViewPostDetailActivity extends BaseActivity implements FlairBottomS
});
}
- public void changeToSingleThreadMode() {
+ public void changeToNomalThreadMode() {
isSingleCommentThreadMode = false;
mSingleCommentId = null;
+ mRespectSubredditRecommendedSortType = mSharedPreferences.getBoolean(SharedPreferencesUtils.RESPECT_SUBREDDIT_RECOMMENDED_COMMENT_SORT_TYPE, false);
refresh(false, true);
}
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java
index 96629464..3ae368c9 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Adapter/CommentAndPostRecyclerViewAdapter.java
@@ -3784,12 +3784,12 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
if (mActivity != null && mActivity instanceof ViewPostDetailActivity) {
mIsSingleCommentThreadMode = false;
mSingleCommentId = null;
- ((ViewPostDetailActivity) mActivity).changeToSingleThreadMode();
+ ((ViewPostDetailActivity) mActivity).changeToNomalThreadMode();
}
-
- itemView.setBackgroundColor(mColorAccent);
- ((TextView) itemView).setTextColor(mColorAccent);
});
+
+ itemView.setBackgroundTintList(ColorStateList.valueOf(mCommentBackgroundColor));
+ ((TextView) itemView).setTextColor(mColorAccent);
}
}
}