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
33import android.annotation.SuppressLint
44import android.os.Bundle
55import androidx.fragment.app.FragmentActivity
6+ import androidx.preference.Preference
67import androidx.preference.PreferenceFragmentCompat
8+ import androidx.preference.PreferenceGroup
9+ import androidx.preference.children
710
811val SHARED_PREFERENCES_NAME = " disable_sounds"
912
@@ -28,6 +31,12 @@ class SettingsActivity : FragmentActivity() {
2831 preferenceManager.sharedPreferencesName = SHARED_PREFERENCES_NAME
2932 preferenceManager.sharedPreferencesMode = MODE_WORLD_READABLE
3033 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) }
3140 }
3241 }
3342}
You can’t perform that action at this time.
0 commit comments