Refactor edge-to-edge

Change edge-to-edge to auto-enable on 27+, along with relying on styles to make the systemui changes instead of code directly.
This commit is contained in:
OxygenCobalt 2020-12-18 10:45:42 -07:00
parent 0d32ab0f7e
commit 4413cb1499
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
20 changed files with 275 additions and 418 deletions

View file

@ -1,7 +1,6 @@
package org.oxycblt.auxio
import android.content.Intent
import android.graphics.Color
import android.os.Build
import android.os.Bundle
import android.view.View
@ -13,13 +12,11 @@ import org.oxycblt.auxio.databinding.ActivityMainBinding
import org.oxycblt.auxio.playback.PlaybackService
import org.oxycblt.auxio.settings.SettingsManager
import org.oxycblt.auxio.ui.accent
import org.oxycblt.auxio.ui.handleTransparentSystemBars
import org.oxycblt.auxio.ui.toColor
import org.oxycblt.auxio.ui.isEdgeOn
// FIXME: Fix bug where fast navigation will break the animations and
// lead to nothing being displayed [Possibly Un-fixable]
// FIXME: Compat issue with Versions 5 that leads to progress bar looking off
// TODO: Try to heavily refactor edge-to-edge
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
@ -39,7 +36,7 @@ class MainActivity : AppCompatActivity() {
// Apply the theme
setTheme(accent.second)
if (settingsManager.edgeEnabled && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
if (isEdgeOn()) {
doEdgeToEdgeSetup(binding)
}
}
@ -55,11 +52,6 @@ class MainActivity : AppCompatActivity() {
@Suppress("DEPRECATION")
private fun doEdgeToEdgeSetup(binding: ActivityMainBinding) {
window?.apply {
statusBarColor = Color.TRANSPARENT
// Use a heavily transparent scrim on the nav bar as full transparency is borked
navigationBarColor = R.color.nav_color.toColor(this@MainActivity)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
// Do modern edge to edge [Which is really a shot in the dark tbh]
this@MainActivity.logD("Doing R+ edge-to-edge.")
@ -81,8 +73,6 @@ class MainActivity : AppCompatActivity() {
binding.root.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
}
handleTransparentSystemBars(resources.configuration)
}
}
}

View file

@ -14,8 +14,8 @@ import org.oxycblt.auxio.R
import org.oxycblt.auxio.databinding.FragmentCompactPlaybackBinding
import org.oxycblt.auxio.logD
import org.oxycblt.auxio.music.MusicStore
import org.oxycblt.auxio.ui.memberBinding
import org.oxycblt.auxio.ui.isLandscape
import org.oxycblt.auxio.ui.memberBinding
/**
* A [Fragment] that displays the currently played song at a glance, with some basic controls.

View file

@ -17,7 +17,7 @@ import org.oxycblt.auxio.music.BaseModel
import org.oxycblt.auxio.music.Header
import org.oxycblt.auxio.playback.PlaybackViewModel
import org.oxycblt.auxio.playback.state.PlaybackMode
import org.oxycblt.auxio.settings.SettingsManager
import org.oxycblt.auxio.ui.isEdgeOn
import org.oxycblt.auxio.ui.isIrregularLandscape
/**
@ -50,8 +50,7 @@ class QueueFragment : Fragment() {
findNavController().navigateUp()
}
if (!requireActivity().isIrregularLandscape() &&
SettingsManager.getInstance().edgeEnabled) {
if (!requireActivity().isIrregularLandscape() && isEdgeOn()) {
setOnApplyWindowInsetsListener @Suppress("DEPRECATION") { _, insets ->
val top = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
insets.getInsets(WindowInsets.Type.systemBars()).top

View file

@ -42,9 +42,6 @@ class SettingsManager private constructor(context: Context) :
.apply()
}
val edgeEnabled: Boolean
get() = sharedPrefs.getBoolean(Keys.KEY_EDGE_TO_EDGE, false)
val colorizeNotif: Boolean
get() = sharedPrefs.getBoolean(Keys.KEY_COLORIZE_NOTIFICATION, true)

View file

@ -1,16 +1,15 @@
package org.oxycblt.auxio.settings.ui
import android.app.Dialog
import android.content.Intent
import android.content.pm.PackageManager
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import androidx.browser.customtabs.CustomTabsIntent
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.net.toUri
import androidx.fragment.app.DialogFragment
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import org.oxycblt.auxio.BuildConfig
import org.oxycblt.auxio.R
@ -20,8 +19,7 @@ import org.oxycblt.auxio.logE
import org.oxycblt.auxio.music.MusicStore
import org.oxycblt.auxio.settings.SettingsManager
import org.oxycblt.auxio.ui.createToast
import org.oxycblt.auxio.ui.handleTransparentSystemBars
import org.oxycblt.auxio.ui.handleTransparentSystemNavBar
import org.oxycblt.auxio.ui.isEdgeOn
import org.oxycblt.auxio.ui.isIrregularLandscape
import org.oxycblt.auxio.ui.isLandscape
import org.oxycblt.auxio.ui.toColor
@ -40,12 +38,10 @@ class AboutDialog : BottomSheetDialogFragment() {
val settingsManager = SettingsManager.getInstance()
// --- UI SETUP ---
// Apply edge-to-edge to the dialog if supported/enabled.
if (settingsManager.edgeEnabled && !requireActivity().isIrregularLandscape()) {
if (isEdgeOn() && !requireActivity().isIrregularLandscape()) {
requireDialog().window?.apply {
navigationBarColor = R.color.background.toColor(requireContext())
handleTransparentSystemNavBar(resources.configuration)
// handleTransparentSystemNavBar(resources.configuration)
}
}
@ -62,6 +58,15 @@ class AboutDialog : BottomSheetDialogFragment() {
R.string.format_author, getString(R.string.author_oxycblt)
)
if (isLandscape(resources)) {
val dialog = requireDialog() as BottomSheetDialog
dialog.findViewById<CoordinatorLayout>(
com.google.android.material.R.id.design_bottom_sheet
)?.let {
BottomSheetBehavior.from(it).state = BottomSheetBehavior.STATE_EXPANDED
}
}
logD("Dialog created.")
return binding.root
@ -111,7 +116,6 @@ class AboutDialog : BottomSheetDialogFragment() {
}
companion object {
// TODO: Change dev to master
private const val LINK_CODEBASE = "https://github.com/oxygencobalt/Auxio"
private const val LINK_FAQ = "$LINK_CODEBASE/blob/master/FAQ.md"
private const val LINK_LICENSES = "$LINK_CODEBASE/blob/master/LICENSES.md"

View file

@ -6,15 +6,10 @@ package org.oxycblt.auxio.ui
import android.annotation.TargetApi
import android.app.Activity
import android.content.Context
import android.content.res.Configuration
import android.graphics.Point
import android.os.Build
import android.util.DisplayMetrics
import android.view.View
import android.view.Window
import android.view.WindowInsetsController
import android.view.WindowManager
import org.oxycblt.auxio.settings.SettingsManager
/**
* Check if we are in the "Irregular" landscape mode [e.g landscape, but nav bar is on the sides]
@ -27,6 +22,10 @@ fun Activity.isIrregularLandscape(): Boolean {
!isSystemBarOnBottom(this)
}
fun isEdgeOn(): Boolean {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1
}
/**
* Check if the system bars are on the bottom.
* @return If the system bars are on the bottom, false if no.
@ -62,61 +61,3 @@ private fun isSystemBarOnBottom(activity: Activity): Boolean {
return (!canMove || width < height)
}
/**
* Handle transparent system bars. Adapted from Music Player GO
* (https://github.com/enricocid/Music-Player-GO)
*/
fun Window.handleTransparentSystemBars(config: Configuration) {
fun isNight() = config.uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
insetsController?.let { controller ->
val appearance = WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS or
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS
val mask = if (isNight()) 0 else appearance
controller.setSystemBarsAppearance(appearance, mask)
}
} else {
val flags = decorView.systemUiVisibility
decorView.systemUiVisibility =
if (isNight()) {
flags and View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR.inv() and
View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv()
} else {
flags or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR or
View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
}
}
}
/**
* Handle only the transparent navigation bar.
*/
fun Window.handleTransparentSystemNavBar(config: Configuration) {
fun isNight() = config.uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
insetsController?.let { controller ->
val appearance = WindowInsetsController.APPEARANCE_LIGHT_NAVIGATION_BARS
val mask = if (isNight()) 0 else appearance
controller.setSystemBarsAppearance(appearance, mask)
}
} else {
val flags = decorView.systemUiVisibility
decorView.systemUiVisibility =
if (isNight()) {
flags and View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR.inv() and
View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR.inv()
} else {
flags or View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR or
View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
}
}
}

