Added an option to reset all preferences and implemented a different popup for selecting preferences. Also fixed a context menu bug.

This commit is contained in:
ottoptj 2024-09-02 06:09:25 +03:00
commit be4dd79e89
11 changed files with 309 additions and 90 deletions

View file

@ -17,13 +17,15 @@ class SettingsFragment : PreferenceFragmentCompat(), TitleProvider {
sharedPreferenceManager = SharedPreferenceManager(requireContext()) sharedPreferenceManager = SharedPreferenceManager(requireContext())
val homePref = findPreference<Preference?>("defaultHome") val homePref = findPreference<Preference>("defaultHome")
val uiSettings = findPreference<Preference>("uiSettings")
val homeSettings = findPreference<Preference>("homeSettings") val homeSettings = findPreference<Preference>("homeSettings")
val appMenuSettings = findPreference<Preference>("appMenuSettings") val appMenuSettings = findPreference<Preference>("appMenuSettings")
val hiddenPref = findPreference<Preference?>("hiddenApps") val hiddenPref = findPreference<Preference>("hiddenApps")
val aboutPref = findPreference<Preference?>("aboutPage") val aboutPref = findPreference<Preference>("aboutPage")
val resetPref = findPreference<Preference>("resetAll")
homePref?.onPreferenceClickListener = homePref?.onPreferenceClickListener =
Preference.OnPreferenceClickListener { Preference.OnPreferenceClickListener {
@ -35,6 +37,15 @@ class SettingsFragment : PreferenceFragmentCompat(), TitleProvider {
} }
true } true }
uiSettings?.onPreferenceClickListener =
Preference.OnPreferenceClickListener {
requireActivity().supportFragmentManager
.beginTransaction()
.replace(R.id.settingsLayout, UISettingsFragment())
.addToBackStack(null)
.commit()
true }
homeSettings?.onPreferenceClickListener = homeSettings?.onPreferenceClickListener =
Preference.OnPreferenceClickListener { Preference.OnPreferenceClickListener {
requireActivity().supportFragmentManager requireActivity().supportFragmentManager
@ -71,10 +82,14 @@ class SettingsFragment : PreferenceFragmentCompat(), TitleProvider {
.commit() .commit()
true } true }
resetPref?.onPreferenceClickListener =
Preference.OnPreferenceClickListener {
sharedPreferenceManager.resetAllPreferences(requireActivity())
true }
} }
override fun getTitle(): String { override fun getTitle(): String {
return "Launcher Settings" return "Launcher Settings"
} }
} }

View file

@ -1,10 +1,13 @@
package eu.ottop.yamlauncher.settings package eu.ottop.yamlauncher.settings
import android.app.AlertDialog
import android.content.Context import android.content.Context
import android.graphics.Color import android.graphics.Color
import android.util.TypedValue import android.util.TypedValue
import android.widget.TextView import android.widget.TextView
import androidx.fragment.app.FragmentActivity
import androidx.preference.PreferenceManager import androidx.preference.PreferenceManager
import eu.ottop.yamlauncher.R
class SharedPreferenceManager (private val context: Context) { class SharedPreferenceManager (private val context: Context) {
@ -221,4 +224,39 @@ class SharedPreferenceManager (private val context: Context) {
editor.remove("name$packageName-$profile") editor.remove("name$packageName-$profile")
editor.apply() editor.apply()
} }
fun resetAllPreferences(activity: FragmentActivity) {
AlertDialog.Builder(context).apply {
setTitle("Confirmation")
setMessage("You will lose ALL changes that you have made to the launcher settings. Are you sure?")
setPositiveButton("Yes") { _, _ ->
performReset(activity)
}
setNegativeButton("Cancel") { _, _ ->
}
}.create().show()
}
private fun performReset(activity: FragmentActivity) {
val editor = preferences.edit()
editor.clear()
editor.apply()
activity.supportFragmentManager
.beginTransaction()
.replace(R.id.settingsLayout, UISettingsFragment())
.commit()
activity.supportFragmentManager
.beginTransaction()
.replace(R.id.settingsLayout, HomeSettingsFragment())
.commit()
activity.supportFragmentManager
.beginTransaction()
.replace(R.id.settingsLayout, AppMenuSettingsFragment())
.commit()
activity.supportFragmentManager
.beginTransaction()
.replace(R.id.settingsLayout, SettingsFragment())
.commit()
}
} }

