Fixed Widget and Notification crashes and added a better notification layout for Android 12
This commit is contained in:
parent
8e64f117f9
commit
574b990984
14 changed files with 254 additions and 27 deletions
104
app/src/main/res/layout-v31/layout_notification_expanded.xml
Normal file
104
app/src/main/res/layout-v31/layout_notification_expanded.xml
Normal file
|
@ -0,0 +1,104 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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="wrap_content"
|
||||
tools:background="@color/md_red_500">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/content"
|
||||
android:layout_alignParentEnd="true">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/largeIcon"
|
||||
android:layout_width="@dimen/notification_big_image_size"
|
||||
android:layout_height="@dimen/notification_big_image_size"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:scaleType="centerCrop"
|
||||
tools:src="@tools:sample/avatars" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="0dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingEnd="144dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/Theme.RetroMusic.Notification"
|
||||
android:textStyle="bold"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subtitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:lines="1"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="0dp"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/Theme.RetroMusic.Notification.Title"
|
||||
tools:text="@tools:sample/lorem/random" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="0dp">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/action_prev"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="@drawable/notification_selector"
|
||||
android:scaleType="centerInside"
|
||||
tools:src="@drawable/ic_skip_previous_round_white_32dp"
|
||||
tools:tint="?colorOnPrimary" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/action_play_pause"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="@drawable/notification_selector"
|
||||
android:scaleType="centerInside"
|
||||
tools:src="@drawable/ic_pause_white_48dp"
|
||||
tools:tint="?colorOnPrimary" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/action_next"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="@drawable/notification_selector"
|
||||
android:scaleType="centerInside"
|
||||
tools:src="@drawable/ic_skip_next_round_white_32dp"
|
||||
tools:tint="?colorOnPrimary" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/action_quit"
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:background="@drawable/notification_selector"
|
||||
android:scaleType="centerInside"
|
||||
tools:src="@drawable/ic_close"
|
||||
tools:tint="?colorOnPrimary" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
Loading…
Add table
Add a link
Reference in a new issue