Clean up track button changes

This commit is contained in:
arkon 2021-08-28 11:19:38 -04:00
parent c666dd623d
commit 925f71af15
3 changed files with 7 additions and 16 deletions

View File

@ -66,9 +66,8 @@ class TrackSearchDialog : DialogController {
binding!!.toolbar.setNavigationOnClickListener { 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)
adapter.items.getOrNull(adapter.selectedItemPosition)?.let {
trackController.presenter.registerTracking(it, service)
dialog?.dismiss()
}
}

View File

@ -85,12 +85,16 @@
</FrameLayout>
<com.google.android.material.divider.MaterialDivider
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:id="@+id/track_btn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginVertical="4dp"
android:layout_marginVertical="8dp"
android:text="@string/action_track"
android:enabled="false" />

View File

@ -1,12 +0,0 @@
<?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">
<item
android:id="@+id/done"
android:enabled="false"
android:icon="@drawable/ic_check_24dp"
android:title="@android:string/ok"
app:iconTint="?attr/colorOnToolbar"
app:showAsAction="ifRoom" />
</menu>