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
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

View file

@ -14,20 +14,13 @@
~ 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-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="64dp">
<LinearLayout
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00000000"
android:layout_height="64dp"
android:baselineAligned="false"
android:orientation="horizontal"
tools:ignore="UselessParent">
android:orientation="horizontal">
<FrameLayout
android:id="@+id/icon_group"
@ -139,5 +132,3 @@
</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-->
<!--This FrameLayout IS necessary in order tp prevent fucking TouchWiz to interpret the "background="#00000000" as making the whole notification transparent-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="128dp">
<RelativeLayout
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00000000"
tools:ignore="UselessParent">
android:layout_height="128dp">
<ImageView
android:id="@+id/image"
@ -36,6 +29,18 @@
android:scaleType="centerCrop"
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
android:id="@+id/media_titles"
android:layout_width="match_parent"
@ -45,7 +50,9 @@
android:layout_marginStart="12dp"
android:layout_marginTop="8dp"
android:layout_toEndOf="@id/image"
android:layout_toLeftOf="@id/action_quit"
android:layout_toRightOf="@id/image"
android:layout_toStartOf="@id/action_quit"
android:minHeight="@dimen/notification_large_icon_height"
android:orientation="vertical">
@ -143,5 +150,3 @@
</LinearLayout>
</RelativeLayout>
</FrameLayout>