Android: Add a 3x3 sized widget.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29409 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
194acc68a8
commit
f1e3f5e6c4
5 changed files with 89 additions and 0 deletions
|
@ -54,6 +54,17 @@
|
||||||
android:resource="@xml/appwidget_provider_2x2" />
|
android:resource="@xml/appwidget_provider_2x2" />
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
|
<receiver android:name=".widgets.RockboxWidgetProvider3x3"
|
||||||
|
android:label="@string/appwidget_label_3x3">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||||
|
<action android:name="org.rockbox.TrackUpdateInfo" />
|
||||||
|
<action android:name="org.rockbox.TrackFinish" />
|
||||||
|
<action android:name="org.rockbox.UpdateState" />
|
||||||
|
</intent-filter>
|
||||||
|
<meta-data android:name="android.appwidget.provider"
|
||||||
|
android:resource="@xml/appwidget_provider_3x3" />
|
||||||
|
</receiver>
|
||||||
<!-- Widget configuration -->
|
<!-- Widget configuration -->
|
||||||
<activity android:name=".widgets.RockboxWidgetConfigure">
|
<activity android:name=".widgets.RockboxWidgetConfigure">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
42
android/res/layout/appwidget_3x3.xml
Normal file
42
android/res/layout/appwidget_3x3.xml
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/appwidget_background">
|
||||||
|
<!-- style="@style/appwidget_background"-->
|
||||||
|
|
||||||
|
<ImageView android:id="@+id/logo"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:src="@drawable/rockbox" />
|
||||||
|
<Button android:id="@+id/infoDisplay"
|
||||||
|
style="@style/appwidget_infodisplay"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:text="@string/appwidget_infoDisplay" />
|
||||||
|
<LinearLayout android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<ImageButton android:id="@+id/prev"
|
||||||
|
style="@style/appwidget_button"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:src="@drawable/appwidget_prev" />
|
||||||
|
<ImageButton android:id="@+id/stop"
|
||||||
|
style="@style/appwidget_button"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:src="@drawable/appwidget_stop" />
|
||||||
|
<ImageButton android:id="@+id/playPause"
|
||||||
|
style="@style/appwidget_button"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:src="@drawable/appwidget_play" />
|
||||||
|
<ImageButton android:id="@+id/next"
|
||||||
|
style="@style/appwidget_button"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:src="@drawable/appwidget_next" />
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
|
@ -14,6 +14,7 @@
|
||||||
<!-- Widget -->
|
<!-- Widget -->
|
||||||
<string name="appwidget_label_4x1">Rockbox (line)</string>
|
<string name="appwidget_label_4x1">Rockbox (line)</string>
|
||||||
<string name="appwidget_label_2x2">Rockbox (square)</string>
|
<string name="appwidget_label_2x2">Rockbox (square)</string>
|
||||||
|
<string name="appwidget_label_3x3">Rockbox (big square)</string>
|
||||||
<string name="appwidget_infoDisplay">Touch to launch app</string>
|
<string name="appwidget_infoDisplay">Touch to launch app</string>
|
||||||
|
|
||||||
<!-- Widget configuration -->
|
<!-- Widget configuration -->
|
||||||
|
|
8
android/res/xml/appwidget_provider_3x3.xml
Normal file
8
android/res/xml/appwidget_provider_3x3.xml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
<!-- cell size is (number of cells * 74) - 2 dp according to http://developer.android.com/guide/topics/appwidgets/index.html#MetaData -->
|
||||||
|
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:minWidth="220dp"
|
||||||
|
android:minHeight="220dp"
|
||||||
|
android:updatePeriodMillis="86400000"
|
||||||
|
android:initialLayout="@layout/appwidget_3x3"
|
||||||
|
android:configure="org.rockbox.widgets.RockboxWidgetConfigure">
|
||||||
|
</appwidget-provider>
|
|
@ -0,0 +1,27 @@
|
||||||
|
/***************************************************************************
|
||||||
|
* __________ __ ___.
|
||||||
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
|
* \/ \/ \/ \/ \/
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* Copyright (C) 2011 Antoine Cellerier <dionoea at videolan dot org>
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2
|
||||||
|
* of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
|
* KIND, either express or implied.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
package org.rockbox.widgets;
|
||||||
|
|
||||||
|
public class RockboxWidgetProvider3x3 extends RockboxWidgetProvider
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue