Merge remote-tracking branch 'origin/master'

This commit is contained in:
Karim Abou Zeid 2017-09-02 19:20:46 +02:00
commit a098e10959
3 changed files with 229 additions and 233 deletions

View file

@ -102,7 +102,7 @@ public class PlayingNotificationImpl extends PlayingNotification {
@Override @Override
public void onLoadFailed(Exception e, Drawable errorDrawable) { public void onLoadFailed(Exception e, Drawable errorDrawable) {
super.onLoadFailed(e, errorDrawable); super.onLoadFailed(e, errorDrawable);
update(null, Color.TRANSPARENT); update(null, Color.WHITE);
} }
private void update(@Nullable Bitmap bitmap, int bgColor) { private void update(@Nullable Bitmap bitmap, int bgColor) {
@ -115,10 +115,10 @@ public class PlayingNotificationImpl extends PlayingNotification {
} }
if (!PreferenceUtil.getInstance(service).coloredNotification()) { if (!PreferenceUtil.getInstance(service).coloredNotification()) {
bgColor = Color.TRANSPARENT; bgColor = Color.WHITE;
} }
setBackgroundColor(bgColor); setBackgroundColor(bgColor);
setNotificationContent(bgColor == Color.TRANSPARENT ? Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP : ColorUtil.isColorLight(bgColor)); setNotificationContent(ColorUtil.isColorLight(bgColor));
if (stopped) if (stopped)
return; // notification has been stopped before loading was finished return; // notification has been stopped before loading was finished

View file

@ -14,20 +14,13 @@
~ limitations under the License ~ limitations under the License
--> -->
<!--This FrameLayout IS necessary in order tp prevent fucking TouchWiz to interpret the "background="#00000000" as making the whole notification transparent--> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="64dp">
<LinearLayout
android:id="@+id/root" android:id="@+id/root"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="64dp"
android:background="#00000000"
android:baselineAligned="false" android:baselineAligned="false"
android:orientation="horizontal" android:orientation="horizontal">
tools:ignore="UselessParent">
<FrameLayout <FrameLayout
android:id="@+id/icon_group" android:id="@+id/icon_group"
@ -138,6 +131,4 @@
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</FrameLayout>

View file

@ -16,18 +16,11 @@
<!-- Layout to be used with only max 3 actions. It has a much larger picture at the left side--> <!-- Layout to be used with only max 3 actions. It has a much larger picture at the left side-->
<!--This FrameLayout IS necessary in order tp prevent fucking TouchWiz to interpret the "background="#00000000" as making the whole notification transparent--> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="128dp">
<RelativeLayout
android:id="@+id/root" android:id="@+id/root"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="128dp">
android:background="#00000000"
tools:ignore="UselessParent">
<ImageView <ImageView
android:id="@+id/image" android:id="@+id/image"
@ -36,6 +29,18 @@
android:scaleType="centerCrop" android:scaleType="centerCrop"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
<ImageButton
android:id="@+id/action_quit"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_margin="2dp"
android:background="@drawable/notification_selector"
android:padding="6dp"
android:scaleType="fitCenter"
tools:ignore="ContentDescription" />
<LinearLayout <LinearLayout
android:id="@+id/media_titles" android:id="@+id/media_titles"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -45,7 +50,9 @@
android:layout_marginStart="12dp" android:layout_marginStart="12dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_toEndOf="@id/image" android:layout_toEndOf="@id/image"
android:layout_toLeftOf="@id/action_quit"
android:layout_toRightOf="@id/image" android:layout_toRightOf="@id/image"
android:layout_toStartOf="@id/action_quit"
android:minHeight="@dimen/notification_large_icon_height" android:minHeight="@dimen/notification_large_icon_height"
android:orientation="vertical"> android:orientation="vertical">
@ -142,6 +149,4 @@
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</FrameLayout>