Minor refactoring of widget code
This commit is contained in:
parent
0377e43475
commit
5d94555afe
8 changed files with 121 additions and 153 deletions
|
|
@ -1,84 +1,54 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/card">
|
||||
android:background="@drawable/card"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="@dimen/app_widget_card_image_size"
|
||||
android:layout_height="@dimen/app_widget_card_image_size"
|
||||
android:scaleType="centerInside"
|
||||
tools:src="@drawable/default_album_art"
|
||||
tools:ignore="ContentDescription"/>
|
||||
tools:ignore="ContentDescription"
|
||||
tools:src="@drawable/default_album_art" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/media_titles"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center">
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||
android:textColor="@color/ate_primary_text_light"
|
||||
android:singleLine="true"
|
||||
tools:text="Title"/>
|
||||
tools:text="Title" />
|
||||
|
||||
<LinearLayout
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/artist"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||
android:textColor="@color/ate_secondary_text_light"
|
||||
android:singleLine="true"
|
||||
tools:text="Artist"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_separator"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="4dp"
|
||||
android:paddingRight="4dp"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||
android:textColor="@color/ate_secondary_text_light"
|
||||
android:singleLine="true"
|
||||
tools:ignore="HardcodedText"
|
||||
tools:text="•"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/album"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||
android:textColor="@color/ate_secondary_text_light"
|
||||
android:singleLine="true"
|
||||
tools:text="Album"/>
|
||||
|
||||
</LinearLayout>
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
|
||||
android:textColor="@color/ate_secondary_text_light"
|
||||
tools:text="Text" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
@ -101,7 +71,7 @@
|
|||
android:background="@drawable/widget_selector_light"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:src="@drawable/ic_skip_previous_white_24dp"
|
||||
tools:tint="@color/ate_secondary_text_light"/>
|
||||
tools:tint="@color/ate_secondary_text_light" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_toggle_play_pause"
|
||||
|
|
@ -111,7 +81,7 @@
|
|||
android:background="@drawable/widget_selector_light"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:src="@drawable/ic_play_arrow_white_24dp"
|
||||
tools:tint="@color/ate_secondary_text_light"/>
|
||||
tools:tint="@color/ate_secondary_text_light" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_next"
|
||||
|
|
@ -121,7 +91,7 @@
|
|||
android:background="@drawable/widget_selector_light"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:src="@drawable/ic_skip_next_white_24dp"
|
||||
tools:tint="@color/ate_secondary_text_light"/>
|
||||
tools:tint="@color/ate_secondary_text_light" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
android:id="@+id/image"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:src="@drawable/default_album_art" />
|
||||
|
||||
|
|
@ -25,13 +25,13 @@
|
|||
android:id="@+id/media_actions"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layoutDirection="ltr"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true">
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layoutDirection="ltr"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_prev"
|
||||
|
|
@ -68,10 +68,10 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_above="@+id/media_actions"
|
||||
android:layout_alignParentTop="true"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp">
|
||||
android:layout_marginRight="8dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue