diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleFragment.kt index 6da0d7b4e..4eadb64a4 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleFragment.kt @@ -5,6 +5,8 @@ import android.view.View import com.topjohnwu.magisk.R import com.topjohnwu.magisk.arch.BaseFragment import com.topjohnwu.magisk.databinding.FragmentModuleMd2Binding +import com.topjohnwu.magisk.databinding.RvItem +import com.topjohnwu.magisk.databinding.adapterOf import com.topjohnwu.magisk.di.viewModel import rikka.recyclerview.addEdgeSpacing import rikka.recyclerview.addInvalidateItemDecorationsObserver @@ -26,6 +28,7 @@ class ModuleFragment : BaseFragment() { super.onViewCreated(view, savedInstanceState) binding.moduleList.apply { + adapter = adapterOf() addEdgeSpacing(top = R.dimen.l_50, bottom = R.dimen.l1) addItemSpacing(R.dimen.l1, R.dimen.l_50, R.dimen.l1) fixEdgeEffect() diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt index 34f11e694..7d9a67abc 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/module/ModuleViewModel.kt @@ -8,7 +8,6 @@ import com.topjohnwu.magisk.core.Info import com.topjohnwu.magisk.core.model.module.LocalModule import com.topjohnwu.magisk.core.model.module.OnlineModule import com.topjohnwu.magisk.databinding.RvItem -import com.topjohnwu.magisk.databinding.adapterOf import com.topjohnwu.magisk.databinding.diffListOf import com.topjohnwu.magisk.databinding.itemBindingOf import com.topjohnwu.magisk.events.SelectModuleEvent @@ -26,7 +25,6 @@ class ModuleViewModel : BaseViewModel() { private val itemsInstalled = diffListOf() - val adapter = adapterOf() val items = MergeObservableList() val itemBinding = itemBindingOf { it.bindExtra(BR.viewModel, this) diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.kt index 6fbfbc01e..2e63d4251 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserFragment.kt @@ -4,7 +4,9 @@ import android.os.Bundle import android.view.View import com.topjohnwu.magisk.R import com.topjohnwu.magisk.arch.BaseFragment +import com.topjohnwu.magisk.databinding.AnyDiffRvItem import com.topjohnwu.magisk.databinding.FragmentSuperuserMd2Binding +import com.topjohnwu.magisk.databinding.adapterOf import com.topjohnwu.magisk.di.viewModel import rikka.recyclerview.addEdgeSpacing import rikka.recyclerview.addItemSpacing @@ -24,6 +26,7 @@ class SuperuserFragment : BaseFragment() { super.onViewCreated(view, savedInstanceState) binding.superuserList.apply { + adapter = adapterOf() addEdgeSpacing(top = R.dimen.l_50, bottom = R.dimen.l1) addItemSpacing(R.dimen.l1, R.dimen.l_50, R.dimen.l1) fixEdgeEffect() diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt b/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt index ffde23fc9..50dcff0ee 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserViewModel.kt @@ -10,7 +10,6 @@ import com.topjohnwu.magisk.core.model.su.SuPolicy import com.topjohnwu.magisk.core.utils.BiometricHelper import com.topjohnwu.magisk.core.utils.currentLocale import com.topjohnwu.magisk.databinding.AnyDiffRvItem -import com.topjohnwu.magisk.databinding.adapterOf import com.topjohnwu.magisk.databinding.diffListOf import com.topjohnwu.magisk.databinding.itemBindingOf import com.topjohnwu.magisk.events.SnackbarEvent @@ -33,7 +32,6 @@ class SuperuserViewModel( private val itemsPolicies = diffListOf() private val itemsHelpers = ObservableArrayList() - val adapter = adapterOf() val items = MergeObservableList() .insertList(itemsHelpers) .insertList(itemsPolicies) diff --git a/app/src/main/res/layout/fragment_module_md2.xml b/app/src/main/res/layout/fragment_module_md2.xml index c08c9283f..1d5548baa 100644 --- a/app/src/main/res/layout/fragment_module_md2.xml +++ b/app/src/main/res/layout/fragment_module_md2.xml @@ -19,7 +19,6 @@