Skip to content
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.

Commit

Permalink
removed useless variable
Browse files Browse the repository at this point in the history
  • Loading branch information
X1nto committed Feb 5, 2021
1 parent f99c20c commit 0abf89a
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ class AppListAdapter(
private val tooltip: ViewTooltip
) : RecyclerView.Adapter<AppListAdapter.ListViewHolder>() {

val apps = mutableListOf<String>()
private val apps = mutableListOf<String>()
private val dataModels = mutableListOf<DataModel?>()
private val rootDataModels = mutableListOf<RootDataModel?>()
private val prefs = getDefaultSharedPreferences(context)
private var itemCount = 0

private val isRoot = prefs.managerVariant == "root"

Expand Down Expand Up @@ -85,7 +84,7 @@ class AppListAdapter(
}
}

override fun getItemCount(): Int = itemCount
override fun getItemCount(): Int = apps.size

init {

Expand All @@ -96,7 +95,6 @@ class AppListAdapter(
dataModels.add(viewModel.vancedModel.value)
}
apps.add(context.getString(R.string.vanced))
itemCount++
}

if (prefs.enableMusic) {
Expand All @@ -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++
}

}
Expand Down

0 comments on commit 0abf89a

Please sign in to comment.