Added CollapsingToolbarLayout in settings
This commit is contained in:
parent
42b9ea4107
commit
c80293f33a
2 changed files with 17 additions and 9 deletions
|
@ -45,11 +45,10 @@ class SettingsActivity : AbsBaseActivity(), ColorCallback, OnThemeChangedListene
|
|||
}
|
||||
|
||||
private fun setupToolbar() {
|
||||
setTitle(R.string.action_settings)
|
||||
applyToolbar(binding.toolbar)
|
||||
val navController: NavController = findNavController(R.id.contentFrame)
|
||||
navController.addOnDestinationChangedListener { _, _, _ ->
|
||||
binding.toolbar.title =
|
||||
binding.collapsingToolbarLayout.title =
|
||||
navController.currentDestination?.let { getStringFromDestination(it) }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,13 +14,22 @@
|
|||
android:fitsSystemWindows="true"
|
||||
app:liftOnScroll="true">
|
||||
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:id="@+id/collapsingToolbarLayout"
|
||||
style="?attr/collapsingToolbarLayoutLargeStyle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/collapsingToolbarLayoutLargeSize"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">
|
||||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Toolbar"
|
||||
android:layout_height="?actionBarSize"
|
||||
app:layout_collapseMode="pin"
|
||||
app:navigationIcon="@drawable/ic_keyboard_backspace_black"
|
||||
app:titleTextAppearance="@style/ToolbarTextAppearanceNormal"
|
||||
tools:title="@string/action_settings" />
|
||||
</com.google.android.material.appbar.CollapsingToolbarLayout>
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
|
Loading…
Reference in a new issue