diff --git a/app/src/main/java/com/stevesoltys/seedvault/settings/AppStatusAdapter.kt b/app/src/main/java/com/stevesoltys/seedvault/settings/AppStatusAdapter.kt index 63401588..960fbf88 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/settings/AppStatusAdapter.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/settings/AppStatusAdapter.kt @@ -96,15 +96,15 @@ internal class AppStatusAdapter(private val toggleListener: AppStatusToggleListe v.background = clickableBackground if (editMode) { v.setOnClickListener { - switchView.toggle() - item.enabled = switchView.isChecked + checkBox.toggle() + item.enabled = checkBox.isChecked toggleListener.onAppStatusToggled(item) } appInfo.visibility = GONE appStatus.visibility = INVISIBLE progressBar.visibility = INVISIBLE - switchView.visibility = VISIBLE - switchView.isChecked = item.enabled + checkBox.visibility = VISIBLE + checkBox.isChecked = item.enabled } else { v.setOnClickListener(null) v.setOnLongClickListener { @@ -130,7 +130,7 @@ internal class AppStatusAdapter(private val toggleListener: AppStatusToggleListe } appInfo.visibility = VISIBLE } - switchView.visibility = INVISIBLE + checkBox.visibility = INVISIBLE } // show disabled items differently showEnabled(item.enabled) diff --git a/app/src/main/java/com/stevesoltys/seedvault/ui/AppViewHolder.kt b/app/src/main/java/com/stevesoltys/seedvault/ui/AppViewHolder.kt index 19f4f100..e5448d0f 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/ui/AppViewHolder.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/ui/AppViewHolder.kt @@ -15,7 +15,7 @@ import android.widget.ImageView import android.widget.ProgressBar import android.widget.TextView import androidx.recyclerview.widget.RecyclerView -import com.google.android.material.switchmaterial.SwitchMaterial +import com.google.android.material.checkbox.MaterialCheckBox import com.stevesoltys.seedvault.R import com.stevesoltys.seedvault.ui.AppBackupState.FAILED import com.stevesoltys.seedvault.ui.AppBackupState.IN_PROGRESS @@ -32,7 +32,7 @@ internal abstract class AppViewHolder(protected val v: View) : RecyclerView.View protected val appInfo: TextView = v.requireViewById(R.id.appInfo) protected val appStatus: ImageView = v.requireViewById(R.id.appStatus) protected val progressBar: ProgressBar = v.requireViewById(R.id.progressBar) - protected val switchView: SwitchMaterial = v.requireViewById(R.id.switchView) + protected val checkBox: MaterialCheckBox = v.requireViewById(R.id.checkboxView) init { // don't use clickable background by default diff --git a/app/src/main/res/layout/list_item_app_status.xml b/app/src/main/res/layout/list_item_app_status.xml index 8ff13961..29d288b6 100644 --- a/app/src/main/res/layout/list_item_app_status.xml +++ b/app/src/main/res/layout/list_item_app_status.xml @@ -8,9 +8,9 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginStart="40dp" - android:layout_marginEnd="40dp" + android:layout_marginHorizontal="16dp" android:background="?android:selectableItemBackground" + android:paddingHorizontal="24dp" android:paddingTop="8dp" android:paddingBottom="8dp" android:screenReaderFocusable="true"> @@ -35,7 +35,7 @@ android:layout_marginEnd="16dp" android:textColor="?android:textColorPrimary" app:layout_constraintBottom_toTopOf="@+id/appInfo" - app:layout_constraintEnd_toStartOf="@+id/switchView" + app:layout_constraintEnd_toStartOf="@+id/checkboxView" app:layout_constraintStart_toEndOf="@+id/appIcon" app:layout_constraintTop_toTopOf="parent" tools:text="Seedvault Backup" /> @@ -72,8 +72,8 @@ app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" /> -