|
@@ -64,23 +64,18 @@ class TrackSearchDialog : DialogController {
|
|
|
|
|
|
// Toolbar stuff
|
|
// Toolbar stuff
|
|
binding!!.toolbar.setNavigationOnClickListener { dialog?.dismiss() }
|
|
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
|
|
// Create adapter
|
|
adapter = TrackSearchAdapter(currentTrackUrl) { which ->
|
|
adapter = TrackSearchAdapter(currentTrackUrl) { which ->
|
|
- binding!!.toolbar.menu.findItem(R.id.done).isEnabled = which != null
|
|
|
|
|
|
+ binding!!.trackBtn.isEnabled = which != null
|
|
}
|
|
}
|
|
binding!!.trackSearchRecyclerview.adapter = adapter
|
|
binding!!.trackSearchRecyclerview.adapter = adapter
|
|
|
|
|
|
@@ -142,6 +137,11 @@ class TrackSearchDialog : DialogController {
|
|
margin(horizontal = true)
|
|
margin(horizontal = true)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ binding!!.trackBtn.applyInsetter {
|
|
|
|
+ type(navigationBars = true) {
|
|
|
|
+ margin()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
return AppCompatDialog(activity!!, R.style.ThemeOverlay_Tachiyomi_Dialog_Fullscreen).apply {
|
|
return AppCompatDialog(activity!!, R.style.ThemeOverlay_Tachiyomi_Dialog_Fullscreen).apply {
|
|
setContentView(binding!!.root)
|
|
setContentView(binding!!.root)
|