Skip to content

Commit

Permalink
Merge pull request #13453 from brave/news-orientation-after-optin
Browse files Browse the repository at this point in the history
[Android] fixes orientation issue after turning news on
  • Loading branch information
alexsafe authored May 25, 2022
2 parents c84854a + e044d94 commit f7aba15
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ private void refreshFeed() {

private void keepPosition(int prevScrollPosition, int prevRecyclerViewPosition,
int prevRecyclerViewItemPosition) {
if (!mIsNewsOn || !mIsShowNewsOn || (mIsNewsOn && mIsShowOptin)) {
if (!mIsNewsOn || !mIsShowNewsOn || (mIsNewsOn && mIsShowOptin && !mIsShowNewsOn)) {
return;
}
processFeed();
Expand Down Expand Up @@ -1369,6 +1369,8 @@ public void onClick(View v) {
sharedPreferencesEditor.apply();
BravePrefServiceBridge.getInstance().setNewsOptIn(true);
BravePrefServiceBridge.getInstance().setShowNews(true);
mIsNewsOn = BravePrefServiceBridge.getInstance().getNewsOptIn();
mIsShowNewsOn = BravePrefServiceBridge.getInstance().getShowNews();
if (BraveActivity.getBraveActivity() != null) {
BraveActivity.getBraveActivity().inflateNewsSettingsBar();
mSettingsBar =
Expand Down

0 comments on commit f7aba15

Please sign in to comment.