View file

@ -20,7 +20,8 @@ import kotlin.reflect.KProperty
* @param onDestroy Any code that should be run when the binding is destroyed.
*/
fun <T : ViewBinding> Fragment.memberBinding(
bindingFactory: (LayoutInflater) -> T, onDestroy: T.() -> Unit = {}
bindingFactory: (LayoutInflater) -> T,
onDestroy: T.() -> Unit = {}
) = FragmentBinderDelegate(this, bindingFactory, onDestroy)
/**

View file

@ -2,10 +2,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M11,18h2v-2h-2v2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM12,6c-2.21,0 -4,1.79 -4,4h2c0,-1.1 0.9,-2 2,-2s2,0.9 2,2c0,2 -3,1.75 -3,5h2c0,-2.25 3,-2.5 3,-5 0,-2.21 -1.79,-4 -4,-4z"/>
android:pathData="M11,18h2v-2h-2v2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM12,6c-2.21,0 -4,1.79 -4,4h2c0,-1.1 0.9,-2 2,-2s2,0.9 2,2c0,2 -3,1.75 -3,5h2c0,-2.25 3,-2.5 3,-5 0,-2.21 -1.79,-4 -4,-4z" />
</vector>

View file

@ -2,10 +2,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM21.41,6.34l-3.75,-3.75 -2.53,2.54 3.75,3.75 2.53,-2.54z"/>
android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM21.41,6.34l-3.75,-3.75 -2.53,2.54 3.75,3.75 2.53,-2.54z" />
</vector>

View file

@ -2,10 +2,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M9.4,16.6L4.8,12l4.6,-4.6L8,6l-6,6 6,6 1.4,-1.4zM14.6,16.6l4.6,-4.6 -4.6,-4.6L16,6l6,6 -6,6 -1.4,-1.4z"/>
android:pathData="M9.4,16.6L4.8,12l4.6,-4.6L8,6l-6,6 6,6 1.4,-1.4zM14.6,16.6l4.6,-4.6 -4.6,-4.6L16,6l6,6 -6,6 -1.4,-1.4z" />
</vector>

View file

@ -2,10 +2,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M4,6L2,6v16h16v-2L4,20L4,6zM22,2L6,2v16h16L22,2zM19,11L9,11L9,9h10v2zM15,15L9,15v-2h6v2zM19,7L9,7L9,5h10v2z"/>
android:pathData="M4,6L2,6v16h16v-2L4,20L4,6zM22,2L6,2v16h16L22,2zM19,11L9,11L9,9h10v2zM15,15L9,15v-2h6v2zM19,7L9,7L9,5h10v2z" />
</vector>

View file

@ -2,10 +2,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M4.01,2L4,22h16V8l-6,-6H4.01zM13,9V3.5L18.5,9H13z"/>
android:pathData="M4.01,2L4,22h16V8l-6,-6H4.01zM13,9V3.5L18.5,9H13z" />
</vector>

View file

@ -2,10 +2,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="?attr/colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M11,7h2v2h-2zM11,11h2v6h-2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
android:pathData="M11,7h2v2h-2zM11,11h2v6h-2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z" />
</vector>

View file

@ -1,7 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:overScrollMode="never">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
@ -165,4 +170,5 @@
tools:text="Created by OxygenCobalt" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</layout>

View file

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_open_about"
android:title="@string/label_about"
android:icon="@drawable/ic_about"
android:title="@string/label_about"
app:showAsAction="always" />
</menu>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base theme -->
<style name="Theme.Base" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowBackground">@color/background</item>
<item name="android:fontFamily">@font/inter</item>
<item name="android:textCursorDrawable">@drawable/ui_cursor</item>
<item name="android:scrollbars">none</item>
<item name="android:windowIsFloating">false</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@color/nav_color</item>
<item name="android:windowLightStatusBar">false</item>
<item name="android:windowLightNavigationBar">false</item>
<item name="popupMenuStyle">@style/Widget.CustomPopup</item>
<item name="colorControlNormal">@color/control_color</item>
<item name="alertDialogTheme">@style/Theme.CustomDialog</item>
<item name="indicatorFastScrollerStyle">@style/FastScrollTheme</item>
<item name="colorControlHighlight">@color/selection_color</item>
<item name="colorControlActivated">?attr/colorPrimary</item>
<item name="cornerRadius">0dp</item>
<item name="md_background_color">@color/background</item>
<item name="md_corner_radius">0dp</item>
<item name="md_color_button_text">@color/control_color</item>
<item name="md_font_title">@font/inter_black</item>
</style>
</resources>

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Base theme -->
<style name="Theme.Base" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="android:windowBackground">@color/background</item>
<item name="android:fontFamily">@font/inter</item>
<item name="android:textCursorDrawable">@drawable/ui_cursor</item>
<item name="android:scrollbars">none</item>
<item name="android:windowIsFloating">false</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@color/nav_color</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowLightNavigationBar">true</item>
<item name="popupMenuStyle">@style/Widget.CustomPopup</item>
<item name="colorControlNormal">@color/control_color</item>
<item name="alertDialogTheme">@style/Theme.CustomDialog</item>
<item name="indicatorFastScrollerStyle">@style/FastScrollTheme</item>
<item name="colorControlHighlight">@color/selection_color</item>
<item name="colorControlActivated">?attr/colorPrimary</item>
<item name="cornerRadius">0dp</item>
<item name="md_background_color">@color/background</item>
<item name="md_corner_radius">0dp</item>
<item name="md_color_button_text">@color/control_color</item>
<item name="md_font_title">@font/inter_black</item>
</style>
</resources>

View file

@ -172,5 +172,10 @@
<style name="Theme.BottomSheetFix" parent="@style/Theme.Design.BottomSheetDialog">
<item name="android:windowIsFloating">false</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="bottomSheetStyle">@style/bottomSheetStyleWrapper</item>
</style>
<style name="bottomSheetStyleWrapper" parent="Widget.Design.BottomSheet.Modal">
<item name="behavior_peekHeight">500dp</item>
</style>
</resources>

View file

@ -1,145 +0,0 @@
<?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="@layout/item_header"
android:title="@string/setting_ui">
<ListPreference
android:entries="@array/entires_theme"
android:entryValues="@array/values_theme"
android:icon="@drawable/ic_day"
android:title="@string/setting_theme"
app:defaultValue="AUTO"
app:key="KEY_THEME"
app:useSimpleSummaryProvider="true" />
<Preference
android:icon="@drawable/ic_accent"
android:title="@string/setting_accent"
app:key="KEY_ACCENT"
app:summary="@string/setting_accent_unknown" />
<SwitchPreferenceCompat
android:title="@string/setting_edge"
app:allowDividerBelow="false"
app:defaultValue="false"
app:iconSpaceReserved="false"
app:key="KEY_EDGE"
app:summary="@string/setting_edge_desc" />
</PreferenceCategory>
<PreferenceCategory
android:layout="@layout/item_header"
android:title="@string/setting_display">
<ListPreference
android:icon="@drawable/ic_artist"
android:title="@string/setting_lib_display"
app:defaultValue="SHOW_ARTISTS"
app:entries="@array/entries_lib_display"
app:entryValues="@array/values_lib_display"
app:key="KEY_LIBRARY_DISPLAY_MODE"
app:useSimpleSummaryProvider="true" />
<SwitchPreferenceCompat
android:title="@string/setting_color_notif"
app:defaultValue="true"
app:iconSpaceReserved="false"
app:key="KEY_COLOR_NOTIF"
app:summary="@string/setting_color_desc" />
<SwitchPreferenceCompat
android:title="@string/setting_use_alt_action"
app:allowDividerBelow="false"
app:defaultValue="false"
app:iconSpaceReserved="false"
app:key="KEY_ALT_NOTIF_ACTION"
app:summaryOff="@string/setting_use_alt_loop"
app:summaryOn="@string/setting_use_alt_shuffle" />
</PreferenceCategory>
<PreferenceCategory
android:layout="@layout/item_header"
android:title="@string/setting_playback">
<SwitchPreferenceCompat
android:title="@string/setting_playback_audio_focus"
app:defaultValue="true"
app:iconSpaceReserved="false"
app:key="KEY_AUDIO_FOCUS"
app:summary="@string/setting_playback_focus_desc" />
<SwitchPreferenceCompat
android:title="@string/setting_playback_plug_mgt"
app:allowDividerBelow="false"
app:defaultValue="true"
app:iconSpaceReserved="false"
app:key="KEY_PLUG_MGT"
app:summary="@string/setting_playback_plug_mgt_desc" />
</PreferenceCategory>
<PreferenceCategory
android:layout="@layout/item_header"
android:title="@string/setting_behavior">
<ListPreference
android:title="@string/setting_behavior_song_playback_mode"
app:defaultValue="ALL_SONGS"
app:entries="@array/entries_song_playback_mode"
app:entryValues="@array/values_song_playback_mode"
app:iconSpaceReserved="false"
app:key="KEY_SONG_PLAY_MODE"
app:useSimpleSummaryProvider="true" />
<ListPreference
android:title="@string/setting_behavior_at_end"
app:defaultValue="LOOP_PAUSE"
app:entries="@array/entries_at_end"
app:entryValues="@array/values_at_end"
app:iconSpaceReserved="false"
app:key="KEY_AT_END"
app:useSimpleSummaryProvider="true" />
<SwitchPreferenceCompat
android:title="@string/setting_behavior_keep_shuffle"
app:defaultValue="false"
app:iconSpaceReserved="false"
app:key="KEY_KEEP_SHUFFLE"
app:summary="@string/setting_behavior_keep_shuffle_desc" />
<SwitchPreference
android:title="@string/setting_behavior_rewind_prev"
app:defaultValue="true"
app:iconSpaceReserved="false"
app:key="KEY_PREV_REWIND"
app:summary="@string/setting_behavior_rewind_prev_desc" />
<SeekBarPreference
android:defaultValue="@integer/rewind_threshold_default"
android:max="@integer/rewind_threshold_max"
android:title="@string/setting_behavior_rewind_threshold"
app:allowDividerBelow="false"
app:dependency="KEY_PREV_REWIND"
app:iconSpaceReserved="false"
app:key="KEY_REWIND_THRESHOLD"
app:min="@integer/rewind_threshold_min"
app:showSeekBarValue="true"
app:summary="@string/setting_behavior_rewind_threshold_desc" />
</PreferenceCategory>
<PreferenceCategory
android:title="@string/debug_title"
app:isPreferenceVisible="false"
app:layout="@layout/item_header">
<Preference
android:title="@string/debug_state_save"
app:iconSpaceReserved="false"
app:key="KEY_SAVE_STATE"
app:summary="@string/debug_state_save_desc" />
</PreferenceCategory>
</PreferenceScreen>

View file

@ -16,9 +16,9 @@
<Preference
android:icon="@drawable/ic_accent"
android:title="@string/setting_accent"
app:allowDividerBelow="false"
app:key="KEY_ACCENT"
app:summary="@string/setting_accent_unknown" />
</PreferenceCategory>
<PreferenceCategory
@ -113,6 +113,7 @@
android:defaultValue="@integer/rewind_threshold_default"
android:max="@integer/rewind_threshold_max"
android:title="@string/setting_behavior_rewind_threshold"
app:allowDividerBelow="false"
app:dependency="KEY_PREV_REWIND"
app:iconSpaceReserved="false"
app:key="KEY_REWIND_THRESHOLD"