mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-30 03:24:44 +01:00
Fix an issue of respecting subreddit recommended comment sort type. Fix a layout issue.
This commit is contained in:
parent
5787a1f7ca
commit
840a10f636
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user