View file

@ -0,0 +1,88 @@
package eu.ottop.yamlauncher.settings
import android.content.Context
import android.os.Handler
import android.os.Looper
import android.util.AttributeSet
import android.view.View
import android.widget.AdapterView
import android.widget.ArrayAdapter
import android.widget.Spinner
import androidx.preference.Preference
import androidx.preference.PreferenceViewHolder
import eu.ottop.yamlauncher.R
class SpinnerPreference (context: Context, attrs: AttributeSet? = null): Preference(context, attrs) {
private var entries: Array<CharSequence>? = null
private var entryValues: Array<CharSequence>? = null
private var currentValue: String? = null
private var defaultNo: String? = null
private var spinner: Spinner? = null
init {
widgetLayoutResource = R.layout.preference_spinner
context.theme.obtainStyledAttributes(
attrs,
R.styleable.SpinnerPreference,
0, 0).apply {
try {
entries = getTextArray(R.styleable.SpinnerPreference_android_entries)
entryValues = getTextArray(R.styleable.SpinnerPreference_android_entryValues)
defaultNo = getString(R.styleable.SpinnerPreference_android_defaultValue)
} finally {
recycle()
}
}}
override fun onBindViewHolder(holder: PreferenceViewHolder) {
super.onBindViewHolder(holder)
spinner = holder.findViewById(R.id.preferenceOptions) as Spinner
if (entries != null) {
val adapter = ArrayAdapter(context, android.R.layout.simple_spinner_item, entries!!)
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
spinner?.adapter = adapter
}
val selectedIndex = entryValues?.indexOf(currentValue as? CharSequence) ?: 0
spinner?.setSelection(selectedIndex)
// Somehow prevents an error :D
val handler = Handler(Looper.getMainLooper())
handler.postDelayed({
if (selectedIndex >= 0) {
summary = entries?.get(selectedIndex)
}
}, 0)
spinner?.onItemSelectedListener = object : AdapterView.OnItemSelectedListener {
override fun onItemSelected(parent: AdapterView<*>, view: View, position: Int, id: Long) {
val newValue = entryValues?.get(position).toString()
if (callChangeListener(newValue)) {
currentValue = newValue
persistString(newValue)
summary = entries?.get(position)
}
}
override fun onNothingSelected(parent: AdapterView<*>) {}
}
}
override fun onClick() {
// Open the spinner dropdown when the preference is clicked
spinner?.performClick()
}
override fun onSetInitialValue(defaultValue: Any?) {
currentValue = getPersistedString(defaultValue as? String)
}
// This is required to ensure that default values are stored (needed for full settings reset)
override fun onAttached() {
super.onAttached()
persistString(getPersistedString(defaultNo))
}
}

View file

@ -0,0 +1,16 @@
package eu.ottop.yamlauncher.settings
import android.os.Bundle
import androidx.preference.PreferenceFragmentCompat
import eu.ottop.yamlauncher.R
class UISettingsFragment : PreferenceFragmentCompat(), TitleProvider {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.ui_preferences, rootKey)
}
override fun getTitle(): String {
return "General UI Settings"
}
}

View file

