Change app style

Update the app style by modifying some colors & using Source Code Pro. Yes, this looks like Music Player GO but Ill probably make some more changes in the future.
This commit is contained in:
OxygenCobalt 2020-08-24 17:30:22 -06:00
parent 5662725c72
commit 1e4f80b779
10 changed files with 25 additions and 16 deletions

View file

@ -3,7 +3,6 @@ package org.oxycblt.auxio
import android.os.Bundle import android.os.Bundle
import android.util.Log import android.util.Log
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
class MainActivity : AppCompatActivity() { class MainActivity : AppCompatActivity() {
@ -11,7 +10,7 @@ class MainActivity : AppCompatActivity() {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main) setContentView(R.layout.activity_main)
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO) // AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
Log.d(this::class.simpleName, "Activity Created.") Log.d(this::class.simpleName, "Activity Created.")
} }

View file

@ -3,7 +3,6 @@ package org.oxycblt.auxio.music.processing
import android.app.Application import android.app.Application
import android.content.ContentResolver import android.content.ContentResolver
import android.database.Cursor import android.database.Cursor
import android.graphics.Bitmap
import android.graphics.ImageDecoder import android.graphics.ImageDecoder
import android.os.Build import android.os.Build
import android.provider.MediaStore import android.provider.MediaStore
@ -198,12 +197,11 @@ class MusicLoader(private val app: Application) {
// Album art loading during the initial load isn't really practical for a large amount of albums // Album art loading during the initial load isn't really practical for a large amount of albums
// Use glide or something // Use glide or something
val artUri = id.toAlbumArtURI() val artUri = id.toAlbumArtURI()
var cover: Bitmap? = null
// Get the album art through either ImageDecoder or MediaStore depending on the // Get the album art through either ImageDecoder or MediaStore depending on the
// version. // version.
try { val cover = try {
cover = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
ImageDecoder.decodeBitmap( ImageDecoder.decodeBitmap(
ImageDecoder.createSource(resolver, artUri) ImageDecoder.createSource(resolver, artUri)
) )
@ -211,7 +209,7 @@ class MusicLoader(private val app: Application) {
MediaStore.Images.Media.getBitmap(resolver, artUri) MediaStore.Images.Media.getBitmap(resolver, artUri)
} }
} catch (noFound: FileNotFoundException) { } catch (noFound: FileNotFoundException) {
cover = null null
} }
albums.add( albums.add(

Binary file not shown.

Binary file not shown.

View file

@ -31,9 +31,11 @@
android:id="@+id/albumNameText" android:id="@+id/albumNameText"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@{album.title}"
android:textAppearance="?attr/textAppearanceListItem"
android:layout_marginStart="@dimen/margin_medium" android:layout_marginStart="@dimen/margin_medium"
android:fontFamily="@font/source_sans_pro"
android:text="@{album.title}"
android:textAppearance="?android:attr/textAppearanceListItem"
android:textColor="?android:attr/textColorPrimary"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.05" app:layout_constraintHorizontal_bias="0.05"

View file

@ -10,10 +10,10 @@
<androidx.appcompat.widget.Toolbar <androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" android:layout_height="?android:attr/actionBarSize"
android:background="?attr/colorPrimary" android:background="?android:attr/windowBackground"
android:elevation="@dimen/elevation_normal" android:elevation="@dimen/elevation_normal"
android:textColor="?attr/titleTextColor" app:titleTextAppearance="@style/ToolbarText"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:title="@string/title_library_fragment" /> app:title="@string/title_library_fragment" />

View file

@ -18,7 +18,7 @@
android:id="@+id/loading_bar" android:id="@+id/loading_bar"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:indeterminateTint="?attr/colorAccent" android:indeterminateTint="?android:attr/colorAccent"
android:indeterminateTintMode="src_in" android:indeterminateTintMode="src_in"
android:paddingBottom="@dimen/padding_small" android:paddingBottom="@dimen/padding_small"
app:layout_constraintBottom_toTopOf="@+id/error_text" app:layout_constraintBottom_toTopOf="@+id/error_text"
@ -32,6 +32,7 @@
android:id="@+id/error_text" android:id="@+id/error_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:fontFamily="@font/source_sans_pro"
app:layout_constraintBottom_toTopOf="@+id/reset_button" app:layout_constraintBottom_toTopOf="@+id/reset_button"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_bias="0.5"
@ -44,8 +45,9 @@
style="@style/Widget.AppCompat.Button.Borderless.Colored" style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/label_retry" android:fontFamily="@font/source_sans_pro"
android:onClick="@{() -> loadingModel.retry()}" android:onClick="@{() -> loadingModel.retry()}"
android:text="@string/label_retry"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"

View file

@ -9,4 +9,7 @@
<color name="black">#000000</color> <color name="black">#000000</color>
<color name="white">#ffffff</color> <color name="white">#ffffff</color>
<!-- TODO: Placeholder accent color, need to remove -->
<color name="blue">#2979FF</color>
</resources> </resources>

View file

@ -7,7 +7,7 @@
<string name="label_retry">Retry</string> <string name="label_retry">Retry</string>
<string name="title_library_fragment">Library</string> <string name="title_library_fragment"><b>Library</b></string>
<string name="description_cover_art">Cover art for </string> <string name="description_cover_art">Cover art for </string>
</resources> </resources>

View file

@ -3,6 +3,11 @@
<!-- Base theme --> <!-- Base theme -->
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar"> <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<!-- TODO: Make this accent settable --> <!-- TODO: Make this accent settable -->
<item name="colorAccent">#295DE5</item> <item name="colorAccent">@color/blue</item>
</style>
<style name="ToolbarText" parent="TextAppearance.AppCompat.Title">
<item name="android:fontFamily">@font/source_sans_pro_black</item>
<item name="android:textColor">@color/blue</item>
</style> </style>
</resources> </resources>