Update styling/colors
Update the styling and add some colors that will be used as the base theme set in the future.
This commit is contained in:
parent
f511cfd161
commit
a6e8007972
11 changed files with 96 additions and 48 deletions
|
@ -10,7 +10,7 @@
|
|||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
android:theme="@style/BaseTheme">
|
||||
<activity android:name=".MainActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
|
|
@ -11,7 +11,7 @@ import androidx.lifecycle.Observer
|
|||
import androidx.lifecycle.ViewModelProvider
|
||||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.auxio.databinding.FragmentLibraryBinding
|
||||
import org.oxycblt.auxio.recycler.AlbumDataAdapter
|
||||
import org.oxycblt.auxio.library.recycler.AlbumDataAdapter
|
||||
|
||||
class LibraryFragment : Fragment() {
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package org.oxycblt.auxio.recycler
|
||||
package org.oxycblt.auxio.library.recycler
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.ListAdapter
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import org.oxycblt.auxio.databinding.AlbumItemBinding
|
||||
import org.oxycblt.auxio.music.models.Album
|
||||
import org.oxycblt.auxio.recycler.AlbumViewHolder
|
||||
|
||||
class AlbumDataAdapter : ListAdapter<Album, AlbumViewHolder>(DiffCallback) {
|
||||
|
||||
|
@ -38,23 +38,3 @@ class AlbumDataAdapter : ListAdapter<Album, AlbumViewHolder>(DiffCallback) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
class AlbumViewHolder(
|
||||
private var binding: AlbumItemBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
|
||||
// Bind the view w/new data
|
||||
fun bind(album: Album) {
|
||||
binding.album = album
|
||||
|
||||
if (album.cover == null) {
|
||||
// If there is no cover, clear the ImageView so that the previous
|
||||
// View's cover doesnt stick around.
|
||||
binding.cover.setImageResource(android.R.color.transparent)
|
||||
} else {
|
||||
binding.cover.setImageBitmap(album.cover)
|
||||
}
|
||||
|
||||
binding.executePendingBindings()
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package org.oxycblt.auxio.recycler
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import org.oxycblt.auxio.databinding.AlbumItemBinding
|
||||
import org.oxycblt.auxio.music.models.Album
|
||||
|
||||
// Generic ViewHolder for an album
|
||||
class AlbumViewHolder(
|
||||
private var binding: AlbumItemBinding
|
||||
) : RecyclerView.ViewHolder(binding.root) {
|
||||
|
||||
// Bind the view w/new data
|
||||
fun bind(album: Album) {
|
||||
binding.album = album
|
||||
|
||||
if (album.cover == null) {
|
||||
// If there is no cover, clear the ImageView so that the previous
|
||||
// View's cover doesnt stick around.
|
||||
binding.cover.setImageResource(android.R.color.transparent)
|
||||
} else {
|
||||
binding.cover.setImageBitmap(album.cover)
|
||||
}
|
||||
|
||||
binding.executePendingBindings()
|
||||
}
|
||||
}
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/cover"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_width="@dimen/cover_size"
|
||||
android:layout_height="@dimen/cover_size"
|
||||
android:contentDescription="@{@string/description_cover_art + album.title}"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -36,7 +36,6 @@
|
|||
android:text="@{album.title}"
|
||||
android:textAppearance="?android:attr/textAppearanceListItem"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:fontFamily="@font/inter"
|
||||
app:layout_constraintBottom_toTopOf="@+id/song_count"
|
||||
app:layout_constraintStart_toEndOf="@+id/cover"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
@ -48,8 +47,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/margin_small"
|
||||
android:fontFamily="@font/inter"
|
||||
android:textAppearance="?android:attr/textAppearanceListItem"
|
||||
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/cover"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
android:layout_height="?android:attr/actionBarSize"
|
||||
android:background="?android:attr/windowBackground"
|
||||
android:elevation="@dimen/elevation_normal"
|
||||
app:titleTextAppearance="@style/ToolbarText"
|
||||
app:titleTextAppearance="@style/ToolbarStyle"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:title="@string/title_library_fragment" />
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
android:id="@+id/loading_bar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminateTint="?android:attr/colorAccent"
|
||||
android:indeterminateTint="@color/blue"
|
||||
android:indeterminateTintMode="src_in"
|
||||
android:paddingBottom="@dimen/padding_tiny"
|
||||
app:layout_constraintBottom_toTopOf="@+id/error_text"
|
||||
|
@ -49,6 +49,7 @@
|
|||
android:text="@string/label_retry"
|
||||
android:visibility="gone"
|
||||
android:fontFamily="@font/inter_semibold"
|
||||
android:textColor="@color/blue"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.5"
|
||||
|
|
28
app/src/main/res/values-night/colors.xml
Normal file
28
app/src/main/res/values-night/colors.xml
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="background">#151515</color>
|
||||
|
||||
<!--
|
||||
Base color set derived from Music Player GO.
|
||||
https://github.com/enricocid/Music-Player-GO
|
||||
-->
|
||||
<color name="red">#ef9a9a</color>
|
||||
<color name="pink">#f48fb1</color>
|
||||
<color name="purple">#ce93d8</color>
|
||||
<color name="deep_purple">#b39ddb</color>
|
||||
<color name="indigo">#9fa8da</color>
|
||||
<color name="blue">#90caf9</color>
|
||||
<color name="light_blue">#81d4fa</color>
|
||||
<color name="cyan">#80deea</color>
|
||||
<color name="teal">#80cbc4</color>
|
||||
<color name="green">#a5d6a7</color>
|
||||
<color name="light_green">#c5e1a5</color>
|
||||
<color name="lime">#e6ee9c</color>
|
||||
<color name="yellow">#fff59d</color>
|
||||
<color name="amber">#ffe082</color>
|
||||
<color name="orange">#ffcc80</color>
|
||||
<color name="deep_orange">#ffab91</color>
|
||||
<color name="brown">#bcaaa4</color>
|
||||
<color name="grey">#eeeeee</color>
|
||||
<color name="blue_grey">#b0bec5</color>
|
||||
</resources>
|
|
@ -1,15 +1,28 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Dark Colors -->
|
||||
<color name="gray">#424242</color>
|
||||
<color name="lightGray">#6d6d6d</color>
|
||||
<color name="darkGray">#1b1b1b</color>
|
||||
<color name="background">#fafafa</color>
|
||||
|
||||
<color name="secondaryGray">#484848</color>
|
||||
<color name="black">#000000</color>
|
||||
|
||||
<color name="white">#ffffff</color>
|
||||
|
||||
<!-- TODO: Placeholder accent color, need to remove -->
|
||||
<color name="blue">#2979FF</color>
|
||||
<!--
|
||||
Base color set derived from Music Player GO.
|
||||
https://github.com/enricocid/Music-Player-GO
|
||||
-->
|
||||
<color name="red">#f44336</color>
|
||||
<color name="pink">#e91e63</color>
|
||||
<color name="purple">#9c27b0</color>
|
||||
<color name="deep_purple">#673ab7</color>
|
||||
<color name="indigo">#3f51b5</color>
|
||||
<color name="blue">#2196f3</color>
|
||||
<color name="light_blue">#03a9f4</color>
|
||||
<color name="cyan">#00bcd4</color>
|
||||
<color name="teal">#009688</color>
|
||||
<color name="green">#4caf50</color>
|
||||
<color name="light_green">#8bc34a</color>
|
||||
<color name="lime">#cddc39</color>
|
||||
<color name="yellow">#ffeb3b</color>
|
||||
<color name="amber">#ffc107</color>
|
||||
<color name="orange">#ff9800</color>
|
||||
<color name="deep_orange">#ff5722</color>
|
||||
<color name="brown">#795548</color>
|
||||
<color name="grey">#9e9e9e</color>
|
||||
<color name="blue_grey">#607d8b</color>
|
||||
</resources>
|
|
@ -5,7 +5,8 @@
|
|||
|
||||
<dimen name="margin_small">8dp</dimen>
|
||||
|
||||
<dimen name="cover_size">44dp</dimen>
|
||||
<dimen name="cover_size">64dp</dimen>
|
||||
<dimen name="cover_size_compact">42dp</dimen>
|
||||
|
||||
<dimen name="elevation_normal">4dp</dimen>
|
||||
</resources>
|
|
@ -1,13 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Base theme -->
|
||||
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||
<!-- TODO: Make this accent settable -->
|
||||
<item name="colorAccent">@color/blue</item>
|
||||
<style name="BaseTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||
<item name="android:windowBackground">@color/background</item>
|
||||
<item name="android:statusBarColor">@android:color/black</item>
|
||||
<item name="android:fontFamily">@font/inter</item>
|
||||
</style>
|
||||
|
||||
<style name="ToolbarText" parent="TextAppearance.AppCompat.Title">
|
||||
<item name="android:textColor">@color/blue</item>
|
||||
<style name="ToolbarStyle" parent="TextAppearance.Widget.AppCompat.Toolbar.Title">
|
||||
<item name="android:fontFamily">@font/inter_black</item>
|
||||
<item name="android:textColor">@color/blue</item>
|
||||
</style>
|
||||
</resources>
|
Loading…
Reference in a new issue