File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
DisableSounds/src/main/java/com/programminghoch10/DisableSounds Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,10 @@ package com.programminghoch10.DisableSounds
3
3
import android.annotation.SuppressLint
4
4
import android.os.Bundle
5
5
import androidx.fragment.app.FragmentActivity
6
+ import androidx.preference.Preference
6
7
import androidx.preference.PreferenceFragmentCompat
8
+ import androidx.preference.PreferenceGroup
9
+ import androidx.preference.children
7
10
8
11
val SHARED_PREFERENCES_NAME = " disable_sounds"
9
12
@@ -28,6 +31,12 @@ class SettingsActivity : FragmentActivity() {
28
31
preferenceManager.sharedPreferencesName = SHARED_PREFERENCES_NAME
29
32
preferenceManager.sharedPreferencesMode = MODE_WORLD_READABLE
30
33
setPreferencesFromResource(R .xml.root_preferences, rootKey)
34
+ preferenceScreen.setIconSpaceReservedRecursive(false )
35
+ }
36
+
37
+ fun Preference.setIconSpaceReservedRecursive (iconSpaceReserved : Boolean ) {
38
+ this .isIconSpaceReserved = iconSpaceReserved
39
+ if (this is PreferenceGroup ) children.forEach { it.setIconSpaceReservedRecursive(iconSpaceReserved) }
31
40
}
32
41
}
33
42
}
You can’t perform that action at this time.
0 commit comments