@ -88,6 +88,7 @@
android:background="#A7000000" android:background="#A7000000"
android:foreground="@drawable/app_action_foreground" android:foreground="@drawable/app_action_foreground"
android:paddingVertical="3dp" android:paddingVertical="3dp"
android:singleLine="true"
android:text="@string/info" android:text="@string/info"
android:textAlignment="center" android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.DeviceDefault" android:textAppearance="@android:style/TextAppearance.DeviceDefault"
@ -102,6 +103,7 @@
android:background="#A7000000" android:background="#A7000000"
android:foreground="@drawable/app_action_foreground" android:foreground="@drawable/app_action_foreground"
android:paddingVertical="3dp" android:paddingVertical="3dp"
android:singleLine="true"
android:text="@string/uninstall" android:text="@string/uninstall"
android:textAlignment="center" android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.DeviceDefault" android:textAppearance="@android:style/TextAppearance.DeviceDefault"
@ -116,6 +118,7 @@
android:background="#A7000000" android:background="#A7000000"
android:foreground="@drawable/app_action_foreground" android:foreground="@drawable/app_action_foreground"
android:paddingVertical="3dp" android:paddingVertical="3dp"
android:singleLine="true"
android:text="@string/rename" android:text="@string/rename"
android:textAlignment="center" android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.DeviceDefault" android:textAppearance="@android:style/TextAppearance.DeviceDefault"
@ -130,6 +133,7 @@
android:background="#A7000000" android:background="#A7000000"
android:foreground="@drawable/app_action_foreground" android:foreground="@drawable/app_action_foreground"
android:paddingVertical="3dp" android:paddingVertical="3dp"
android:singleLine="true"
android:text="@string/hide" android:text="@string/hide"
android:textAlignment="center" android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.DeviceDefault" android:textAppearance="@android:style/TextAppearance.DeviceDefault"
@ -144,6 +148,7 @@
android:background="#A7000000" android:background="#A7000000"
android:foreground="@drawable/app_action_foreground" android:foreground="@drawable/app_action_foreground"
android:paddingVertical="3dp" android:paddingVertical="3dp"
android:singleLine="true"
android:text="@string/close" android:text="@string/close"
android:textAlignment="center" android:textAlignment="center"
android:textAppearance="@android:style/TextAppearance.DeviceDefault" android:textAppearance="@android:style/TextAppearance.DeviceDefault"

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="0dp"
android:layout_height="0dp"
android:visibility="invisible">
<Spinner
android:id="@+id/preferenceOptions"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:spinnerMode="dialog" />
</LinearLayout>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="SpinnerPreference">
<attr name="android:entries" />
<attr name="android:entryValues" />
<attr name="android:defaultValue" />
</declare-styleable>
</resources>

View file

@ -1,34 +1,34 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory <PreferenceCategory
app:allowDividerAbove="false" app:allowDividerAbove="false"
app:title="Apps"> app:title="Apps">
<ListPreference <eu.ottop.yamlauncher.settings.SpinnerPreference
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:defaultValue="left" android:defaultValue="left"
app:entries="@array/h_alignment_options" android:entries="@array/h_alignment_options"
app:entryValues="@array/h_alignment_values" android:entryValues="@array/h_alignment_values"
app:key="appMenuAlignment" app:key="appMenuAlignment"
app:title="App Alignment" app:title="App Alignment"
app:useSimpleSummaryProvider="true" /> app:useSimpleSummaryProvider="true" />
<ListPreference <eu.ottop.yamlauncher.settings.SpinnerPreference
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:defaultValue="medium" android:defaultValue="medium"
app:entries="@array/size_options" android:entries="@array/size_options"
app:entryValues="@array/size_values" android:entryValues="@array/size_values"
app:key="appMenuSize" app:key="appMenuSize"
app:title="App Size" app:title="App Size"
app:useSimpleSummaryProvider="true" /> app:useSimpleSummaryProvider="true" />
<ListPreference <eu.ottop.yamlauncher.settings.SpinnerPreference
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:defaultValue="20" android:defaultValue="20"
app:entries="@array/app_spacing_options" android:entries="@array/app_spacing_options"
app:entryValues="@array/app_spacing_values" android:entryValues="@array/app_spacing_values"
app:key="appSpacing" app:key="appSpacing"
app:title="App Spacing" app:title="App Spacing"
app:useSimpleSummaryProvider="true" /> app:useSimpleSummaryProvider="true" />
@ -44,23 +44,23 @@
android:defaultValue="true" android:defaultValue="true"
android:title="Enable Search" android:title="Enable Search"
app:key="searchEnabled" /> app:key="searchEnabled" />
<ListPreference <eu.ottop.yamlauncher.settings.SpinnerPreference
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:defaultValue="left" android:defaultValue="left"
app:dependency="searchEnabled" app:dependency="searchEnabled"
app:entries="@array/h_alignment_options" android:entries="@array/h_alignment_options"
app:entryValues="@array/h_alignment_values" android:entryValues="@array/h_alignment_values"
app:key="searchAlignment" app:key="searchAlignment"
app:title="Search Alignment" app:title="Search Alignment"
app:useSimpleSummaryProvider="true" /> app:useSimpleSummaryProvider="true" />
<ListPreference <eu.ottop.yamlauncher.settings.SpinnerPreference
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:defaultValue="medium" android:defaultValue="medium"
app:dependency="searchEnabled" app:dependency="searchEnabled"
app:entries="@array/size_options" android:entries="@array/size_options"
app:entryValues="@array/size_values" android:entryValues="@array/size_values"
app:key="searchSize" app:key="searchSize"
app:title="Search Size" app:title="Search Size"
app:useSimpleSummaryProvider="true" /> app:useSimpleSummaryProvider="true" />
@ -74,4 +74,4 @@
</PreferenceCategory> </PreferenceCategory>
</androidx.preference.PreferenceScreen> </PreferenceScreen>

