renaming launcher name to title

This commit is contained in:
tibbi 2020-11-07 21:49:00 +01:00
parent 5dc2346efe
commit ea5199b26e
6 changed files with 7 additions and 7 deletions

View File

@ -118,7 +118,7 @@ class LaunchersAdapter(activity: SimpleActivity, val launchers: ArrayList<AppLau
private fun setupView(view: View, launcher: AppLauncher, isSelected: Boolean) {
view.apply {
launcher_check?.beInvisibleIf(!isSelected)
launcher_label.text = launcher.name
launcher_label.text = launcher.title
launcher_label.setTextColor(textColor)
launcher_icon.setImageDrawable(launcher.drawable!!)

View File

@ -51,7 +51,7 @@ class LaunchersDialogAdapter(activity: Activity, val launchers: ArrayList<AppLau
val isSelected = isKeySelected(launcher.packageName.hashCode())
itemView.apply {
launcher_check?.beInvisibleIf(!isSelected)
launcher_label.text = launcher.name
launcher_label.text = launcher.title
launcher_label.setTextColor(textColor)
launcher_icon.setImageDrawable(launcher.drawable!!)

View File

@ -17,7 +17,7 @@ class EditDialog(val activity: Activity, val appLauncher: AppLauncher, val callb
var view = (activity.layoutInflater.inflate(R.layout.dialog_edit_launcher, null) as ViewGroup)
init {
view.edit_launcher_edittext.setText(appLauncher.name)
view.edit_launcher_edittext.setText(appLauncher.title)
dialog = AlertDialog.Builder(activity)
.setPositiveButton(R.string.ok, null)

View File

@ -47,7 +47,7 @@ fun Context.getNotDisplayedLaunchers(displayedLaunchers: ArrayList<AppLauncher>)
allApps.add(AppLauncher(0, label, packageName, drawable))
}
val sorted = allApps.sortedWith(compareBy { it.name.toLowerCase() })
val sorted = allApps.sortedWith(compareBy { it.title.toLowerCase() })
val unique = sorted.distinctBy { it.packageName }
return unique.filter { !displayedLaunchers.contains(it) && it.packageName != "com.simplemobiletools.applauncher" } as ArrayList<AppLauncher>
}

View File

@ -115,7 +115,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
private fun fillAppLauncherValues(appLauncher: AppLauncher): ContentValues {
return ContentValues().apply {
put(COL_NAME, appLauncher.name)
put(COL_NAME, appLauncher.title)
put(COL_PKG_NAME, appLauncher.packageName)
}
}

View File

@ -2,8 +2,8 @@ package com.simplemobiletools.applauncher.models
import android.graphics.drawable.Drawable
data class AppLauncher(val id: Int, var name: String, val packageName: String, val drawable: Drawable? = null) {
data class AppLauncher(val id: Int, var title: String, val packageName: String, val drawable: Drawable? = null) {
override fun equals(other: Any?) = packageName.equals((other as AppLauncher).packageName, true)
fun getBubbleText() = name
fun getBubbleText() = title
}