Commit 1d12757a authored by Sébastien Toque's avatar Sébastien Toque
Browse files

widget: rearrange elements to fit on a 4x1 block

parent cf3067bb
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_with_shadow"
android:orientation="vertical"
android:layout_margin="10dp"
android:layout_gravity="center" android:clipChildren="true" android:padding="10dp" android:gravity="center" android:clickable="true">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="50dip"
android:layout_height="50dp"
android:layout_marginRight="10dp"
android:background="@drawable/cone" />
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="10dp"
android:background="@drawable/bg_with_shadow"
android:clickable="true"
android:clipChildren="true"
android:gravity="center"
android:orientation="horizontal"
android:padding="0dp" >
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="14.50"
android:orientation="vertical" >
<ImageView
android:id="@+id/cover"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_margin="10dp"
android:src="@drawable/cone" />
<TextView
android:id="@+id/songName"
android:layout_width="269dp"
android:layout_height="wrap_content"
android:text="Song Name"
android:textSize="22sp" android:ellipsize="end"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<TextView
android:id="@+id/artist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Artist"
android:textSize="16sp" android:ellipsize="end" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/artist"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="10dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/artist"
android:textColor="#888888"
android:textSize="14dp" />
<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center" android:layout_marginTop="6dp">
<TextView
android:id="@+id/songName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginRight="10dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/title"
android:textColor="#ffffff"
android:textSize="16dp" />
<ImageButton
android:id="@+id/backward"
android:layout_width="50dip"
android:layout_height="50dip"
android:clickable="true"
android:scaleType="fitXY"
android:src="@drawable/ic_backward" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:gravity="center"
android:orientation="horizontal" >
<ImageButton
android:id="@+id/play_pause"
android:layout_width="50dip"
android:layout_height="50dip"
android:src="@drawable/ic_play"
android:clickable="true"
android:scaleType="fitXY" />
<ImageButton
android:id="@+id/backward"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="#00ffffff"
android:clickable="true"
android:scaleType="fitXY"
android:src="@drawable/ic_backward" />
<ImageButton
android:id="@+id/stop"
android:layout_width="50dip"
android:layout_height="50dip"
android:clickable="true"
android:scaleType="fitXY"
android:src="@drawable/ic_stop" />
<ImageButton
android:id="@+id/play_pause"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#00ffffff"
android:clickable="true"
android:scaleType="fitXY"
android:src="@drawable/ic_play" />
<ImageButton
android:id="@+id/forward"
android:layout_width="50dip"
android:layout_height="50dip"
android:src="@drawable/ic_forward"
android:clickable="true"
android:scaleType="fitXY" />
<ImageButton
android:id="@+id/stop"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="#00ffffff"
android:clickable="true"
android:scaleType="fitXY"
android:src="@drawable/ic_stop" />
</LinearLayout>
<ImageButton
android:id="@+id/forward"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="#00ffffff"
android:clickable="true"
android:scaleType="fitXY"
android:src="@drawable/ic_forward" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
</LinearLayout>
\ No newline at end of file
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="260dp"
android:minHeight="110dp"
android:minWidth="294dp"
android:minHeight="72dp"
android:updatePeriodMillis="86400000"
android:initialLayout="@layout/vlcwidget">
</appwidget-provider>
\ No newline at end of file
......@@ -537,9 +537,9 @@ public class AudioService extends Service {
}
if (cover != null)
views.setImageViewBitmap(R.id.imageView1, cover);
views.setImageViewBitmap(R.id.cover, cover);
else
views.setImageViewResource(R.id.imageView1, R.drawable.cone);
views.setImageViewResource(R.id.cover, R.drawable.cone);
views.setImageViewResource(R.id.play_pause, mLibVLC.isPlaying() ? R.drawable.ic_pause : R.drawable.ic_play);
......@@ -565,7 +565,7 @@ public class AudioService extends Service {
views.setOnClickPendingIntent(R.id.play_pause, piPlay);
views.setOnClickPendingIntent(R.id.stop, piStop);
views.setOnClickPendingIntent(R.id.forward, piForward);
views.setOnClickPendingIntent(R.id.imageView1, piVlc);
views.setOnClickPendingIntent(R.id.cover, piVlc);
/* update widget */
ComponentName widget = new ComponentName(context, VLCAppWidgetProvider.class);
......
Supports Markdown
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