View file

@ -13,21 +13,21 @@
android:defaultValue="true" android:defaultValue="true"
android:title="Show Clock" android:title="Show Clock"
app:key="clockEnabled" /> app:key="clockEnabled" />
<ListPreference <eu.ottop.yamlauncher.settings.SpinnerPreference
app:defaultValue="left" android:defaultValue="left"
app:dependency="clockEnabled" app:dependency="clockEnabled"
app:entries="@array/h_alignment_options" android:entries="@array/h_alignment_options"
app:entryValues="@array/h_alignment_values" android:entryValues="@array/h_alignment_values"
app:key="clockAlignment" app:key="clockAlignment"
app:title="Clock Alignment" app:title="Clock Alignment"
app:useSimpleSummaryProvider="true" /> app:useSimpleSummaryProvider="true" />
<ListPreference <eu.ottop.yamlauncher.settings.SpinnerPreference
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:defaultValue="medium" android:defaultValue="medium"
app:dependency="clockEnabled" app:dependency="clockEnabled"
app:entries="@array/size_options" android:entries="@array/size_options"
app:entryValues="@array/size_values" android:entryValues="@array/size_values"
app:key="clockSize" app:key="clockSize"
app:title="Clock Size" app:title="Clock Size"
app:useSimpleSummaryProvider="true" /> app:useSimpleSummaryProvider="true" />
@ -50,13 +50,13 @@
android:defaultValue="true" android:defaultValue="true"
android:title="Show Date" android:title="Show Date"
app:key="dateEnabled" /> app:key="dateEnabled" />
<ListPreference <eu.ottop.yamlauncher.settings.SpinnerPreference
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:defaultValue="medium" android:defaultValue="medium"
app:dependency="dateEnabled" app:dependency="dateEnabled"
app:entries="@array/size_options" android:entries="@array/size_options"
app:entryValues="@array/size_values" android:entryValues="@array/size_values"
app:key="dateSize" app:key="dateSize"
app:title="Date Size" app:title="Date Size"
app:useSimpleSummaryProvider="true" /> app:useSimpleSummaryProvider="true" />
@ -102,13 +102,13 @@
app:key="manualLocation" app:key="manualLocation"
app:selectable="true" app:selectable="true"
app:title="Set Manual Location" /> app:title="Set Manual Location" />
<ListPreference <eu.ottop.yamlauncher.settings.SpinnerPreference
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:defaultValue="celsius" android:defaultValue="celsius"
app:dependency="weatherEnabled" app:dependency="weatherEnabled"
app:entries="@array/temp_units" android:entries="@array/temp_units"
app:entryValues="@array/unit_values" android:entryValues="@array/unit_values"
app:key="tempUnits" app:key="tempUnits"
app:title="Units" app:title="Units"
app:useSimpleSummaryProvider="true" /> app:useSimpleSummaryProvider="true" />
@ -119,39 +119,39 @@
app:allowDividerAbove="false" app:allowDividerAbove="false"
app:allowDividerBelow="false" app:allowDividerBelow="false"
app:title="Shortcuts"> app:title="Shortcuts">
<ListPreference <eu.ottop.yamlauncher.settings.SpinnerPreference
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:defaultValue="4" android:defaultValue="4"
app:entries="@array/shortcut_options" android:entries="@array/shortcut_options"
app:entryValues="@array/shortcut_options" android:entryValues="@array/shortcut_options"
app:key="shortcutNo" app:key="shortcutNo"
app:title="Number of Shortcuts" app:title="Number of Shortcuts"
app:useSimpleSummaryProvider="true" /> app:useSimpleSummaryProvider="true" />
<ListPreference <eu.ottop.yamlauncher.settings.SpinnerPreference
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:defaultValue="left" android:defaultValue="left"
app:entries="@array/h_alignment_options" android:entries="@array/h_alignment_options"
app:entryValues="@array/h_alignment_values" android:entryValues="@array/h_alignment_values"
app:key="shortcutAlignment" app:key="shortcutAlignment"
app:title="Shortcut Alignment" app:title="Shortcut Alignment"
app:useSimpleSummaryProvider="true" /> app:useSimpleSummaryProvider="true" />
<ListPreference <eu.ottop.yamlauncher.settings.SpinnerPreference
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:defaultValue="medium" android:defaultValue="medium"
app:entries="@array/size_options" android:entries="@array/size_options"
app:entryValues="@array/size_values" android:entryValues="@array/size_values"
app:key="shortcutSize" app:key="shortcutSize"
app:title="Shortcut Size" app:title="Shortcut Size"
app:useSimpleSummaryProvider="true" /> app:useSimpleSummaryProvider="true" />
<ListPreference <eu.ottop.yamlauncher.settings.SpinnerPreference
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:defaultValue="0.11" android:defaultValue="0.11"
app:entries="@array/shortcut_spacing_options" android:entries="@array/shortcut_spacing_options"
app:entryValues="@array/shortcut_spacing_values" android:entryValues="@array/shortcut_spacing_values"
app:key="shortcutWeight" app:key="shortcutWeight"
app:title="Shortcut Spacing" app:title="Shortcut Spacing"
app:useSimpleSummaryProvider="true" /> app:useSimpleSummaryProvider="true" />

