瀏覽代碼

Show "Start" in chapters FAB if nothing is read yet

arkon 4 年之前
父節點
當前提交
f9baff0e90

+ 5 - 0
app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt

@@ -284,6 +284,11 @@ class ChaptersController :
             }
             actionMode?.invalidate()
         }
+
+        val context = view?.context
+        if (context != null && chapters.any { it.read }) {
+            binding.fab.text = context.getString(R.string.action_resume)
+        }
     }
 
     private fun fetchChaptersFromSource(manualFetch: Boolean = false) {

+ 1 - 1
app/src/main/res/layout/chapters_controller.xml

@@ -53,7 +53,7 @@
     <com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
         android:id="@+id/fab"
         style="@style/Theme.Widget.FAB"
-        android:text="@string/action_resume"
+        android:text="@string/action_start"
         app:icon="@drawable/ic_play_arrow_24dp"
         app:layout_anchor="@id/recycler" />
 

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -76,6 +76,7 @@
     <string name="action_next_chapter">Next chapter</string>
     <string name="action_retry">Retry</string>
     <string name="action_remove">Remove</string>
+    <string name="action_start">Start</string>
     <string name="action_resume">Resume</string>
     <string name="action_move">Move</string>
     <string name="action_open_in_browser">Open in browser</string>