diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/RecyclerAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/RecyclerAdapter.kt index 8701c8b..873e615 100644 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/RecyclerAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/RecyclerAdapter.kt @@ -1,7 +1,5 @@ package com.simplemobiletools.applauncher.adapters -import android.content.pm.PackageManager -import android.content.res.Resources import android.support.v7.view.ActionMode import android.support.v7.widget.RecyclerView import android.util.SparseArray @@ -34,8 +32,6 @@ class RecyclerAdapter(val activity: SimpleActivity, val launchers: MutableList<A private var itemViews = SparseArray<View>() private val selectedPositions = HashSet<Int>() private var textColor = config.textColor - private var resources = activity.resources - private var packageManager = activity.packageManager fun toggleItemSelection(select: Boolean, pos: Int) { if (select) { @@ -103,7 +99,7 @@ class RecyclerAdapter(val activity: SimpleActivity, val launchers: MutableList<A } override fun onBindViewHolder(holder: ViewHolder, position: Int) { - itemViews.put(position, holder.bindView(launchers[position], textColor, resources, packageManager)) + itemViews.put(position, holder.bindView(launchers[position], textColor)) toggleItemSelection(selectedPositions.contains(position), position) holder.itemView.tag = holder } @@ -153,7 +149,7 @@ class RecyclerAdapter(val activity: SimpleActivity, val launchers: MutableList<A class ViewHolder(view: View, val adapterListener: MyAdapterListener, val activity: SimpleActivity, val multiSelectorCallback: ModalMultiSelectorCallback, val multiSelector: MultiSelector, val listener: AppLaunchersListener?, val itemClick: (AppLauncher) -> (Unit)) : SwappingHolder(view, MultiSelector()) { - fun bindView(launcher: AppLauncher, textColor: Int, resources: Resources, packageManager: PackageManager): View { + fun bindView(launcher: AppLauncher, textColor: Int): View { itemView.apply { launcher_label.text = launcher.name launcher_label.setTextColor(textColor) diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/RecyclerDialogAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/RecyclerDialogAdapter.kt index f7d0693..02c63de 100644 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/RecyclerDialogAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/applauncher/adapters/RecyclerDialogAdapter.kt @@ -1,8 +1,6 @@ package com.simplemobiletools.applauncher.adapters import android.app.Activity -import android.content.pm.PackageManager -import android.content.res.Resources import android.support.v7.widget.RecyclerView import android.util.SparseArray import android.view.LayoutInflater @@ -23,8 +21,6 @@ class RecyclerDialogAdapter(activity: Activity, val launchers: List<AppLauncher> private var itemViews = SparseArray<View>() private val selectedPositions = HashSet<Int>() private var textColor = config.textColor - private var resources = activity.resources - private var packageManager = activity.packageManager fun toggleItemSelection(select: Boolean, pos: Int) { if (select) { @@ -56,7 +52,7 @@ class RecyclerDialogAdapter(activity: Activity, val launchers: List<AppLauncher> } override fun onBindViewHolder(holder: ViewHolder, position: Int) { - itemViews.put(position, holder.bindView(launchers[position], textColor, resources, packageManager)) + itemViews.put(position, holder.bindView(launchers[position], textColor)) toggleItemSelection(selectedPositions.contains(position), position) } @@ -68,7 +64,7 @@ class RecyclerDialogAdapter(activity: Activity, val launchers: List<AppLauncher> override fun getItemCount() = launchers.count() class ViewHolder(view: View, val adapterListener: MyAdapterListener) : RecyclerView.ViewHolder(view) { - fun bindView(launcher: AppLauncher, textColor: Int, resources: Resources, packageManager: PackageManager): View { + fun bindView(launcher: AppLauncher, textColor: Int): View { itemView.apply { launcher_label.text = launcher.name launcher_label.setTextColor(textColor) diff --git a/app/src/main/kotlin/com/simplemobiletools/applauncher/helpers/DBHelper.kt b/app/src/main/kotlin/com/simplemobiletools/applauncher/helpers/DBHelper.kt index a4509eb..380ba2e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/applauncher/helpers/DBHelper.kt +++ b/app/src/main/kotlin/com/simplemobiletools/applauncher/helpers/DBHelper.kt @@ -101,7 +101,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont val packageManager = context.packageManager val launchers = ArrayList<AppLauncher>() val cols = arrayOf(COL_ID, COL_NAME, COL_PKG_NAME) - val cursor = mDb.query(MAIN_TABLE_NAME, cols, null, null, null, null, COL_NAME) + val cursor = mDb.query(MAIN_TABLE_NAME, cols, null, null, null, null, "$COL_NAME COLLATE NOCASE") cursor.use { while (cursor.moveToNext()) { val id = cursor.getIntValue(COL_ID)