View file

@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
@ -7,44 +8,19 @@
app:key="defaultHome" app:key="defaultHome"
app:selectable="true" app:selectable="true"
app:title="Set Default Home" /> app:title="Set Default Home" />
<PreferenceCategory <PreferenceCategory
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:allowDividerAbove="false" app:allowDividerAbove="false"
app:title="Customization"> app:title="Customization" >
<ListPreference <Preference
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:defaultValue="#00000000" app:key="uiSettings"
app:entries="@array/bg_options" app:selectable="true"
app:entryValues="@array/bg_values" app:summary="Configure the overall look"
app:key="bgColor" app:title="General UI" />
app:title="Background Color"
app:useSimpleSummaryProvider="true" />
<ListPreference
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:defaultValue="#FFF3F3F3"
app:entries="@array/color_options"
app:entryValues="@array/color_values"
app:key="textColor"
app:title="Text Color"
app:useSimpleSummaryProvider="true" />
<SwitchPreference
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:defaultValue="false"
android:title="Show Status Bar"
app:key="barVisibility" />
<ListPreference
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:defaultValue="200"
app:entries="@array/animation_options"
app:entryValues="@array/animation_values"
app:key="animationSpeed"
app:title="Animation Speed"
app:useSimpleSummaryProvider="true" />
<Preference <Preference
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -85,5 +61,17 @@
app:selectable="true" app:selectable="true"
app:title="About YAM Launcher" /> app:title="About YAM Launcher" />
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:allowDividerAbove="false"
app:title="Reset">
<Preference
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:key="resetAll"
app:selectable="true"
app:title="Reset All Settings" />
</PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>

View file

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<PreferenceCategory
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:title="Colors"
app:allowDividerAbove="false">
<eu.ottop.yamlauncher.settings.SpinnerPreference
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:defaultValue="#00000000"
android:entries="@array/bg_options"
android:entryValues="@array/bg_values"
app:key="bgColor"
app:title="Background Color"
app:useSimpleSummaryProvider="true" />
<eu.ottop.yamlauncher.settings.SpinnerPreference
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:defaultValue="#FFF3F3F3"
android:entries="@array/color_options"
android:entryValues="@array/color_values"
app:key="textColor"
app:title="Text Color"
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
<PreferenceCategory
android:title="Operation"
app:allowDividerAbove="false">
<eu.ottop.yamlauncher.settings.SpinnerPreference
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:defaultValue="200"
android:entries="@array/animation_options"
android:entryValues="@array/animation_values"
app:key="animationSpeed"
app:title="Animation Speed"
app:useSimpleSummaryProvider="true" />
<SwitchPreference
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:defaultValue="false"
android:title="Show Status Bar"
app:key="barVisibility" />
</PreferenceCategory>
</PreferenceScreen>