Completely rewrote the widget. Some method name refactoring.

This commit is contained in:
Karim Abou Zeid 2016-04-03 23:50:45 +02:00
commit 119f4e1f1c
10 changed files with 318 additions and 242 deletions

View file

@ -2,14 +2,15 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="96dp"
android:layout_height="@dimen/app_widget_small_image_size"
android:background="#AAFFFFFF"
android:orientation="horizontal"
tools:ignore="ContentDescription">
<ImageView
android:id="@+id/image"
android:layout_width="@dimen/widget_medium_image_size"
android:layout_height="@dimen/widget_medium_image_size"
android:layout_width="@dimen/app_widget_small_image_size"
android:layout_height="@dimen/app_widget_small_image_size"
android:background="@drawable/default_album_art"
android:scaleType="centerCrop" />
@ -18,6 +19,7 @@
android:layout_height="match_parent">
<LinearLayout
android:layout_margin="8dp"
android:id="@+id/media_actions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -30,21 +32,27 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/notification_selector" />
android:background="@drawable/notification_selector"
tools:src="@drawable/ic_skip_previous_white_24dp"
tools:tint="#000" />
<ImageButton
android:id="@+id/button_toggle_play_pause"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/notification_selector" />
android:background="@drawable/notification_selector"
tools:src="@drawable/ic_play_arrow_white_24dp"
tools:tint="#000" />
<ImageButton
android:id="@+id/button_next"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/notification_selector" />
android:background="@drawable/notification_selector"
tools:src="@drawable/ic_skip_next_white_24dp"
tools:tint="#000" />
</LinearLayout>
@ -65,17 +73,19 @@
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_light"
tools:text="Title" />
<TextView
android:id="@+id/song_secondary_information"
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center_vertical"
android:singleLine="true"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:textColor="@color/ate_primary_text_light" />
android:textColor="@color/ate_primary_text_light"
tools:text="Text" />
</LinearLayout>

View file

@ -33,7 +33,6 @@ http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
<dimen name="seek_bar_margin_left_right">-17dp</dimen>
<dimen name="list_padding_vertical">2dp</dimen>
<dimen name="widget_medium_image_size">96dp</dimen>
<dimen name="notification_big_image_size">128dp</dimen>
<dimen name="scrollbar_width">8dp</dimen>
@ -59,4 +58,9 @@ http://developer.android.com/guide/topics/appwidgets/index.html#CreatingLayout
<dimen name="mini_player_height">56dp</dimen>
<!--App Widgets-->
<dimen name="app_widget_small_image_size">96dp</dimen>
<dimen name="app_widget_small_min_width">250dp</dimen>
<dimen name="app_widget_small_min_height">40dp</dimen>
</resources>

View file

@ -245,4 +245,5 @@
<string name="could_not_scan_files">Could not scan %d files.</string>
<string name="listing_files">Listing files</string>
<string name="new_start_directory">%s is the new start directory.</string>
<string name="app_widget_small_name">small</string>
</resources>

View 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_small"-->

View file

@ -1,10 +0,0 @@
<?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/widget_medium"
android:minHeight="40dp"
android:minWidth="250dp"
android:resizeMode="horizontal"
android:updatePeriodMillis="0"
android:widgetCategory="home_screen|keyguard"
tools:ignore="UnusedAttribute" />