mirror of
https://codeberg.org/timelimit/timelimit-android.git
synced 2025-10-03 17:59:51 +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 {
|
init {
|
||||||
if (packageName.indexOf(':') != -1 || packageName.indexOf(':') != -1) {
|
if (packageName.indexOf(':') != -1 || packageName.indexOf('@') != -1) {
|
||||||
throw InvalidValueException()
|
throw InvalidValueException()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activityName != null && activityName?.indexOf('@') != -1) {
|
if (activityName != null && activityName.indexOf('@') != -1) {
|
||||||
throw InvalidValueException()
|
throw InvalidValueException()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,7 +166,7 @@ class AddCategoryAppsFragment : DialogFragment() {
|
||||||
binding.cancelButton.setOnClickListener { dismiss() }
|
binding.cancelButton.setOnClickListener { dismiss() }
|
||||||
|
|
||||||
binding.selectAllButton.setOnClickListener {
|
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 {
|
adapter.listener = object: AddAppAdapterListener {
|
||||||
|
|
|
@ -66,7 +66,7 @@ class ChildAppsModel(application: Application): AndroidViewModel(application) {
|
||||||
childCategoryAppsLive.switchMap { categoryApps ->
|
childCategoryAppsLive.switchMap { categoryApps ->
|
||||||
// only show items that are not device specific
|
// only show items that are not device specific
|
||||||
val categoryAppByPackageName = categoryApps
|
val categoryAppByPackageName = categoryApps
|
||||||
.filter { it.appSpecifier.deviceId == null }
|
.filter { it.appSpecifier.activityName == null && it.appSpecifier.deviceId == null }
|
||||||
.associateBy { it.appSpecifier.packageName }
|
.associateBy { it.appSpecifier.packageName }
|
||||||
|
|
||||||
appFilterLive.ignoreUnchanged().switchMap { appFilter ->
|
appFilterLive.ignoreUnchanged().switchMap { appFilter ->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue