diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-02-26 21:00:38 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-02-26 21:00:38 +0000 |
commit | f1e3f5e6c4fd511153937766c9c8034957df4f65 (patch) | |
tree | 949f4e0d1278f4c6cbdb9afbb6cc0c4063eb2baa /android | |
parent | 194acc68a8111b4a93df6be245dc8f0fdb729ef0 (diff) | |
download | rockbox-f1e3f5e6c4fd511153937766c9c8034957df4f65.tar.gz rockbox-f1e3f5e6c4fd511153937766c9c8034957df4f65.zip |
Android: Add a 3x3 sized widget.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29409 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'android')
-rw-r--r-- | android/AndroidManifest.xml | 11 | ||||
-rw-r--r-- | android/res/layout/appwidget_3x3.xml | 42 | ||||
-rw-r--r-- | android/res/values/strings.xml | 1 | ||||
-rw-r--r-- | android/res/xml/appwidget_provider_3x3.xml | 8 | ||||
-rw-r--r-- | android/src/org/rockbox/widgets/RockboxWidgetProvider3x3.java | 27 |
5 files changed, 89 insertions, 0 deletions
diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 41a662fdfa..d8264da142 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml | |||
@@ -54,6 +54,17 @@ | |||
54 | android:resource="@xml/appwidget_provider_2x2" /> | 54 | android:resource="@xml/appwidget_provider_2x2" /> |
55 | </receiver> | 55 | </receiver> |
56 | 56 | ||
57 | <receiver android:name=".widgets.RockboxWidgetProvider3x3" | ||
58 | android:label="@string/appwidget_label_3x3"> | ||
59 | <intent-filter> | ||
60 | <action android:name="android.appwidget.action.APPWIDGET_UPDATE" /> | ||
61 | <action android:name="org.rockbox.TrackUpdateInfo" /> | ||
62 | <action android:name="org.rockbox.TrackFinish" /> | ||
63 | <action android:name="org.rockbox.UpdateState" /> | ||
64 | </intent-filter> | ||
65 | <meta-data android:name="android.appwidget.provider" | ||
66 | android:resource="@xml/appwidget_provider_3x3" /> | ||
67 | </receiver> | ||
57 | <!-- Widget configuration --> | 68 | <!-- Widget configuration --> |
58 | <activity android:name=".widgets.RockboxWidgetConfigure"> | 69 | <activity android:name=".widgets.RockboxWidgetConfigure"> |
59 | <intent-filter> | 70 | <intent-filter> |
diff --git a/android/res/layout/appwidget_3x3.xml b/android/res/layout/appwidget_3x3.xml new file mode 100644 index 0000000000..a29f416b3d --- /dev/null +++ b/android/res/layout/appwidget_3x3.xml | |||
@@ -0,0 +1,42 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | |||
3 | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
4 | android:layout_width="fill_parent" | ||
5 | android:layout_height="fill_parent" | ||
6 | android:orientation="vertical" | ||
7 | android:gravity="center" | ||
8 | android:background="@drawable/appwidget_background"> | ||
9 | <!-- style="@style/appwidget_background"--> | ||
10 | |||
11 | <ImageView android:id="@+id/logo" | ||
12 | android:layout_width="fill_parent" | ||
13 | android:layout_height="40dp" | ||
14 | android:scaleType="centerInside" | ||
15 | android:src="@drawable/rockbox" /> | ||
16 | <Button android:id="@+id/infoDisplay" | ||
17 | style="@style/appwidget_infodisplay" | ||
18 | android:layout_width="fill_parent" | ||
19 | android:text="@string/appwidget_infoDisplay" /> | ||
20 | <LinearLayout android:layout_width="fill_parent" | ||
21 | android:layout_height="wrap_content" | ||
22 | android:layout_weight="0" | ||
23 | android:gravity="center" | ||
24 | android:orientation="horizontal"> | ||
25 | <ImageButton android:id="@+id/prev" | ||
26 | style="@style/appwidget_button" | ||
27 | android:layout_weight="1" | ||
28 | android:src="@drawable/appwidget_prev" /> | ||
29 | <ImageButton android:id="@+id/stop" | ||
30 | style="@style/appwidget_button" | ||
31 | android:layout_weight="1" | ||
32 | android:src="@drawable/appwidget_stop" /> | ||
33 | <ImageButton android:id="@+id/playPause" | ||
34 | style="@style/appwidget_button" | ||
35 | android:layout_weight="1" | ||
36 | android:src="@drawable/appwidget_play" /> | ||
37 | <ImageButton android:id="@+id/next" | ||
38 | style="@style/appwidget_button" | ||
39 | android:layout_weight="1" | ||
40 | android:src="@drawable/appwidget_next" /> | ||
41 | </LinearLayout> | ||
42 | </LinearLayout> | ||
diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml index 5ff2a6dc20..9e818319d4 100644 --- a/android/res/values/strings.xml +++ b/android/res/values/strings.xml | |||
@@ -14,6 +14,7 @@ | |||
14 | <!-- Widget --> | 14 | <!-- Widget --> |
15 | <string name="appwidget_label_4x1">Rockbox (line)</string> | 15 | <string name="appwidget_label_4x1">Rockbox (line)</string> |
16 | <string name="appwidget_label_2x2">Rockbox (square)</string> | 16 | <string name="appwidget_label_2x2">Rockbox (square)</string> |
17 | <string name="appwidget_label_3x3">Rockbox (big square)</string> | ||
17 | <string name="appwidget_infoDisplay">Touch to launch app</string> | 18 | <string name="appwidget_infoDisplay">Touch to launch app</string> |
18 | 19 | ||
19 | <!-- Widget configuration --> | 20 | <!-- Widget configuration --> |
diff --git a/android/res/xml/appwidget_provider_3x3.xml b/android/res/xml/appwidget_provider_3x3.xml new file mode 100644 index 0000000000..50ad42930f --- /dev/null +++ b/android/res/xml/appwidget_provider_3x3.xml | |||
@@ -0,0 +1,8 @@ | |||
1 | <!-- cell size is (number of cells * 74) - 2 dp according to http://developer.android.com/guide/topics/appwidgets/index.html#MetaData --> | ||
2 | <appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | android:minWidth="220dp" | ||
4 | android:minHeight="220dp" | ||
5 | android:updatePeriodMillis="86400000" | ||
6 | android:initialLayout="@layout/appwidget_3x3" | ||
7 | android:configure="org.rockbox.widgets.RockboxWidgetConfigure"> | ||
8 | </appwidget-provider> | ||
diff --git a/android/src/org/rockbox/widgets/RockboxWidgetProvider3x3.java b/android/src/org/rockbox/widgets/RockboxWidgetProvider3x3.java new file mode 100644 index 0000000000..1dc8f40150 --- /dev/null +++ b/android/src/org/rockbox/widgets/RockboxWidgetProvider3x3.java | |||
@@ -0,0 +1,27 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2011 Antoine Cellerier <dionoea at videolan dot org> | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | package org.rockbox.widgets; | ||
23 | |||
24 | public class RockboxWidgetProvider3x3 extends RockboxWidgetProvider | ||
25 | { | ||
26 | |||
27 | } | ||