diff options
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/view/CardView.java | 2 | ||||
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/view/SongView.java | 11 | ||||
-rw-r--r-- | app/src/main/res/drawable/card_rounded_corners.xml | 2 | ||||
-rw-r--r-- | app/src/main/res/layout/song_list_item.xml | 13 | ||||
-rw-r--r-- | app/src/main/res/values-large/integers.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values/attrs.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values/integers.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values/themes.xml | 3 |
8 files changed, 27 insertions, 7 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/view/CardView.java b/app/src/main/java/github/daneren2005/dsub/view/CardView.java index 973e63fa..7a38b13b 100644 --- a/app/src/main/java/github/daneren2005/dsub/view/CardView.java +++ b/app/src/main/java/github/daneren2005/dsub/view/CardView.java @@ -48,7 +48,7 @@ public class CardView extends FrameLayout{ setClipChildren(true); setBackgroundResource(R.drawable.card_rounded_corners); if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - setElevation(10.0f); + setElevation(getResources().getInteger(R.integer.Card_Elevation)); } } } diff --git a/app/src/main/java/github/daneren2005/dsub/view/SongView.java b/app/src/main/java/github/daneren2005/dsub/view/SongView.java index 625303b7..13620715 100644 --- a/app/src/main/java/github/daneren2005/dsub/view/SongView.java +++ b/app/src/main/java/github/daneren2005/dsub/view/SongView.java @@ -41,6 +41,7 @@ import java.io.File; public class SongView extends UpdateView2<MusicDirectory.Entry, Boolean> { private static final String TAG = SongView.class.getSimpleName(); + private TextView trackTextView; private TextView titleTextView; private TextView artistTextView; private TextView durationTextView; @@ -70,6 +71,7 @@ public class SongView extends UpdateView2<MusicDirectory.Entry, Boolean> { super(context); LayoutInflater.from(context).inflate(R.layout.song_list_item, this, true); + trackTextView = (TextView) findViewById(R.id.song_track); titleTextView = (TextView) findViewById(R.id.song_title); artistTextView = (TextView) findViewById(R.id.song_artist); durationTextView = (TextView) findViewById(R.id.song_duration); @@ -139,7 +141,10 @@ public class SongView extends UpdateView2<MusicDirectory.Entry, Boolean> { String title = song.getTitle(); Integer track = song.getTrack(); if(track != null && Util.getDisplayTrack(context)) { - title = String.format("%02d", track) + " " + title; + trackTextView.setText(String.format("%02d", track)); + trackTextView.setVisibility(View.VISIBLE); + } else { + trackTextView.setVisibility(View.GONE); } titleTextView.setText(title); @@ -246,12 +251,12 @@ public class SongView extends UpdateView2<MusicDirectory.Entry, Boolean> { if (playing) { if(!this.playing) { this.playing = playing; - titleTextView.setCompoundDrawablesWithIntrinsicBounds(DrawableTint.getDrawableRes(context, R.attr.playing), 0, 0, 0); + trackTextView.setCompoundDrawablesWithIntrinsicBounds(DrawableTint.getDrawableRes(context, R.attr.playing), 0, 0, 0); } } else { if(this.playing) { this.playing = playing; - titleTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); + trackTextView.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); } } diff --git a/app/src/main/res/drawable/card_rounded_corners.xml b/app/src/main/res/drawable/card_rounded_corners.xml index 5475c3d6..87e84c0d 100644 --- a/app/src/main/res/drawable/card_rounded_corners.xml +++ b/app/src/main/res/drawable/card_rounded_corners.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> - <solid android:color="@android:color/white"/> + <solid android:color="?attr/cardBackgroundColor"/> <corners android:radius="@dimen/Card.Radius"/> <padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" /> </shape>
\ No newline at end of file diff --git a/app/src/main/res/layout/song_list_item.xml b/app/src/main/res/layout/song_list_item.xml index 6bf025b8..ffd17e00 100644 --- a/app/src/main/res/layout/song_list_item.xml +++ b/app/src/main/res/layout/song_list_item.xml @@ -17,16 +17,25 @@ android:layout_height="wrap_content" android:layout_gravity="center_vertical"> + <TextView + android:id="@+id/song_track" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="left|center_vertical" + android:textAppearance="?android:attr/textAppearanceMedium" + android:textColor="?android:textColorSecondary" + android:paddingLeft="6dip" + android:drawablePadding="6dip"/> + <TextView android:id="@+id/song_title" android:layout_width="0dip" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:layout_weight="1" android:layout_gravity="left|center_vertical" android:textAppearance="?android:attr/textAppearanceMedium" android:singleLine="true" android:ellipsize="marquee" - android:drawablePadding="6dip" android:paddingLeft="6dip" android:paddingRight="6dip" android:textColor="?android:textColorPrimary"/> diff --git a/app/src/main/res/values-large/integers.xml b/app/src/main/res/values-large/integers.xml index 914ec84a..243d3fc1 100644 --- a/app/src/main/res/values-large/integers.xml +++ b/app/src/main/res/values-large/integers.xml @@ -2,4 +2,5 @@ <resources> <integer name="Grid.Columns">3</integer> <integer name="TextDescriptionLength">10</integer> + <integer name="Card.Elevation">4</integer> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index c4f80478..e4fa4b5a 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -55,6 +55,7 @@ <attr name="actionbarBackgroundColor" format="reference"/> <attr name="drawerTitleStyle" format="reference"/> <attr name="drawerSubtitleStyle" format="reference"/> + <attr name="cardBackgroundColor" format="reference"/> <declare-styleable name="SeekBarPreference"> <attr name="min" format="integer"/> diff --git a/app/src/main/res/values/integers.xml b/app/src/main/res/values/integers.xml index 05bcdb28..db45c591 100644 --- a/app/src/main/res/values/integers.xml +++ b/app/src/main/res/values/integers.xml @@ -3,4 +3,5 @@ <integer name="Grid.Columns">2</integer> <integer name="Grid.FullScreen.Columns">@integer/Grid.Columns</integer> <integer name="TextDescriptionLength">5</integer> + <integer name="Card.Elevation">10</integer> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 6321852f..8c6b1a59 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -62,6 +62,7 @@ <item name="drawerSubtitleStyle">@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle.Inverse</item> <item name="windowActionModeOverlay">true</item> <item name="actionModeBackground">?attr/colorPrimary</item> + <item name="cardBackgroundColor">@android:color/white</item> </style> <style name="Theme.DSub.Dark.Base" parent="@style/Theme.AppCompat"> <item name="offline_icon">@drawable/main_offline_dark</item> @@ -124,10 +125,12 @@ <item name="drawerSubtitleStyle">@style/TextAppearance.AppCompat.Widget.ActionBar.Subtitle</item> <item name="windowActionModeOverlay">true</item> <item name="actionModeBackground">?attr/colorPrimary</item> + <item name="cardBackgroundColor">@color/background_material_dark</item> </style> <style name="Theme.DSub.Light" parent="Theme.DSub.Light.Base"> </style> <style name="Theme.DSub.Dark" parent="Theme.DSub.Dark.Base"> + <item name="cardBackgroundColor">@android:color/black</item> </style> <style name="Theme.DSub.Black" parent="Theme.DSub.Dark"> <item name="android:windowBackground">@android:color/black</item> |