瀏覽代碼

Fix overflowed action toolbar items

arkon 3 年之前
父節點
當前提交
c74d8cf499

+ 2 - 1
app/src/main/res/layout/action_toolbar.xml

@@ -25,7 +25,8 @@
             <androidx.appcompat.widget.ActionMenuView
                 android:id="@+id/menu"
                 android:layout_width="match_parent"
-                android:layout_height="match_parent" />
+                android:layout_height="match_parent"
+                android:layout_gravity="center" />
 
         </com.google.android.material.appbar.MaterialToolbar>
 

+ 16 - 8
app/src/main/res/menu/chapter_selection.xml

@@ -1,54 +1,62 @@
 <?xml version="1.0" encoding="utf-8"?>
 <menu xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto">
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools">
 
     <item
         android:id="@+id/action_download"
         android:icon="@drawable/ic_get_app_24dp"
         android:title="@string/action_download"
         app:iconTint="?attr/colorOnToolbar"
-        app:showAsAction="ifRoom" />
+        app:showAsAction="always"
+        tools:ignore="AlwaysShowAction" />
 
     <item
         android:id="@+id/action_delete"
         android:icon="@drawable/ic_delete_24dp"
         android:title="@string/action_delete"
         app:iconTint="?attr/colorOnToolbar"
-        app:showAsAction="ifRoom" />
+        app:showAsAction="always"
+        tools:ignore="AlwaysShowAction" />
 
     <item
         android:id="@+id/action_bookmark"
         android:icon="@drawable/ic_bookmark_border_24dp"
         android:title="@string/action_bookmark"
         app:iconTint="?attr/colorOnToolbar"
-        app:showAsAction="ifRoom" />
+        app:showAsAction="always"
+        tools:ignore="AlwaysShowAction" />
 
     <item
         android:id="@+id/action_remove_bookmark"
         android:icon="@drawable/ic_bookmark_24dp"
         android:title="@string/action_remove_bookmark"
         app:iconTint="?attr/colorOnToolbar"
-        app:showAsAction="ifRoom" />
+        app:showAsAction="always"
+        tools:ignore="AlwaysShowAction" />
 
     <item
         android:id="@+id/action_mark_as_read"
         android:icon="@drawable/ic_done_24dp"
         android:title="@string/action_mark_as_read"
         app:iconTint="?attr/colorOnToolbar"
-        app:showAsAction="ifRoom" />
+        app:showAsAction="always"
+        tools:ignore="AlwaysShowAction" />
 
     <item
         android:id="@+id/action_mark_as_unread"
         android:icon="@drawable/ic_done_outline_24dp"
         android:title="@string/action_mark_as_unread"
         app:iconTint="?attr/colorOnToolbar"
-        app:showAsAction="ifRoom" />
+        app:showAsAction="always"
+        tools:ignore="AlwaysShowAction" />
 
     <item
         android:id="@+id/action_mark_previous_as_read"
         android:icon="@drawable/ic_done_prev_24dp"
         android:title="@string/action_mark_previous_as_read"
         app:iconTint="?attr/colorOnToolbar"
-        app:showAsAction="ifRoom" />
+        app:showAsAction="always"
+        tools:ignore="AlwaysShowAction" />
 
 </menu>

+ 12 - 6
app/src/main/res/menu/library_selection.xml

@@ -1,40 +1,46 @@
 <?xml version="1.0" encoding="utf-8"?>
 <menu xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto">
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools">
 
     <item
         android:id="@+id/action_move_to_category"
         android:icon="@drawable/ic_label_24dp"
         android:title="@string/action_move_category"
         app:iconTint="?attr/colorOnToolbar"
-        app:showAsAction="ifRoom" />
+        app:showAsAction="always"
+        tools:ignore="AlwaysShowAction" />
 
     <item
         android:id="@+id/action_download_unread"
         android:icon="@drawable/ic_get_app_24dp"
         android:title="@string/action_download_unread"
         app:iconTint="?attr/colorOnToolbar"
-        app:showAsAction="ifRoom" />
+        app:showAsAction="always"
+        tools:ignore="AlwaysShowAction" />
 
     <item
         android:id="@+id/action_mark_as_read"
         android:icon="@drawable/ic_done_24dp"
         android:title="@string/action_mark_as_read"
         app:iconTint="?attr/colorOnToolbar"
-        app:showAsAction="ifRoom" />
+        app:showAsAction="always"
+        tools:ignore="AlwaysShowAction" />
 
     <item
         android:id="@+id/action_mark_as_unread"
         android:icon="@drawable/ic_done_outline_24dp"
         android:title="@string/action_mark_as_unread"
         app:iconTint="?attr/colorOnToolbar"
-        app:showAsAction="ifRoom" />
+        app:showAsAction="always"
+        tools:ignore="AlwaysShowAction" />
 
     <item
         android:id="@+id/action_delete"
         android:icon="@drawable/ic_delete_24dp"
         android:title="@string/action_delete"
         app:iconTint="?attr/colorOnToolbar"
-        app:showAsAction="ifRoom" />
+        app:showAsAction="always"
+        tools:ignore="AlwaysShowAction" />
 
 </menu>

+ 14 - 7
app/src/main/res/menu/updates_chapter_selection.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
+<menu xmlns:tools="http://schemas.android.com/tools"
+    xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto">
 
     <item
@@ -7,41 +8,47 @@
         android:icon="@drawable/ic_get_app_24dp"
         android:title="@string/action_download"
         app:iconTint="?attr/colorOnToolbar"
-        app:showAsAction="ifRoom" />
+        app:showAsAction="always"
+        tools:ignore="AlwaysShowAction" />
 
     <item
         android:id="@+id/action_delete"
         android:icon="@drawable/ic_delete_24dp"
         android:title="@string/action_delete"
         app:iconTint="?attr/colorOnToolbar"
-        app:showAsAction="ifRoom" />
+        app:showAsAction="always"
+        tools:ignore="AlwaysShowAction" />
 
     <item
         android:id="@+id/action_bookmark"
         android:icon="@drawable/ic_bookmark_border_24dp"
         android:title="@string/action_bookmark"
         app:iconTint="?attr/colorOnToolbar"
-        app:showAsAction="ifRoom" />
+        app:showAsAction="always"
+        tools:ignore="AlwaysShowAction" />
 
     <item
         android:id="@+id/action_remove_bookmark"
         android:icon="@drawable/ic_bookmark_24dp"
         android:title="@string/action_remove_bookmark"
         app:iconTint="?attr/colorOnToolbar"
-        app:showAsAction="ifRoom" />
+        app:showAsAction="always"
+        tools:ignore="AlwaysShowAction" />
 
     <item
         android:id="@+id/action_mark_as_read"
         android:icon="@drawable/ic_done_24dp"
         android:title="@string/action_mark_as_read"
         app:iconTint="?attr/colorOnToolbar"
-        app:showAsAction="ifRoom" />
+        app:showAsAction="always"
+        tools:ignore="AlwaysShowAction" />
 
     <item
         android:id="@+id/action_mark_as_unread"
         android:icon="@drawable/ic_done_outline_24dp"
         android:title="@string/action_mark_as_unread"
         app:iconTint="?attr/colorOnToolbar"
-        app:showAsAction="ifRoom" />
+        app:showAsAction="always"
+        tools:ignore="AlwaysShowAction" />
 
 </menu>