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

Commit 0abf89a

Browse files
committed
removed useless variable
1 parent f99c20c commit 0abf89a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

app/src/main/java/com/vanced/manager/adapter/AppListAdapter.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@ class AppListAdapter(
2323
private val tooltip: ViewTooltip
2424
) : RecyclerView.Adapter<AppListAdapter.ListViewHolder>() {
2525

26-
val apps = mutableListOf<String>()
26+
private val apps = mutableListOf<String>()
2727
private val dataModels = mutableListOf<DataModel?>()
2828
private val rootDataModels = mutableListOf<RootDataModel?>()
2929
private val prefs = getDefaultSharedPreferences(context)
30-
private var itemCount = 0
3130

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

@@ -85,7 +84,7 @@ class AppListAdapter(
8584
}
8685
}
8786

88-
override fun getItemCount(): Int = itemCount
87+
override fun getItemCount(): Int = apps.size
8988

9089
init {
9190

@@ -96,7 +95,6 @@ class AppListAdapter(
9695
dataModels.add(viewModel.vancedModel.value)
9796
}
9897
apps.add(context.getString(R.string.vanced))
99-
itemCount++
10098
}
10199

102100
if (prefs.enableMusic) {
@@ -106,13 +104,11 @@ class AppListAdapter(
106104
dataModels.add(viewModel.musicModel.value)
107105
}
108106
apps.add(context.getString(R.string.music))
109-
itemCount++
110107
}
111108

112109
if (!isRoot) {
113110
dataModels.add(viewModel.microgModel.value)
114111
apps.add(context.getString(R.string.microg))
115-
itemCount++
116112
}
117113

118114
}

0 commit comments

Comments
 (0)