]> git.ktnx.net Git - mobile-ledger.git/commitdiff
drop collapsing toolbar layout, plain toolbar is fine
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 3 Mar 2021 12:32:31 +0000 (12:32 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Wed, 3 Mar 2021 12:32:31 +0000 (12:32 +0000)
same as the other places

app/src/main/java/net/ktnx/mobileledger/ui/templates/TemplatesActivity.java
app/src/main/res/layout/activity_templates.xml

index 7bc722203fa405eec10572791e111102123106d7..ed652879e633bc53d536586479a99b9d0c656370 100644 (file)
@@ -79,7 +79,7 @@ public class TemplatesActivity extends CrashReportingActivity
 
         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 {
@@ -87,7 +87,7 @@ public class TemplatesActivity extends CrashReportingActivity
             }
         });
 
-        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()
@@ -125,14 +125,14 @@ public class TemplatesActivity extends CrashReportingActivity
     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
index 30c998dfb3d18f4e21ad816512671bfb6b4ee3e0..a60a650f0779027b0c07dfefd5c832766bcddd50 100644 (file)
     <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