fix profile scroll not working & pin selected access control apps

This commit is contained in:
Kr328 committed 2019-12-09 01:03:05 +08:00
1 parent 41a2e7effc
commit 2b47776554
2 files changed
+8 -9

No files matched your search

@@ -33,10 +33,7 @@ class ProfilesActivity : BaseActivity() {
setSupportActionBar(activity_profiles_toolbar)
activity_profiles_main_list.layoutManager = object : LinearLayoutManager(this) {
override fun canScrollHorizontally(): Boolean = false
override fun canScrollVertically(): Boolean = false
}
activity_profiles_main_list.layoutManager = LinearLayoutManager(this)
activity_profiles_main_list.adapter = ProfileAdapter(this,
this::onProfileClick,
this::onOperateClick,
@@ -102,6 +102,7 @@ class SettingAccessActivity : BaseActivity() {
}
val exclude = resources.getStringArray(R.array.default_disallow_application).toSet()
val selected = settings.accessControlApps.toMutableSet()
val applications = packageManager.getInstalledApplications(0)
.filterNot {
@@ -114,10 +115,11 @@ class SettingAccessActivity : BaseActivity() {
app.loadIcon(packageManager)
)
}
.sortedBy { app ->
app.name
}
val selected = settings.accessControlApps.toMutableSet()
.sortedWith(
compareBy(
{ app -> selected.contains(app.packageName) },
{ app -> app.name })
)
runOnUiThread {
activity_setting_access_app_list.apply {
@@ -230,7 +232,7 @@ class SettingAccessActivity : BaseActivity() {
}
private fun updateSelectedMode(mode: Int) {
when ( mode ) {
when (mode) {
0 -> {
activity_setting_access_allow_all.isChecked = true
activity_setting_access_allow.isChecked = false