Do not toggle when clicking cards

This commit is contained in:
topjohnwu 2020-08-09 22:30:38 -07:00
parent d10680187d
commit f5e547944a
3 changed files with 2 additions and 5 deletions

View File

@ -84,10 +84,6 @@ class ModuleItem(val item: Module) : ObservableItem<ModuleItem>() {
val isUpdated get() = item.updated
val isModified get() = isRemoved || isUpdated
fun toggle() {
isEnabled = !isEnabled
}
fun delete(viewModel: ModuleViewModel) {
isRemoved = !isRemoved
viewModel.updateActiveState()

View File

@ -179,9 +179,11 @@ class ModuleViewModel(
override fun refresh(): Job {
return viewModelScope.launch {
state = State.LOADING
loadInstalled()
if (itemsRemote.isEmpty())
loadRemote()
state = State.LOADED
}
}

View File

@ -29,7 +29,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:alpha="@{item.enabled ? 1f : .5f}"
android:onClick="@{() -> item.toggle()}"
tools:layout_gravity="center"
tools:layout_margin="@dimen/l1">