Remove redundant toolbar from CollapsingToolbarLayout
The new material library has been updated to be able to support
android.widget.Toolbar, so the redundant toolbar has to be removed.
Bug: 176882938
Test: visual verified
Change-Id: Ibada6b9d315c14d79e9f9f8015cbb5e00fbeea38
diff --git a/res/layout/settings_collapsing_base_layout.xml b/res/layout/settings_collapsing_base_layout.xml
index 298f9e1..6473d4a 100644
--- a/res/layout/settings_collapsing_base_layout.xml
+++ b/res/layout/settings_collapsing_base_layout.xml
@@ -22,7 +22,6 @@
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
- android:id="@+id/appbar_layout"
android:layout_width="match_parent"
android:layout_height="180dp"
android:theme="@style/Theme.CollapsingToolbar.Settings">
@@ -38,21 +37,14 @@
app:statusBarScrim="?android:attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:expandedTitleMarginStart="18dp"
- app:toolbarId="@id/tool_bar">
-
- <androidx.appcompat.widget.Toolbar
- android:id="@+id/tool_bar"
- android:layout_width="match_parent"
- android:layout_height="?attr/actionBarSize"
- app:layout_collapseMode="pin"
- app:contentInsetStart="68dp"/>
+ app:toolbarId="@id/action_bar">
<Toolbar
android:id="@+id/action_bar"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- app:layout_collapseMode="pin"
- android:theme="?android:attr/actionBarTheme"/>
+ android:layout_height="?attr/actionBarSize"
+ android:theme="?android:attr/actionBarTheme"
+ app:layout_collapseMode="pin"/>
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 7f214f6..1c2952a 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -288,9 +288,7 @@
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(!isInSetupWizard);
actionBar.setHomeButtonEnabled(!isInSetupWizard);
- // 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);
+ actionBar.setDisplayShowTitleEnabled(true);
}
mSwitchBar = findViewById(R.id.switch_bar);
if (mSwitchBar != null) {
diff --git a/src/com/android/settings/network/telephony/MobileNetworkActivity.java b/src/com/android/settings/network/telephony/MobileNetworkActivity.java
index 92f0054..b1b2321 100644
--- a/src/com/android/settings/network/telephony/MobileNetworkActivity.java
+++ b/src/com/android/settings/network/telephony/MobileNetworkActivity.java
@@ -115,9 +115,7 @@
final ActionBar actionBar = getActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(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);
+ actionBar.setDisplayShowTitleEnabled(true);
}
getProxySubscriptionManager().setLifecycle(getLifecycle());