From dcac18f75656f048b03ac77ee783c2ebeb70a770 Mon Sep 17 00:00:00 2001 From: Eugene Cheung Date: Wed, 28 Jun 2017 17:50:40 -0400 Subject: [PATCH 1/2] Default notification background to white --- .../service/notification/PlayingNotificationImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/kabouzeid/gramophone/service/notification/PlayingNotificationImpl.java b/app/src/main/java/com/kabouzeid/gramophone/service/notification/PlayingNotificationImpl.java index 843affc6..25408dc4 100644 --- a/app/src/main/java/com/kabouzeid/gramophone/service/notification/PlayingNotificationImpl.java +++ b/app/src/main/java/com/kabouzeid/gramophone/service/notification/PlayingNotificationImpl.java @@ -102,7 +102,7 @@ public class PlayingNotificationImpl extends PlayingNotification { @Override public void onLoadFailed(Exception e, Drawable errorDrawable) { super.onLoadFailed(e, errorDrawable); - update(null, Color.TRANSPARENT); + update(null, Color.WHITE); } private void update(@Nullable Bitmap bitmap, int bgColor) { @@ -115,10 +115,10 @@ public class PlayingNotificationImpl extends PlayingNotification { } if (!PreferenceUtil.getInstance(service).coloredNotification()) { - bgColor = Color.TRANSPARENT; + bgColor = Color.WHITE; } setBackgroundColor(bgColor); - setNotificationContent(bgColor == Color.TRANSPARENT ? Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP : ColorUtil.isColorLight(bgColor)); + setNotificationContent(ColorUtil.isColorLight(bgColor)); if (stopped) return; // notification has been stopped before loading was finished From aa736badf2f0fc978bf16b8a5c2eb174e9eb1d2b Mon Sep 17 00:00:00 2001 From: Eugene Cheung Date: Wed, 28 Jun 2017 17:51:07 -0400 Subject: [PATCH 2/2] Remove unnecessary wrapper layouts --- app/src/main/res/layout/notification.xml | 219 ++++++++--------- app/src/main/res/layout/notification_big.xml | 243 ++++++++++--------- 2 files changed, 229 insertions(+), 233 deletions(-) diff --git a/app/src/main/res/layout/notification.xml b/app/src/main/res/layout/notification.xml index bac198e7..deaba784 100644 --- a/app/src/main/res/layout/notification.xml +++ b/app/src/main/res/layout/notification.xml @@ -14,130 +14,121 @@ ~ limitations under the License --> - - + android:layout_height="64dp" + android:baselineAligned="false" + android:orientation="horizontal"> + + + + + + + android:layout_height="wrap_content" + android:layout_gravity="fill_vertical" + android:layout_weight="1" + android:minHeight="@dimen/notification_large_icon_height" + android:orientation="vertical"> - - - - - - - + android:ellipsize="marquee" + android:fadingEdge="horizontal" + android:gravity="bottom" + android:singleLine="true" + android:textAppearance="@style/Theme.Phonograph.Notification.Title" + tools:ignore="NestedWeights" /> - - - - - - - - - - - - - - - - + - \ No newline at end of file + + + + + + + + + + + + diff --git a/app/src/main/res/layout/notification_big.xml b/app/src/main/res/layout/notification_big.xml index 535a85bc..50428d2f 100644 --- a/app/src/main/res/layout/notification_big.xml +++ b/app/src/main/res/layout/notification_big.xml @@ -16,132 +16,137 @@ - - - + - + + + + + + + + + + + + + + + - + - + - + - - - - - - - - - - - - - - - - - - \ No newline at end of file +