mirror of
https://github.com/SimpleMobileTools/Simple-App-Launcher.git
synced 2025-03-06 04:17:36 +01:00
rename app_launcher_item to item_app_launcher for consistency
This commit is contained in:
parent
01e4e9cb48
commit
dcc56deaa4
@ -14,7 +14,7 @@ import com.simplemobiletools.commons.extensions.applyColorFilter
|
||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||
import com.simplemobiletools.commons.interfaces.RefreshRecyclerViewListener
|
||||
import com.simplemobiletools.commons.views.MyRecyclerView
|
||||
import kotlinx.android.synthetic.main.app_launcher_item.view.*
|
||||
import kotlinx.android.synthetic.main.item_app_launcher.view.*
|
||||
import java.util.*
|
||||
|
||||
class LaunchersAdapter(activity: SimpleActivity, val launchers: MutableList<AppLauncher>, val listener: RefreshRecyclerViewListener?,
|
||||
@ -34,7 +34,7 @@ class LaunchersAdapter(activity: SimpleActivity, val launchers: MutableList<AppL
|
||||
view?.launcher_check?.beVisibleIf(select)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.app_launcher_item, parent)
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.item_app_launcher, parent)
|
||||
|
||||
override fun onBindViewHolder(holder: MyRecyclerViewAdapter.ViewHolder, position: Int) {
|
||||
val launcher = launchers[position]
|
||||
@ -48,7 +48,7 @@ class LaunchersAdapter(activity: SimpleActivity, val launchers: MutableList<AppL
|
||||
|
||||
override fun prepareActionMode(menu: Menu) {
|
||||
menu.apply {
|
||||
findItem(R.id.cab_edit).isVisible = selectedPositions.size == 1
|
||||
findItem(R.id.cab_edit).isVisible = isOneItemSelected()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ import com.simplemobiletools.applauncher.models.AppLauncher
|
||||
import com.simplemobiletools.commons.extensions.applyColorFilter
|
||||
import com.simplemobiletools.commons.extensions.beVisibleIf
|
||||
import com.simplemobiletools.commons.interfaces.MyAdapterListener
|
||||
import kotlinx.android.synthetic.main.app_launcher_item.view.*
|
||||
import kotlinx.android.synthetic.main.item_app_launcher.view.*
|
||||
import java.util.*
|
||||
|
||||
class LaunchersDialogAdapter(activity: Activity, val launchers: ArrayList<AppLauncher>) : RecyclerView.Adapter<LaunchersDialogAdapter.ViewHolder>() {
|
||||
@ -60,7 +60,7 @@ class LaunchersDialogAdapter(activity: Activity, val launchers: ArrayList<AppLau
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.app_launcher_item, parent, false)
|
||||
val view = LayoutInflater.from(parent.context).inflate(R.layout.item_app_launcher, parent, false)
|
||||
return ViewHolder(view, adapterListener)
|
||||
}
|
||||
|
||||
|
@ -11,12 +11,11 @@ import com.simplemobiletools.commons.extensions.setupDialogStuff
|
||||
import kotlinx.android.synthetic.main.dialog_pick_launchers.view.*
|
||||
|
||||
class AddAppLauncherDialog(val activity: Activity, val notDisplayedLaunchers: ArrayList<AppLauncher>, val callback: () -> Unit) {
|
||||
private var dialog: AlertDialog
|
||||
private var view = (activity.layoutInflater.inflate(R.layout.dialog_pick_launchers, null) as ViewGroup)
|
||||
private var adapter: LaunchersDialogAdapter? = null
|
||||
|
||||
init {
|
||||
dialog = AlertDialog.Builder(activity)
|
||||
AlertDialog.Builder(activity)
|
||||
.setPositiveButton(R.string.ok, { dialogInterface, i -> confirmSelection() })
|
||||
.setNegativeButton(R.string.cancel, null)
|
||||
.create().apply {
|
||||
@ -32,6 +31,5 @@ class AddAppLauncherDialog(val activity: Activity, val notDisplayedLaunchers: Ar
|
||||
activity.dbHelper.insertAppLauncher(it)
|
||||
}
|
||||
callback()
|
||||
dialog.dismiss()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user