From 95e8b06f194d916ef23b45e6a71891391b36bc39 Mon Sep 17 00:00:00 2001 From: OxygenCobalt Date: Sat, 15 Jan 2022 20:06:45 -0700 Subject: [PATCH] style: extend edge-to-edge on all versions Extend edge-to-edge to versions below Android Oreo. This is done through tinting the navigation bar colors on those versions, circumventing the coloring issue. --- README.md | 8 +++--- .../java/org/oxycblt/auxio/MainActivity.kt | 6 +---- .../java/org/oxycblt/auxio/util/ViewUtil.kt | 8 ++---- .../main/res/values-night-v27/styles_core.xml | 2 +- app/src/main/res/values-night/colors.xml | 2 +- app/src/main/res/values-v27/styles_core.xml | 2 +- app/src/main/res/values/colors.xml | 3 ++- app/src/main/res/values/styles_core.xml | 3 ++- info/ARCHITECTURE.md | 3 ++- info/FAQ.md | 26 ++++++++----------- prebuild.py | 2 +- 11 files changed, 29 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 4835cd537..4f67749de 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ Auxio is a local music player with a fast, reliable UI/UX without the many usele I primarily built Auxio for myself, but you can use it too, I guess. +**This branch is the development version of the repository. For a stable version, see the master branch.** + ## Screenshots

@@ -38,11 +40,11 @@ I primarily built Auxio for myself, but you can use it too, I guess. - [ExoPlayer](https://exoplayer.dev/) based playback - Customizable UI & Behavior -- Genres/Artists/Albums/Songs support -- Intuitive queue system +- Genres/Artists/Albums/Songs indexing - Reliable playback state persistence +- ReplayGain support (On MP3, FLAC, OGG, and OPUS) - Material You (Android 12+ only) -- Edge-to-edge (Android 8.1+ Only) +- Edge-to-edge - Embedded covers support - Search Functionality - Audio/Headset focus diff --git a/app/src/main/java/org/oxycblt/auxio/MainActivity.kt b/app/src/main/java/org/oxycblt/auxio/MainActivity.kt index 9b55e1825..b6321d07a 100644 --- a/app/src/main/java/org/oxycblt/auxio/MainActivity.kt +++ b/app/src/main/java/org/oxycblt/auxio/MainActivity.kt @@ -54,11 +54,7 @@ class MainActivity : AppCompatActivity() { this, R.layout.activity_main ) - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) { - applyEdgeToEdgeWindow(binding) - } else { - binding.root.fitsSystemWindows = true - } + applyEdgeToEdgeWindow(binding) logD("Activity created.") } diff --git a/app/src/main/java/org/oxycblt/auxio/util/ViewUtil.kt b/app/src/main/java/org/oxycblt/auxio/util/ViewUtil.kt index 95de3aa61..967fcea9c 100644 --- a/app/src/main/java/org/oxycblt/auxio/util/ViewUtil.kt +++ b/app/src/main/java/org/oxycblt/auxio/util/ViewUtil.kt @@ -130,7 +130,7 @@ val WindowInsets.systemBarsCompat: Rect get() { } } - Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1 -> { + else -> { @Suppress("DEPRECATION") Rect( systemWindowInsetLeft, @@ -139,8 +139,6 @@ val WindowInsets.systemBarsCompat: Rect get() { systemWindowInsetBottom ) } - - else -> Rect(0, 0, 0, 0) } } @@ -155,13 +153,11 @@ fun WindowInsets.replaceInsetsCompat(left: Int, top: Int, right: Int, bottom: In .build() } - Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1 -> { + else -> { @Suppress("DEPRECATION") replaceSystemWindowInsets( left, top, right, bottom ) } - - else -> this } } diff --git a/app/src/main/res/values-night-v27/styles_core.xml b/app/src/main/res/values-night-v27/styles_core.xml index 60568bbe6..c818dcbda 100644 --- a/app/src/main/res/values-night-v27/styles_core.xml +++ b/app/src/main/res/values-night-v27/styles_core.xml @@ -3,7 +3,7 @@ diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index a5210edb6..87590ca2a 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -1,6 +1,6 @@ - #01151515 + #01151515 #FFB4A8 #680001 diff --git a/app/src/main/res/values-v27/styles_core.xml b/app/src/main/res/values-v27/styles_core.xml index 0ea96f0b2..b2af32ca1 100644 --- a/app/src/main/res/values-v27/styles_core.xml +++ b/app/src/main/res/values-v27/styles_core.xml @@ -2,7 +2,7 @@