mirror of
https://codeberg.org/timelimit/timelimit-android.git
synced 2025-10-03 09:49:25 +02:00
Bugfixes for device specific Apps
This commit is contained in:
parent
79e9c2a30f
commit
285d8211a6
3 changed files with 4 additions and 4 deletions
|
@ -39,11 +39,11 @@ data class AppSpecifier(val packageName: String, val activityName: String?, val
|
|||
}
|
||||
|
||||
init {
|
||||
if (packageName.indexOf(':') != -1 || packageName.indexOf(':') != -1) {
|
||||
if (packageName.indexOf(':') != -1 || packageName.indexOf('@') != -1) {
|
||||
throw InvalidValueException()
|
||||
}
|
||||
|
||||
if (activityName != null && activityName?.indexOf('@') != -1) {
|
||||
if (activityName != null && activityName.indexOf('@') != -1) {
|
||||
throw InvalidValueException()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -166,7 +166,7 @@ class AddCategoryAppsFragment : DialogFragment() {
|
|||
binding.cancelButton.setOnClickListener { dismiss() }
|
||||
|
||||
binding.selectAllButton.setOnClickListener {
|
||||
adapter.selectedApps = adapter.selectedApps + (adapter.data?.map { it.packageName }?.toSet() ?: emptySet())
|
||||
adapter.selectedApps = adapter.selectedApps + (adapter.data.map { it.packageName }.toSet())
|
||||
}
|
||||
|
||||
adapter.listener = object: AddAppAdapterListener {
|
||||
|
|
|
@ -66,7 +66,7 @@ class ChildAppsModel(application: Application): AndroidViewModel(application) {
|
|||
childCategoryAppsLive.switchMap { categoryApps ->
|
||||
// only show items that are not device specific
|
||||
val categoryAppByPackageName = categoryApps
|
||||
.filter { it.appSpecifier.deviceId == null }
|
||||
.filter { it.appSpecifier.activityName == null && it.appSpecifier.deviceId == null }
|
||||
.associateBy { it.appSpecifier.packageName }
|
||||
|
||||
appFilterLive.ignoreUnchanged().switchMap { appFilter ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue