mirror of
https://github.com/SimpleMobileTools/Simple-App-Launcher.git
synced 2025-04-28 08:38:44 +02:00
renaming launcher name to title
This commit is contained in:
parent
5dc2346efe
commit
ea5199b26e
@ -118,7 +118,7 @@ class LaunchersAdapter(activity: SimpleActivity, val launchers: ArrayList<AppLau
|
|||||||
private fun setupView(view: View, launcher: AppLauncher, isSelected: Boolean) {
|
private fun setupView(view: View, launcher: AppLauncher, isSelected: Boolean) {
|
||||||
view.apply {
|
view.apply {
|
||||||
launcher_check?.beInvisibleIf(!isSelected)
|
launcher_check?.beInvisibleIf(!isSelected)
|
||||||
launcher_label.text = launcher.name
|
launcher_label.text = launcher.title
|
||||||
launcher_label.setTextColor(textColor)
|
launcher_label.setTextColor(textColor)
|
||||||
launcher_icon.setImageDrawable(launcher.drawable!!)
|
launcher_icon.setImageDrawable(launcher.drawable!!)
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ class LaunchersDialogAdapter(activity: Activity, val launchers: ArrayList<AppLau
|
|||||||
val isSelected = isKeySelected(launcher.packageName.hashCode())
|
val isSelected = isKeySelected(launcher.packageName.hashCode())
|
||||||
itemView.apply {
|
itemView.apply {
|
||||||
launcher_check?.beInvisibleIf(!isSelected)
|
launcher_check?.beInvisibleIf(!isSelected)
|
||||||
launcher_label.text = launcher.name
|
launcher_label.text = launcher.title
|
||||||
launcher_label.setTextColor(textColor)
|
launcher_label.setTextColor(textColor)
|
||||||
launcher_icon.setImageDrawable(launcher.drawable!!)
|
launcher_icon.setImageDrawable(launcher.drawable!!)
|
||||||
|
|
||||||
|
@ -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)
|
var view = (activity.layoutInflater.inflate(R.layout.dialog_edit_launcher, null) as ViewGroup)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
view.edit_launcher_edittext.setText(appLauncher.name)
|
view.edit_launcher_edittext.setText(appLauncher.title)
|
||||||
|
|
||||||
dialog = AlertDialog.Builder(activity)
|
dialog = AlertDialog.Builder(activity)
|
||||||
.setPositiveButton(R.string.ok, null)
|
.setPositiveButton(R.string.ok, null)
|
||||||
|
@ -47,7 +47,7 @@ fun Context.getNotDisplayedLaunchers(displayedLaunchers: ArrayList<AppLauncher>)
|
|||||||
allApps.add(AppLauncher(0, label, packageName, drawable))
|
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 }
|
val unique = sorted.distinctBy { it.packageName }
|
||||||
return unique.filter { !displayedLaunchers.contains(it) && it.packageName != "com.simplemobiletools.applauncher" } as ArrayList<AppLauncher>
|
return unique.filter { !displayedLaunchers.contains(it) && it.packageName != "com.simplemobiletools.applauncher" } as ArrayList<AppLauncher>
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ class DBHelper private constructor(val context: Context) : SQLiteOpenHelper(cont
|
|||||||
|
|
||||||
private fun fillAppLauncherValues(appLauncher: AppLauncher): ContentValues {
|
private fun fillAppLauncherValues(appLauncher: AppLauncher): ContentValues {
|
||||||
return ContentValues().apply {
|
return ContentValues().apply {
|
||||||
put(COL_NAME, appLauncher.name)
|
put(COL_NAME, appLauncher.title)
|
||||||
put(COL_PKG_NAME, appLauncher.packageName)
|
put(COL_PKG_NAME, appLauncher.packageName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,8 @@ package com.simplemobiletools.applauncher.models
|
|||||||
|
|
||||||
import android.graphics.drawable.Drawable
|
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)
|
override fun equals(other: Any?) = packageName.equals((other as AppLauncher).packageName, true)
|
||||||
|
|
||||||
fun getBubbleText() = name
|
fun getBubbleText() = title
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user