Hopefully fixed the "transparent notification bug" for Samsung (TouchWiz) devices.

This commit is contained in:
Karim Abou Zeid 2015-07-16 20:46:18 +02:00
commit 0a0ba498be
2 changed files with 255 additions and 229 deletions

View file

@ -14,21 +14,31 @@
~ limitations under the License
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:internal="http://schemas.android.com/apk/prv/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root"
android:layout_width="match_parent"
android:layout_height="64dp"
android:background="#00000000"
android:orientation="horizontal"
internal:layout_maxHeight="64dp"
internal:layout_minHeight="64dp"
tools:ignore="DisableBaselineAlignment">
<!--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"
xmlns:internal="http://schemas.android.com/apk/prv/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="64dp"
internal:layout_maxHeight="64dp"
internal:layout_minHeight="64dp">
<LinearLayout
android:id="@+id/root"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:internal="http://schemas.android.com/apk/prv/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00000000"
android:baselineAligned="false"
android:orientation="horizontal"
tools:ignore="UselessParent">
<FrameLayout
android:id="@+id/icon_group"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:internal="http://schemas.android.com/apk/prv/res/android"
android:layout_width="@dimen/notification_large_icon_width"
android:layout_height="@dimen/notification_large_icon_height"
android:layout_weight="0">
@ -90,9 +100,10 @@
android:orientation="horizontal"
tools:ignore="UnusedAttribute">
<!-- media buttons will be added here -->
<ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
<ImageButton
android:id="@+id/action_prev"
style="@style/Widget.AppCompat.Button.Borderless"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="48dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
@ -105,9 +116,10 @@
android:src="@drawable/ic_skip_previous_white_36dp"
tools:ignore="ContentDescription" />
<ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
<ImageButton
android:id="@+id/action_play_pause"
style="@style/Widget.AppCompat.Button.Borderless"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="48dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
@ -120,9 +132,10 @@
android:src="@drawable/ic_play_arrow_white_36dp"
tools:ignore="ContentDescription" />
<ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
<ImageButton
android:id="@+id/action_next"
style="@style/Widget.AppCompat.Button.Borderless"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="48dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
@ -136,3 +149,4 @@
tools:ignore="ContentDescription" />
</LinearLayout>
</LinearLayout>
</FrameLayout>

View file

@ -15,13 +15,20 @@
-->
<!-- Layout to be used with only max 3 actions. It has a much larger picture at the left side-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<!--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"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/root"
android:background="#00000000"
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">
<ImageView
android:id="@+id/icon"
android:layout_width="@dimen/notification_big_image_size"
@ -29,9 +36,10 @@
android:scaleType="centerCrop"
tools:ignore="ContentDescription" />
<ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
<ImageButton
android:id="@+id/action_quit"
style="@style/Widget.AppCompat.Button.Borderless"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_alignParentEnd="true"
@ -108,9 +116,10 @@
android:orientation="horizontal"
tools:ignore="UnusedAttribute">
<!-- media buttons will be added here -->
<ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
<ImageButton
android:id="@+id/action_prev"
style="@style/Widget.AppCompat.Button.Borderless"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="48dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
@ -123,9 +132,10 @@
android:src="@drawable/ic_skip_previous_white_36dp"
tools:ignore="ContentDescription" />
<ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
<ImageButton
android:id="@+id/action_play_pause"
style="@style/Widget.AppCompat.Button.Borderless"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="48dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
@ -138,9 +148,10 @@
android:src="@drawable/ic_play_arrow_white_36dp"
tools:ignore="ContentDescription" />
<ImageButton xmlns:android="http://schemas.android.com/apk/res/android"
<ImageButton
android:id="@+id/action_next"
style="@style/Widget.AppCompat.Button.Borderless"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="48dp"
android:layout_height="match_parent"
android:layout_marginLeft="2dp"
@ -154,3 +165,4 @@
tools:ignore="ContentDescription" />
</LinearLayout>
</RelativeLayout>
</FrameLayout>