Added a small widget.
This commit is contained in:
parent
e9ee47fbcc
commit
ff41a67448
9 changed files with 367 additions and 12 deletions
|
|
@ -3,7 +3,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/app_widget_classic_height"
|
||||
android:background="#AAFFFFFF"
|
||||
android:background="#AA000000"
|
||||
android:orientation="horizontal"
|
||||
tools:ignore="ContentDescription">
|
||||
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
android:layout_weight="1"
|
||||
android:background="@drawable/notification_selector"
|
||||
tools:src="@drawable/ic_skip_previous_white_24dp"
|
||||
tools:tint="#000" />
|
||||
tools:tint="#fff" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_toggle_play_pause"
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
android:layout_weight="1"
|
||||
android:background="@drawable/notification_selector"
|
||||
tools:src="@drawable/ic_play_arrow_white_24dp"
|
||||
tools:tint="#000" />
|
||||
tools:tint="#fff" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_next"
|
||||
|
|
@ -52,7 +52,7 @@
|
|||
android:layout_weight="1"
|
||||
android:background="@drawable/notification_selector"
|
||||
tools:src="@drawable/ic_skip_next_white_24dp"
|
||||
tools:tint="#000" />
|
||||
tools:tint="#fff" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
@ -73,7 +73,7 @@
|
|||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||
android:textColor="@color/ate_primary_text_light"
|
||||
android:textColor="@color/ate_primary_text_dark"
|
||||
tools:text="Title" />
|
||||
|
||||
<TextView
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
|
||||
android:textColor="@color/ate_primary_text_light"
|
||||
android:textColor="@color/ate_secondary_text_dark"
|
||||
tools:text="Text" />
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
|||
110
app/src/main/res/layout/app_widget_small.xml
Normal file
110
app/src/main/res/layout/app_widget_small.xml
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<GridLayout 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"
|
||||
android:background="#AA000000"
|
||||
android:columnCount="2"
|
||||
android:gravity="top"
|
||||
android:rowCount="3">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/image"
|
||||
android:layout_width="@dimen/app_widget_small_image_size"
|
||||
android:layout_height="@dimen/app_widget_small_image_size"
|
||||
android:scaleType="centerInside"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/media_actions"
|
||||
android:layout_gravity="fill_horizontal"
|
||||
android:focusable="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_prev"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/app_widget_small_button_height"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/notification_selector"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:src="@drawable/ic_skip_previous_white_24dp"
|
||||
tools:tint="#fff" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_toggle_play_pause"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/app_widget_small_button_height"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/notification_selector"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:src="@drawable/ic_play_arrow_white_24dp"
|
||||
tools:tint="#fff" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/button_next"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/app_widget_small_button_height"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/notification_selector"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:src="@drawable/ic_skip_next_white_24dp"
|
||||
tools:tint="#fff" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/separator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_columnSpan="2"
|
||||
android:layout_gravity="fill_horizontal"
|
||||
android:background="@color/md_divider_white"
|
||||
tools:ignore="Orientation" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/media_titles"
|
||||
android:layout_columnSpan="2"
|
||||
android:layout_gravity="fill"
|
||||
android:focusable="true"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
|
||||
android:textColor="@color/ate_primary_text_dark"
|
||||
tools:text="Title" />
|
||||
|
||||
<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:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||
android:textColor="@color/ate_secondary_text_dark"
|
||||
tools:ignore="HardcodedText"
|
||||
tools:text="•" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||
android:textColor="@color/ate_secondary_text_dark"
|
||||
tools:text="Text" />
|
||||
</LinearLayout>
|
||||
|
||||
</GridLayout>
|
||||
|
|
@ -64,4 +64,9 @@ http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
|
|||
<dimen name="app_widget_classic_min_width">250dp</dimen>
|
||||
<dimen name="app_widget_classic_min_height">40dp</dimen>
|
||||
|
||||
<dimen name="app_widget_small_button_height">48dp</dimen>
|
||||
<dimen name="app_widget_small_image_size">48dp</dimen>
|
||||
<dimen name="app_widget_small_min_width">250dp</dimen>
|
||||
<dimen name="app_widget_small_min_height">40dp</dimen>
|
||||
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -246,4 +246,5 @@
|
|||
<string name="listing_files">Listing files</string>
|
||||
<string name="new_start_directory">%s is the new start directory.</string>
|
||||
<string name="app_widget_classic_name">Phonograph - Classic</string>
|
||||
<string name="app_widget_small_name">Phonograph - Small</string>
|
||||
</resources>
|
||||
|
|
|
|||
12
app/src/main/res/xml/app_widget_small_info.xml
Normal file
12
app/src/main/res/xml/app_widget_small_info.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:initialLayout="@layout/app_widget_small"
|
||||
android:minHeight="@dimen/app_widget_small_min_height"
|
||||
android:minWidth="@dimen/app_widget_small_min_width"
|
||||
android:resizeMode="horizontal|vertical"
|
||||
android:updatePeriodMillis="0"
|
||||
android:widgetCategory="keyguard|home_screen"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
<!--android:previewImage="@drawable/app_widget_classic"-->
|
||||
Loading…
Add table
Add a link
Reference in a new issue