From c666dd623d2efdac2ec5a853cd5761a97ef6fd3a Mon Sep 17 00:00:00 2001
From: OncePunchedMan <64155117+OncePunchedMan@users.noreply.github.com>
Date: Sat, 28 Aug 2021 17:13:09 +0200
Subject: [PATCH] Tracking: replace tick with button (#5768)
* make check only visible after selecting an item
* replace tick with button and send to bottom
* fixed button visibility
* grey btn out
* resolving some bits
* removing the tick from appbar
* remove useless lines, appl insetter
---
.../ui/manga/track/TrackSearchDialog.kt | 24 +++++++++----------
.../main/res/layout/track_search_dialog.xml | 10 +++++++-
app/src/main/res/values/strings.xml | 1 +
3 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchDialog.kt
index 441c3943d..1ed7e0178 100644
--- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchDialog.kt
+++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/track/TrackSearchDialog.kt
@@ -64,23 +64,18 @@ class TrackSearchDialog : DialogController {
// Toolbar stuff
binding!!.toolbar.setNavigationOnClickListener { dialog?.dismiss() }
- binding!!.toolbar.setOnMenuItemClickListener {
- when (it.itemId) {
- R.id.done -> {
- val adapter = adapter ?: return@setOnMenuItemClickListener true
- val item = adapter.items.getOrNull(adapter.selectedItemPosition)
- if (item != null) {
- trackController.presenter.registerTracking(item, service)
- dialog?.dismiss()
- }
- }
+ binding!!.trackBtn.setOnClickListener {
+ val adapter = adapter ?: return@setOnClickListener
+ val item = adapter.items.getOrNull(adapter.selectedItemPosition)
+ if (item != null) {
+ trackController.presenter.registerTracking(item, service)
+ dialog?.dismiss()
}
- true
}
// Create adapter
adapter = TrackSearchAdapter(currentTrackUrl) { which ->
- binding!!.toolbar.menu.findItem(R.id.done).isEnabled = which != null
+ binding!!.trackBtn.isEnabled = which != null
}
binding!!.trackSearchRecyclerview.adapter = adapter
@@ -142,6 +137,11 @@ class TrackSearchDialog : DialogController {
margin(horizontal = true)
}
}
+ binding!!.trackBtn.applyInsetter {
+ type(navigationBars = true) {
+ margin()
+ }
+ }
return AppCompatDialog(activity!!, R.style.ThemeOverlay_Tachiyomi_Dialog_Fullscreen).apply {
setContentView(binding!!.root)
diff --git a/app/src/main/res/layout/track_search_dialog.xml b/app/src/main/res/layout/track_search_dialog.xml
index 8cb6d1ac8..315efbc86 100644
--- a/app/src/main/res/layout/track_search_dialog.xml
+++ b/app/src/main/res/layout/track_search_dialog.xml
@@ -17,7 +17,6 @@
android:layout_height="?attr/actionBarSize"
android:theme="?attr/actionBarTheme"
app:contentInsetStartWithNavigation="0dp"
- app:menu="@menu/track_search"
app:navigationIcon="@drawable/ic_close_24dp"
app:title="@string/add_tracking" />
@@ -86,6 +85,15 @@
+
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 7c9353017..34561cd80 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -400,6 +400,7 @@
One-way sync to update the chapter progress in tracking services. Set up tracking for individual manga entries from their tracking button.
Enhanced services
Services that provide enhanced features for specific sources. Manga are automatically tracked when added to your library.
+ Track
Check for extension updates