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 @@ +