Commit 549da896 authored by Alexandre Perraud's avatar Alexandre Perraud

UI : New material design widget

parent cc315257
......@@ -4,13 +4,11 @@
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="@dimen/widget_margin"
android:background="@drawable/background"
android:background="@color/grey50"
android:clickable="true"
android:clipChildren="true"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp" >
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
......@@ -21,8 +19,9 @@
<ImageView
android:id="@+id/cover"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_width="84dp"
android:layout_height="84dp"
android:background="@color/orange100"
android:src="@drawable/icon" />
<LinearLayout
......@@ -35,92 +34,97 @@
android:id="@+id/artist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_gravity="center|left"
android:layout_marginLeft="@dimen/default_margin"
android:ellipsize="end"
android:singleLine="true"
android:text=""
android:textColor="#888888"
android:textColor="@color/grey600"
android:textSize="14sp" />
<TextView
android:id="@+id/songName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_gravity="center|left"
android:layout_marginLeft="@dimen/default_margin"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/widget_name"
android:textColor="#ffffff"
android:textColor="@color/grey900"
android:textSize="16sp" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:weightSum="4"
android:orientation="horizontal" >
<ImageButton
android:id="@+id/backward"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginRight="13dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00ffffff"
android:clickable="true"
android:scaleType="fitXY"
android:src="@drawable/ic_previous_w" />
android:layout_gravity="left"
android:scaleType="centerInside"
android:layout_weight="1"
android:src="@drawable/ic_widget_previous" />
<ImageButton
android:id="@+id/play_pause"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00ffffff"
android:clickable="true"
android:scaleType="fitXY"
android:src="@drawable/ic_play_w" />
android:scaleType="centerInside"
android:layout_weight="1"
android:src="@drawable/ic_widget_play" />
<ImageButton
android:id="@+id/forward"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="13dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#00ffffff"
android:clickable="true"
android:scaleType="fitXY"
android:src="@drawable/ic_next_w" />
android:scaleType="centerInside"
android:layout_weight="1"
android:src="@drawable/ic_widget_next" />
<ImageButton
android:id="@+id/stop"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="26dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:background="#00ffffff"
android:layout_weight="1"
android:clickable="true"
android:scaleType="fitXY"
android:src="@drawable/ic_close_w" />
android:scaleType="centerInside"
android:src="@drawable/ic_widget_close" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/timeline_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="invisible" >
<LinearLayout
android:id="@+id/timeline_parent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="invisible">
<ProgressBar
android:id="@+id/timeline"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dip"
android:focusable="false"
android:indeterminate="false"
android:maxHeight="2dip"
android:minHeight="2dip"
android:paddingLeft="0px"
android:paddingRight="0px"
android:progressDrawable="@drawable/po_seekbar"
android:splitTrack="false" />
<ProgressBar
android:id="@+id/timeline"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="2dip"
android:focusable="false"
android:indeterminate="false"
android:maxHeight="2dip"
android:minHeight="2dip"
android:paddingLeft="0px"
android:paddingRight="0px"
android:progressDrawable="@drawable/po_seekbar"
android:splitTrack="false" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
......@@ -45,6 +45,7 @@
<attr name="ic_pause" format="reference" />
<attr name="ic_previous" format="reference" />
<attr name="ic_next" format="reference" />
<attr name="ic_close" format="reference" />
<attr name="ic_menu_video" format="reference" />
<attr name="ic_menu_audio" format="reference" />
<attr name="ic_menu_folder" format="reference" />
......
......@@ -54,6 +54,7 @@
<item name="ic_pause">@drawable/ic_pause</item>
<item name="ic_previous">@drawable/ic_previous</item>
<item name="ic_next">@drawable/ic_next</item>
<item name="ic_close">@drawable/ic_close</item>
<item name="ic_save">@drawable/ic_save</item>
<item name="ic_menu_video">@drawable/ic_menu_video</item>
<item name="ic_menu_audio">@drawable/ic_menu_audio</item>
......@@ -130,6 +131,7 @@
<item name="ic_pause">@drawable/ic_pause_w</item>
<item name="ic_previous">@drawable/ic_previous_w</item>
<item name="ic_next">@drawable/ic_next_w</item>
<item name="ic_close">@drawable/ic_close_w</item>
<item name="ic_save">@drawable/ic_save_w</item>
<item name="ic_menu_video">@drawable/ic_menu_video_w</item>
<item name="ic_menu_audio">@drawable/ic_menu_audio_w</item>
......
......@@ -111,7 +111,7 @@ public class VLCAppWidgetProvider extends AppWidgetProvider {
views.setTextViewText(R.id.songName, title);
views.setTextViewText(R.id.artist, artist);
views.setImageViewResource(R.id.play_pause, isplaying ? R.drawable.ic_pause_w : R.drawable.ic_play_w);
views.setImageViewResource(R.id.play_pause, isplaying ? R.drawable.ic_widget_pause : R.drawable.ic_widget_play);
views.setViewVisibility(R.id.timeline_parent, artist != null && artist.length() > 0 ? View.VISIBLE : View.INVISIBLE);
}
else if (ACTION_WIDGET_UPDATE_COVER.equals(action)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment