style: fix style issues

Fix some style issues that came from the colorAccent reworks.
This commit is contained in:
OxygenCobalt 2021-08-08 14:05:44 -06:00
parent 2f0df83cb2
commit 4cc433f7ef
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
30 changed files with 62 additions and 55 deletions

View file

@ -21,7 +21,7 @@ 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. I primarily built Auxio for myself, but you can use it too, I guess.
#### Note: Auxio is in a point that I am largely satisfied with. The app is still maintained, but feature additions will be slow. **Note: Auxio is in a point that I am largely satisfied with. The app is still maintained, but feature additions will be slow.**
## Screenshots ## Screenshots

View file

@ -13,7 +13,7 @@ android {
versionCode 7 versionCode 7
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 30 targetSdkVersion 30 // Note: Do not increment until platform stability
buildFeatures { buildFeatures {
dataBinding true dataBinding true
@ -94,7 +94,7 @@ dependencies {
implementation "com.google.android.exoplayer:exoplayer-core:2.14.2" implementation "com.google.android.exoplayer:exoplayer-core:2.14.2"
// Image loading // Image loading
implementation 'io.coil-kt:coil:1.3.1' implementation 'io.coil-kt:coil:1.3.2'
// Material // Material
implementation "com.google.android.material:material:1.4.0" implementation "com.google.android.material:material:1.4.0"
@ -102,7 +102,7 @@ dependencies {
// --- DEBUG --- // --- DEBUG ---
// Lint // Lint
ktlint 'com.pinterest:ktlint:0.42.0' ktlint 'com.pinterest:ktlint:0.42.1'
// Memory Leak checking // Memory Leak checking
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7' debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'

View file

@ -134,7 +134,6 @@ class MainFragment : Fragment() {
*/ */
private fun navigateWithItem(navController: NavController, item: MenuItem): Boolean { private fun navigateWithItem(navController: NavController, item: MenuItem): Boolean {
if (navController.currentDestination!!.id != item.itemId) { if (navController.currentDestination!!.id != item.itemId) {
// Create custom NavOptions myself so that animations work
val options = NavOptions.Builder() val options = NavOptions.Builder()
.setLaunchSingleTop(true) .setLaunchSingleTop(true)
.setEnterAnim(R.animator.nav_default_enter_anim) .setEnterAnim(R.animator.nav_default_enter_anim)

View file

@ -56,7 +56,7 @@ class PlaybackFragment : Fragment(), SeekBar.OnSeekBarChangeListener {
): View { ): View {
val normalTextColor = binding.playbackDurationCurrent.currentTextColor val normalTextColor = binding.playbackDurationCurrent.currentTextColor
val accentColor = Accent.get().getStateList(requireContext()) val accentColor = Accent.get().getStateList(requireContext())
val controlColor = R.color.control_color.toStateList(requireContext()) val controlColor = R.color.control.toStateList(requireContext())
// Can't set the tint of a MenuItem below Android 8, so use icons instead. // Can't set the tint of a MenuItem below Android 8, so use icons instead.
val iconQueueActive = R.drawable.ic_queue.toDrawable(requireContext()) val iconQueueActive = R.drawable.ic_queue.toDrawable(requireContext())

View file

@ -436,14 +436,14 @@ class PlaybackViewModel : ViewModel(), PlaybackStateManager.Callback {
} }
/** /**
* Enable animation on CompactPlaybackFragment * Enable animation on the play/pause button, usually done after the first LiveData fire
*/ */
fun enableAnimation() { fun enableAnimation() {
mCanAnimate = true mCanAnimate = true
} }
/** /**
* Disable animation on CompactPlaybackFragment * Disable animation on play/pause button, usually done after when a UI is created
*/ */
fun disableAnimation() { fun disableAnimation() {
mCanAnimate = false mCanAnimate = false

View file

@ -84,7 +84,7 @@ class AccentAdapter(
selectedViewHolder?.setSelected(false) selectedViewHolder?.setSelected(false)
selectedViewHolder = this selectedViewHolder = this
R.color.surface_color.toStateList(context) R.color.surface.toStateList(context)
} else { } else {
android.R.color.transparent.toStateList(context) android.R.color.transparent.toStateList(context)
} }

View file

@ -23,6 +23,7 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import androidx.appcompat.app.AlertDialog import androidx.appcompat.app.AlertDialog
import org.oxycblt.auxio.BuildConfig
import org.oxycblt.auxio.R import org.oxycblt.auxio.R
import org.oxycblt.auxio.databinding.DialogAccentBinding import org.oxycblt.auxio.databinding.DialogAccentBinding
import org.oxycblt.auxio.logD import org.oxycblt.auxio.logD
@ -102,6 +103,6 @@ class AccentDialog : LifecycleDialog() {
companion object { companion object {
const val TAG = "TAG_ACCENT_DIALOG" const val TAG = "TAG_ACCENT_DIALOG"
const val KEY_PENDING_ACCENT = "AXKEY_PEND_ACCENT" const val KEY_PENDING_ACCENT = BuildConfig.APPLICATION_ID + ".key.PENDING_ACCENT"
} }
} }

View file

@ -137,6 +137,8 @@ class BlacklistDialog : LifecycleDialog() {
val typeAndPath = DocumentsContract.getTreeDocumentId(docUri).split(":") val typeAndPath = DocumentsContract.getTreeDocumentId(docUri).split(":")
// Only the main drive is supported, since thats all we can get from MediaColumns.DATA // Only the main drive is supported, since thats all we can get from MediaColumns.DATA
// Unless I change the system to use the drive/directory system, but thats limited to
// Android 10
if (typeAndPath[0] == "primary") { if (typeAndPath[0] == "primary") {
return getRootPath() + "/" + typeAndPath.last() return getRootPath() + "/" + typeAndPath.last()
} }

View file

@ -37,7 +37,7 @@ abstract class LifecycleDialog : AppCompatDialogFragment() {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val builder = MaterialAlertDialogBuilder(requireActivity(), theme) val builder = MaterialAlertDialogBuilder(requireActivity(), theme)
// Setting the background in XML will also apply it to the tooltip for some inane reason // Setting the background in XML will also apply it to the tooltip for some insane reason
// so we have to do it programmatically instead. // so we have to do it programmatically instead.
builder.background = R.attr.colorSurface.resolveAttr(requireContext()).toDrawable() builder.background = R.attr.colorSurface.resolveAttr(requireContext()).toDrawable()

View file

@ -58,7 +58,7 @@ const val INTENT_REQUEST_CODE = 0xA0A0
*/ */
fun ImageButton.disable() { fun ImageButton.disable() {
if (isEnabled) { if (isEnabled) {
imageTintList = R.color.inactive_color.toStateList(context) imageTintList = R.color.inactive.toStateList(context)
isEnabled = false isEnabled = false
} }
} }

View file

@ -124,9 +124,8 @@ class WidgetProvider : AppWidgetProvider() {
updateAppWidget(name, RemoteViews(views)) updateAppWidget(name, RemoteViews(views))
} else { } else {
// Otherwise, we try our best to backport the responsive behavior to older versions. // Otherwise, we try our best to backport the responsive behavior to older versions.
// This is mostly a guess based on RemoteView's documentation, and it has some // This is mostly a guess based on RemoteView's documentation. It may be improved when
// problems [most notably UI jittering when resizing]. Its better than just using // Android 12's source is released.
// one layout though. It may be improved once Android 12's source is released.
// Each widget has independent dimensions, so we iterate through them all // Each widget has independent dimensions, so we iterate through them all
// and do this for each. // and do this for each.

View file

@ -2,7 +2,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp" android:width="32dp"
android:height="32dp" android:height="32dp"
android:tint="@color/control_color" android:tint="@color/control"
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24"> android:viewportHeight="24">
<group <group

View file

@ -2,7 +2,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp" android:width="32dp"
android:height="32dp" android:height="32dp"
android:tint="@color/control_color" android:tint="@color/control"
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24"> android:viewportHeight="24">
<group <group

View file

@ -2,7 +2,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" <vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp" android:width="24dp"
android:height="24dp" android:height="24dp"
android:tint="@color/inactive_color" android:tint="@color/inactive"
android:viewportWidth="24" android:viewportWidth="24"
android:viewportHeight="24"> android:viewportHeight="24">
<path <path

View file

@ -7,7 +7,7 @@
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<stroke <stroke
android:width="0.5dp" android:width="0.5dp"
android:color="@color/divider_color" /> android:color="@color/divider" />
</shape> </shape>
</item> </item>
</layer-list> </layer-list>

View file

@ -27,7 +27,7 @@
app:cardBackgroundColor="?attr/colorSurface" app:cardBackgroundColor="?attr/colorSurface"
app:cardCornerRadius="0dp" app:cardCornerRadius="0dp"
app:cardElevation="0dp" app:cardElevation="0dp"
app:strokeColor="@color/divider_color" app:strokeColor="@color/divider"
app:strokeWidth="1dp"> app:strokeWidth="1dp">
<androidx.constraintlayout.widget.ConstraintLayout <androidx.constraintlayout.widget.ConstraintLayout

View file

@ -65,7 +65,7 @@
<string name="set_lib_display">Musikbibliothekitems</string> <string name="set_lib_display">Musikbibliothekitems</string>
<string name="set_color_notif">Benachrichtigung farblich anpassen</string> <string name="set_color_notif">Benachrichtigung farblich anpassen</string>
<string name="set_color_notif_desc">Albumcover am Benachrichtigung zeigen</string> <string name="set_color_notif_desc">Albumcover am Benachrichtigung zeigen</string>
<string name="setting_show_covers">Albumcover anzeigen</string> <string name="set_show_covers">Albumcover anzeigen</string>
<string name="set_show_covers_desc">Ausschalten zu Speicherverbrauch sparen</string> <string name="set_show_covers_desc">Ausschalten zu Speicherverbrauch sparen</string>
<string name="set_quality_covers">MediaStore Cover ignorieren</string> <string name="set_quality_covers">MediaStore Cover ignorieren</string>
<string name="set_quality_covers_desc">Verbesst die Albumcover Qualität, jedoch länger Ladezeit und höher Speicherverbrauch beeinträchtigt</string> <string name="set_quality_covers_desc">Verbesst die Albumcover Qualität, jedoch länger Ladezeit und höher Speicherverbrauch beeinträchtigt</string>

View file

@ -68,7 +68,7 @@
<string name="set_lib_display">Ítem de biblioteca</string> <string name="set_lib_display">Ítem de biblioteca</string>
<string name="set_color_notif">Ajustar color de notificación</string> <string name="set_color_notif">Ajustar color de notificación</string>
<string name="set_color_notif_desc">Mostrar imagen de álbum en la notificación</string> <string name="set_color_notif_desc">Mostrar imagen de álbum en la notificación</string>
<string name="setting_show_covers">Mostrar carátula de álbum</string> <string name="set_show_covers">Mostrar carátula de álbum</string>
<string name="set_show_covers_desc">Desactivar para ahorrar uso de memoria</string> <string name="set_show_covers_desc">Desactivar para ahorrar uso de memoria</string>
<string name="set_quality_covers">Ignorar carátulas de MediaStore</string> <string name="set_quality_covers">Ignorar carátulas de MediaStore</string>
<string name="set_quality_covers_desc">Mejora la calidad de las carátulas de álbum, pero resulta en tiempos de carga lentos y un mayor uso de memoria</string> <string name="set_quality_covers_desc">Mejora la calidad de las carátulas de álbum, pero resulta en tiempos de carga lentos y un mayor uso de memoria</string>

View file

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

View file

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="surface_color">@color/surface_night</color> <color name="surface">@color/surface_night</color>
<color name="divider_color">#323232</color> <color name="divider">#323232</color>
<color name="selection_color">#484848</color> <color name="selection">#484848</color>
<color name="inactive_color">#404040</color> <color name="inactive">#404040</color>
<color name="control_color">#ffffff</color> <color name="control">#ffffff</color>
<color name="nav_color">#01151515</color> <color name="nav_bar">#01151515</color>
<!-- <!--
Base color set derived from Music Player GO. Base color set derived from Music Player GO.

View file

@ -66,7 +66,7 @@
<string name="set_lib_display">Bibliotheek Items</string> <string name="set_lib_display">Bibliotheek Items</string>
<string name="set_color_notif">Notificatie kleur aanpassen</string> <string name="set_color_notif">Notificatie kleur aanpassen</string>
<string name="set_color_notif_desc">Toon album art op notification</string> <string name="set_color_notif_desc">Toon album art op notification</string>
<string name="setting_show_covers">Toon albumhoezen</string> <string name="set_show_covers">Toon albumhoezen</string>
<string name="set_show_covers_desc">Schakel uit om geheugengebruik te besparen</string> <string name="set_show_covers_desc">Schakel uit om geheugengebruik te besparen</string>
<string name="set_quality_covers">Negeer Mediaopslag illustraties</string> <string name="set_quality_covers">Negeer Mediaopslag illustraties</string>
<string name="set_quality_covers_desc">Verhoogt de kwaliteit van de albumhoezen, maar resulteert in langere laadtijden en hoger geheugengebruik </string> <string name="set_quality_covers_desc">Verhoogt de kwaliteit van de albumhoezen, maar resulteert in langere laadtijden en hoger geheugengebruik </string>

View file

@ -2,8 +2,8 @@
<resources> <resources>
<!-- Template theme that handles edge-to-edge on other styles variants --> <!-- Template theme that handles edge-to-edge on other styles variants -->
<style name="Theme.Edge" parent="Theme.Master"> <style name="Theme.Edge" parent="Theme.Master">
<item name="android:navigationBarColor">@color/nav_bar</item>
<item name="android:statusBarColor">@android:color/transparent</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:windowLightStatusBar">true</item>
<item name="android:windowLightNavigationBar">true</item> <item name="android:windowLightNavigationBar">true</item>
</style> </style>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!-- Android 12 Splashscreen config -->
<style name="Theme.Splash" parent="Theme.Edge"> <style name="Theme.Splash" parent="Theme.Edge">
<item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item> <item name="android:windowSplashScreenAnimatedIcon">@drawable/ic_launcher_foreground</item>
</style> </style>

View file

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="surface_day">#fffafafa</color> <color name="surface_day">#fffafafa</color>
<color name="surface_night">#ff151515</color> <color name="surface_night">#ff121212</color>
<color name="surface_black">#ff000000</color> <color name="surface_black">#ff000000</color>
<color name="surface_color">@color/surface_day</color> <color name="surface">@color/surface_day</color>
<color name="selection_color">#cbcbcb</color> <color name="selection">#cbcbcb</color>
<color name="control_color">#202020</color> <color name="control">#202020</color>
<color name="divider_color">#cbcbcb</color> <color name="divider">#cbcbcb</color>
<color name="inactive_color">#c4c4c4</color> <color name="inactive">#c4c4c4</color>
<color name="nav_color">#01fafafa</color> <color name="nav_bar">#01fafafa</color>
<!-- <!--
Base color set derived from Music Player GO. Base color set derived from Music Player GO.

View file

@ -71,7 +71,7 @@
<string name="set_lib_display">Library Items</string> <string name="set_lib_display">Library Items</string>
<string name="set_color_notif">Colorize notification</string> <string name="set_color_notif">Colorize notification</string>
<string name="set_color_notif_desc">Show album art on notification</string> <string name="set_color_notif_desc">Show album art on notification</string>
<string name="setting_show_covers">Show album covers</string> <string name="set_show_covers">Show album covers</string>
<string name="set_show_covers_desc">Turn off to save memory usage</string> <string name="set_show_covers_desc">Turn off to save memory usage</string>
<string name="set_quality_covers">Ignore MediaStore covers</string> <string name="set_quality_covers">Ignore MediaStore covers</string>
<string name="set_quality_covers_desc">Increases the quality of the album covers, but results in longer loading times and higher memory usage</string> <string name="set_quality_covers_desc">Increases the quality of the album covers, but results in longer loading times and higher memory usage</string>

View file

@ -12,7 +12,7 @@
<!-- Toolbar popup menu --> <!-- Toolbar popup menu -->
<style name="ThemeOverlay.ToolbarPopup" parent="ThemeOverlay.AppCompat.DayNight"> <style name="ThemeOverlay.ToolbarPopup" parent="ThemeOverlay.AppCompat.DayNight">
<item name="android:colorBackground">?attr/colorSurface</item> <item name="android:colorBackground">?attr/colorSurface</item>
<item name="colorControlHighlight">@color/selection_color</item> <item name="colorControlHighlight">@color/selection</item>
</style> </style>
<!-- Base custom dialog theme. Don't try to understand this. --> <!-- Base custom dialog theme. Don't try to understand this. -->
@ -30,8 +30,8 @@
<!-- Normal DayNight dialog theme --> <!-- Normal DayNight dialog theme -->
<style name="Theme.CustomDialog" parent="Theme.CustomDialog.Base"> <style name="Theme.CustomDialog" parent="Theme.CustomDialog.Base">
<item name="colorSurface">@color/surface_color</item> <item name="colorSurface">@color/surface</item>
<item name="colorControlHighlight">@color/selection_color</item> <item name="colorControlHighlight">@color/selection</item>
</style> </style>
<!-- Black theme dialog theme --> <!-- Black theme dialog theme -->
@ -53,6 +53,7 @@
<!-- Custom dialog title theme --> <!-- Custom dialog title theme -->
<style name="Widget.TextView.Dialog.Title" parent="MaterialAlertDialog.MaterialComponents.Title.Text"> <style name="Widget.TextView.Dialog.Title" parent="MaterialAlertDialog.MaterialComponents.Title.Text">
<item name="android:fontFamily">@font/inter_bold</item> <item name="android:fontFamily">@font/inter_bold</item>
<item name="android:textColor">?android:attr/textColorPrimary</item>
<item name="android:textSize">@dimen/text_size_toolbar_header</item> <item name="android:textSize">@dimen/text_size_toolbar_header</item>
</style> </style>

View file

@ -4,19 +4,22 @@
<style name="Theme.Master" parent="Theme.MaterialComponents.DayNight.NoActionBar.Bridge" /> <style name="Theme.Master" parent="Theme.MaterialComponents.DayNight.NoActionBar.Bridge" />
<!-- Template theme that handles edge-to-edge on other styles variants --> <!-- Template theme that handles edge-to-edge on other styles variants -->
<style name="Theme.Edge" parent="Theme.Master" /> <style name="Theme.Edge" parent="Theme.Master" />
<!-- Android-12 Splashscreen config --> <!-- Android 12 Splashscreen config -->
<style name="Theme.Splash" parent="Theme.Edge" /> <style name="Theme.Splash" parent="Theme.Edge" />
<!-- Base theme --> <!-- Base theme -->
<style name="Theme.Base" parent="Theme.Splash"> <style name="Theme.Base" parent="Theme.Splash">
<!-- Colors --> <!-- TODO: Improve the color contrast on the dark theme [colorOnSurface] -->
<item name="colorSurface">@color/surface_color</item>
<item name="colorAccent">@color/design_default_color_primary</item>
<item name="colorPrimary">?attr/colorSurface</item> <!-- Colors -->
<item name="colorSecondary">?attr/colorSurface</item> <item name="colorSurface">@color/surface</item>
<item name="colorControlNormal">@color/control_color</item> <item name="colorAccent">@color/design_default_color_primary</item>
<item name="colorControlHighlight">@color/selection_color</item> <item name="colorOnSurface">#FFFFFF</item>
<item name="colorPrimary">?attr/colorAccent</item>
<item name="colorSecondary">?attr/colorAccent</item>
<item name="colorControlNormal">@color/control</item>
<item name="colorControlHighlight">@color/selection</item>
<item name="colorControlActivated">?attr/colorAccent</item> <item name="colorControlActivated">?attr/colorAccent</item>
<!-- Appearance --> <!-- Appearance -->

View file

@ -220,11 +220,12 @@
<item name="cornerRadius">0dp</item> <item name="cornerRadius">0dp</item>
</style> </style>
<style name="Widget.Button.Vibrant.Primary" parent="@style/Widget.Button.Vibrant.Base" /> <style name="Widget.Button.Vibrant.Primary" parent="@style/Widget.Button.Vibrant.Base">
<item name="android:textColor">?attr/colorSurface</item>
</style>
<style name="Widget.Button.Vibrant.Secondary" parent="@style/Widget.Button.Vibrant.Base"> <style name="Widget.Button.Vibrant.Secondary" parent="@style/Widget.Button.Vibrant.Base">
<item name="strokeColor">@color/divider_color</item> <item name="strokeColor">@color/divider</item>
<item name="strokeWidth">@dimen/width_play_stroke</item> <item name="strokeWidth">@dimen/width_play_stroke</item>
<item name="android:textColor">?attr/colorAccent</item>
</style> </style>
</resources> </resources>

View file

@ -76,6 +76,6 @@
</style> </style>
<style name="Theme.Neutral" parent="Theme.Base"> <style name="Theme.Neutral" parent="Theme.Base">
<item name="colorAccent">@color/control_color</item> <item name="colorAccent">@color/control</item>
</style> </style>
</resources> </resources>

View file

@ -48,7 +48,7 @@
app:iconSpaceReserved="false" app:iconSpaceReserved="false"
app:key="KEY_SHOW_COVERS" app:key="KEY_SHOW_COVERS"
app:summary="@string/set_show_covers_desc" app:summary="@string/set_show_covers_desc"
app:title="@string/setting_show_covers" /> app:title="@string/set_show_covers" />
<SwitchPreferenceCompat <SwitchPreferenceCompat
app:defaultValue="false" app:defaultValue="false"