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!!.toolbar.setNavigationOnClickListener { dialog?.dismiss() }
binding!!.trackBtn.setOnClickListener { binding!!.trackBtn.setOnClickListener {
val adapter = adapter ?: return@setOnClickListener val adapter = adapter ?: return@setOnClickListener
val item = adapter.items.getOrNull(adapter.selectedItemPosition) adapter.items.getOrNull(adapter.selectedItemPosition)?.let {
if (item != null) { trackController.presenter.registerTracking(it, service)
trackController.presenter.registerTracking(item, service)
dialog?.dismiss() dialog?.dismiss()
} }
} }

View File

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