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.
This commit is contained in:
OxygenCobalt 2022-01-15 20:06:45 -07:00
parent 4dcc3c3b69
commit 95e8b06f19
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
11 changed files with 29 additions and 36 deletions

View file

@ -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
<p align="center">
@ -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

View file

@ -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.")
}

View file

@ -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
}
}

View file

@ -3,7 +3,7 @@
<!-- Template theme that handles edge-to-edge on other styles variants -->
<style name="Theme.Auxio.V27" parent="Theme.Auxio">
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@color/nav_bar</item>
<item name="android:navigationBarColor">@color/chrome_transparent</item>
<item name="android:windowLightStatusBar">false</item>
<item name="android:windowLightNavigationBar">false</item>
</style>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="nav_bar">#01151515</color>
<color name="chrome_transparent">#01151515</color>
<color name="red_primary">#FFB4A8</color>
<color name="red_on_primary">#680001</color>

View file

@ -2,7 +2,7 @@
<resources>
<!-- Template theme that handles edge-to-edge on other styles variants -->
<style name="Theme.Auxio.V27" parent="Theme.Auxio">
<item name="android:navigationBarColor">@color/nav_bar</item>
<item name="android:navigationBarColor">@color/chrome_transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:windowLightNavigationBar">true</item>

View file

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="nav_bar">#01fafafa</color>
<color name="chrome_transparent">#01fafafa</color>
<color name="chrome_translucent">#80000000</color>
<color name="red_primary">#BC1714</color>
<color name="red_on_primary">#FFFFFF</color>

View file

@ -4,7 +4,8 @@
<style name="Theme.Auxio" parent="Theme.Material3.DayNight.NoActionBar" />
<!-- Template theme that handles edge-to-edge on other styles variants -->
<style name="Theme.Auxio.V27" parent="Theme.Auxio">
<item name="android:statusBarColor">@android:color/black</item>
<item name="android:statusBarColor">@color/chrome_translucent</item>
<item name="android:navigationBarColor">@color/chrome_translucent</item>
</style>
<!-- Android 12 configuration -->
<style name="Theme.Auxio.V31" parent="Theme.Auxio.V27" />

View file

@ -202,10 +202,11 @@ To prevent any strange bugs, all integer representations must be unique. A table
0xA110 | ReplayGainMode.OFF
0xA111 | ReplayGainMode.TRACK
0xA112 | ReplayGainMode.ALBUM
0xA113 | ReplayGainMode.DYNAMIC
```
Some datatypes [like `Tab` and `Sort`] have even more fine-grained integer representations for other data. More information can be found in
the documentation for these datatypes.
the documentation for those datatypes.
## Package-by-package rundown

View file

@ -7,17 +7,6 @@ This FAQ will be continually updated as new changes and updates are made to Auxi
Auxio is available on the [F-Droid](https://f-droid.org/en/packages/org.oxycblt.auxio/) repository.
Auxio is not and will never be on the play store due to it being a proprietary and draconian platform.
#### Auxio doesn't load my music correctly!
This is probably caused by one of two reasons:
1. If other players like Phonograph, Retro Music, or Music Player GO load it correctly, then Auxio has a bug and it should be [reported](https://github.com/OxygenCobalt/Auxio/issues).
2. If the aforementioned players don't work, but players like Vanilla Music and VLC do, then it's a problem with the Media APIs that Auxio relies on. There is nothing I can do about it.
#### I have a large library and Auxio takes really long to load it!
This is expected since reading from the audio database takes awhile, especially with libraries containing 10k songs or more.
#### Why ExoPlayer?
ExoPlayer is far more flexible than the native MediaPlayer API, which allows consistent behavior across devices & OEMs and the
@ -30,6 +19,17 @@ As per the [Supported ExoPlayer Formats](https://exoplayer.dev/supported-formats
MP4, MP3, MKA, OGG, WAV, MPEG, AAC on all versions of Android. Auxio also supports FLAC on all versions
of Android through the use of the ExoPlayer FLAC extension.
#### Auxio doesn't load my music correctly!
This is probably caused by one of two reasons:
1. If other players like Phonograph, Retro Music, or Music Player GO load it correctly, then Auxio has a bug and it should be [reported](https://github.com/OxygenCobalt/Auxio/issues).
2. If the aforementioned players don't work, but players like Vanilla Music and VLC do, then it's a problem with the Media APIs that Auxio relies on. There is nothing I can do about it.
#### I have a large library and Auxio takes really long to load it!
This is expected since reading from the audio database takes awhile, especially with libraries containing 10k songs or more.
#### ReplayGain isn't working on my music!
This is for a couple reason:
@ -48,10 +48,6 @@ gain depending on if the current playback is from an album or not.
As per the [Material Design Guidelines](https://material.io/design/color/dark-theme.html), accents should be less
saturated on dark mode to reduce eye strain and to increase visual cohesion.
#### Why isn't edge-to-edge enabled on versions below Oreo?
The APIs for changing system bar colors were only added in API Level 27 (Android Oreo), meaning that edge-to-edge will not work below that version.
#### Does this app keep/send any information about myself or my device?
Auxio does not log any information about the device or its owner, and it has no internet access to send that information off in the first place.

View file

@ -74,7 +74,7 @@ sh("rm -rf deps")
print(INFO + "info:" + NC + " cloning ExoPlayer...")
sh("git clone https://github.com/oxygencobalt/ExoPlayer.git " + exoplayer_path)
os.chdir(exoplayer_path)
sh("git checkout release-v2")
sh("git checkout auxio")
flac_ext_jni_path = os.path.join("extensions", "flac", "src", "main", "jni")
print(INFO + "info:" + NC + " installing FLAC extension...")