Merge "Fix the highlight error and remove the empty card" into sc-v2-dev am: e06fb6348a

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/16421586

Change-Id: Idacf7580710ead66aeec0c46261e447865f6247d
This commit is contained in:
Jason Chiu
2021-12-09 09:23:57 +00:00
committed by Automerger Merge Worker
2 changed files with 8 additions and 8 deletions

View File

@@ -125,11 +125,8 @@ public class SettingsHomepageActivity extends FragmentActivity implements
} }
Log.i(TAG, "showHomepageWithSuggestion: " + showSuggestion); Log.i(TAG, "showHomepageWithSuggestion: " + showSuggestion);
final View homepageView = mHomepageView; final View homepageView = mHomepageView;
if (!mIsTwoPaneLastTime) { mSuggestionView.setVisibility(showSuggestion ? View.VISIBLE : View.GONE);
mSuggestionView.setVisibility(showSuggestion ? View.VISIBLE : View.GONE); mTwoPaneSuggestionView.setVisibility(showSuggestion ? View.VISIBLE : View.GONE);
} else {
mTwoPaneSuggestionView.setVisibility(showSuggestion ? View.VISIBLE : View.GONE);
}
mHomepageView = null; mHomepageView = null;
mLoadedListeners.forEach(listener -> listener.onHomepageLoaded()); mLoadedListeners.forEach(listener -> listener.onHomepageLoaded());

View File

@@ -54,6 +54,7 @@ public class TopLevelSettings extends DashboardFragment implements
private static final String PREF_KEY_SUPPORT = "top_level_support"; private static final String PREF_KEY_SUPPORT = "top_level_support";
private TopLevelHighlightMixin mHighlightMixin; private TopLevelHighlightMixin mHighlightMixin;
private boolean mFirstStarted = true;
public TopLevelSettings() { public TopLevelSettings() {
final Bundle args = new Bundle(); final Bundle args = new Bundle();
@@ -135,9 +136,11 @@ public class TopLevelSettings extends DashboardFragment implements
@Override @Override
public void onStart() { public void onStart() {
// Set default highlight menu key for 1-pane homepage since it will show the placeholder if (mFirstStarted) {
// page once changing back to 2-pane. mFirstStarted = false;
if (!ActivityEmbeddingUtils.isTwoPaneResolution(getActivity())) { } else if (!ActivityEmbeddingUtils.isTwoPaneResolution(getActivity())) {
// Set default highlight menu key for 1-pane homepage since it will show the placeholder
// page once changing back to 2-pane.
setHighlightMenuKey(getString(SettingsHomepageActivity.DEFAULT_HIGHLIGHT_MENU_KEY), setHighlightMenuKey(getString(SettingsHomepageActivity.DEFAULT_HIGHLIGHT_MENU_KEY),
/* scrollNeeded= */ false); /* scrollNeeded= */ false);
} }