Add CollapsingToolbarLayout for sub settings

Settings app is planning to make toolbar collapsible for next
Android release. This CL is to add a new layout for
CollapsingToolbarLayout in the Settings app and to update the theme
correspondly. This feature will be controlled by feature flag, which
makes Settings app compacitible with the existing layout.

Bug: 174451673
Test: manul test and visual verification
1) Enable the feature and open Settings app
2) Navigate to each sub page and check if toolbar is collapsible

Change-Id: Ibef524bbaa7ae3f0a43db7e40e599f42e009437f
This commit is contained in:
Mill Chen
2021-01-06 07:46:46 +08:00
parent 90c976b8c0
commit 14cfd2f2ca
8 changed files with 187 additions and 10 deletions

View File

@@ -288,7 +288,9 @@ public class SettingsActivity extends SettingsBaseActivity
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(!isInSetupWizard);
actionBar.setHomeButtonEnabled(!isInSetupWizard);
actionBar.setDisplayShowTitleEnabled(true);
// TODO(b/176882938): Enable title after material component updated
// If CollapsingToolbarLayout is applied, the old action bar won't show title.
actionBar.setDisplayShowTitleEnabled(mCollapsingToolbarLayout == null);
}
mSwitchBar = findViewById(R.id.switch_bar);
if (mSwitchBar != null) {