diff --git a/app/src/main/java/com/vanced/manager/adapter/AppListAdapter.kt b/app/src/main/java/com/vanced/manager/adapter/AppListAdapter.kt index 79e1ca9f..d6d24f3d 100644 --- a/app/src/main/java/com/vanced/manager/adapter/AppListAdapter.kt +++ b/app/src/main/java/com/vanced/manager/adapter/AppListAdapter.kt @@ -23,11 +23,10 @@ class AppListAdapter( private val tooltip: ViewTooltip ) : RecyclerView.Adapter() { - val apps = mutableListOf() + private val apps = mutableListOf() private val dataModels = mutableListOf() private val rootDataModels = mutableListOf() private val prefs = getDefaultSharedPreferences(context) - private var itemCount = 0 private val isRoot = prefs.managerVariant == "root" @@ -85,7 +84,7 @@ class AppListAdapter( } } - override fun getItemCount(): Int = itemCount + override fun getItemCount(): Int = apps.size init { @@ -96,7 +95,6 @@ class AppListAdapter( dataModels.add(viewModel.vancedModel.value) } apps.add(context.getString(R.string.vanced)) - itemCount++ } if (prefs.enableMusic) { @@ -106,13 +104,11 @@ class AppListAdapter( dataModels.add(viewModel.musicModel.value) } apps.add(context.getString(R.string.music)) - itemCount++ } if (!isRoot) { dataModels.add(viewModel.microgModel.value) apps.add(context.getString(R.string.microg)) - itemCount++ } }