navController.addOnDestinationChangedListener((controller, destination, arguments) -> {
if (destination.getId() == R.id.templateListFragment) {
- b.toolbarLayout.setTitle(getString(R.string.title_activity_templates));
+ b.toolbar.setTitle(getString(R.string.title_activity_templates));
b.fab.setImageResource(R.drawable.ic_add_white_24dp);
}
else {
}
});
- b.toolbarLayout.setTitle(getString(R.string.title_activity_templates));
+ b.toolbar.setTitle(getString(R.string.title_activity_templates));
b.fab.setOnClickListener(v -> {
if (navController.getCurrentDestination()
public void onEditTemplate(Long id) {
if (id == null) {
navController.navigate(R.id.action_templateListFragment_to_templateDetailsFragment);
- b.toolbarLayout.setTitle(getString(R.string.title_new_template));
+ b.toolbar.setTitle(getString(R.string.title_new_template));
}
else {
Bundle bundle = new Bundle();
bundle.putLong(TemplateDetailsFragment.ARG_TEMPLATE_ID, id);
navController.navigate(R.id.action_templateListFragment_to_templateDetailsFragment,
bundle);
- b.toolbarLayout.setTitle(getString(R.string.title_edit_template));
+ b.toolbar.setTitle(getString(R.string.title_edit_template));
}
}
@Override
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
- android:layout_height="@dimen/app_bar_height"
+ android:layout_height="@dimen/toolbar_height"
android:fitsSystemWindows="true"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
>
- <com.google.android.material.appbar.CollapsingToolbarLayout
- android:id="@+id/toolbar_layout"
+ <androidx.appcompat.widget.Toolbar
+ android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:fitsSystemWindows="true"
- app:contentScrim="?attr/colorPrimary"
- app:layout_scrollFlags="scroll|exitUntilCollapsed"
- app:toolbarId="@+id/toolbar"
- >
-
- <androidx.appcompat.widget.Toolbar
- android:id="@+id/toolbar"
- android:layout_width="match_parent"
- android:layout_height="?attr/actionBarSize"
- app:layout_collapseMode="pin"
- app:popupTheme="@style/ThemeOverlay.AppCompat.DayNight"
- />
- </com.google.android.material.appbar.CollapsingToolbarLayout>
+ app:layout_collapseMode="pin"
+ app:popupTheme="@style/ThemeOverlay.AppCompat.DayNight"
+ />
</com.google.android.material.appbar.AppBarLayout>
<androidx.core.widget.NestedScrollView