This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#11902 - Android Widget
Attached to Project:
Rockbox
Opened by Antoine Cellerier (dionoea) - Sunday, 23 January 2011, 00:26 GMT+2
Last edited by Antoine Cellerier (dionoea) - Saturday, 29 January 2011, 21:48 GMT+2
Opened by Antoine Cellerier (dionoea) - Sunday, 23 January 2011, 00:26 GMT+2
Last edited by Antoine Cellerier (dionoea) - Saturday, 29 January 2011, 21:48 GMT+2
|
DetailsThe attached patch adds a Rockbox control widget for the android application.
It displays the title, artist and album when a track plays and features a play/pause button and a next track button. Clicking on the text label launches the Rockbox application. Icons from the cabbiev2 theme are used. The widget-*.png files are screenshots corresponding to the current code. |
This task depends upon
Closed by Antoine Cellerier (dionoea)
Saturday, 29 January 2011, 21:48 GMT+2
Reason for closing: Accepted
Additional comments about closing: Now in svn.
Saturday, 29 January 2011, 21:48 GMT+2
Reason for closing: Accepted
Additional comments about closing: Now in svn.
- The buttons do not work unless the application is already running. I see two solutions to this problem: send the key intents to the activity instead and make it launch without taking focus, or keep the current code which sends the intents to the service and properly start it (I do not know what changes to the code this would imply).
- The PLAYBACK_EVENT_TRACK_FINISH event occurs a bit too soon which leads to the current track info being cleared before the track actually ends (something like 2 or 3 seconds early). According to amiconn this is a know issue with that event.
An alternate widget layout is used in the attached screenshot. A 2x2 grid seems to have a bit more usable space than the 4x1 one.
Can you please seperate out changes that simply rename variables and other unrelated ones? It makes the patch harder to read.
I don't think the widget necessarily needs to themable. While it would be nice it shouldn't be a requirement IMO. I also think it shouldn't act as a remote display. I can't see a practical reason for it, but it would make homescreen look ugly.
with some limits on the touch ares (no popups) we could populate the widget with invisible buttons using the skin engine, that way we could allow the user to load up their homescreen with any number of any shaped widgets they want!
I think allowing a single remote LCD widget would also be nice (and this doesnt have to be a one-or-the-other thing)
actually tihnking about it for more than a second, drawing into that "screen" could cause some interesting problems in the rockbox code.
Edit: about allowed widget sizes, http://developer.android.com/guide/practices/ui_guidelines/widget_design.html#sizes seems to imply that you can only have 4x1, 2x2 and 3x3 sized widgets, which is a bit weird since I've been able to create a 4x4 one too. This doesn't seem to be a hard restriction but we might want to stick to one of these 3 sizes.
I'd really like to eventually see a UI to choose the size and what is displayed (with that leading to eventually skinning capabilities :) ) but this is a great first go
Edit: Nevermind: "This Activity will be automatically launched by the App Widget host and allows the user to configure available settings for the App Widget at create-time, such as the App Widget color, size, update period or other functionality settings."
It looks like runtime changeable, however it could just reinit the widget under the hood. (this is from an user POV)
(Tested on SGS Android 2.2.1)
Edit: A third issue is that track info is only available after the first track change which follows widget creation. So if Rockbox was already playing music when you decided to create a widget it won't display that track's info. That could be fixed fairly easily by sending an intent from the widget upon creation to request updated info if any.
Edit 2: Add git patch.
jpoppe@astray98:~/Android/rockbox/android$ make apk
AAPT bin/resources.ap_
/home/jpoppe/Android/rockbox/android/res/layout/appwidget_2x2.xml:11: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/rockbox').
/home/jpoppe/Android/rockbox/android/res/layout/appwidget_configure.xml:8: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/rockbox').
/home/jpoppe/Android/rockbox/android/res/drawable/appwidget_background.xml:4: error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/appwidget_background_normal').
/home/jpoppe/Android/rockbox/android/res/drawable/appwidget_infodisplay_background.xml:4: error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/appwidget_selection_clicked').
/home/jpoppe/Android/rockbox/android/res/drawable/appwidget_infodisplay_background.xml:5: error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/appwidget_selection_over').
/home/jpoppe/Android/rockbox/android/res/drawable/appwidget_infodisplay_background.xml:6: error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/appwidget_selection_transparent').
/home/jpoppe/Android/rockbox/android/res/drawable/appwidget_next.xml:4: error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/appwidget_ff_normal').
/home/jpoppe/Android/rockbox/android/res/drawable/appwidget_pause.xml:4: error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/appwidget_pause_normal').
/home/jpoppe/Android/rockbox/android/res/drawable/appwidget_play.xml:4: error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/appwidget_play_normal').
/home/jpoppe/Android/rockbox/android/res/drawable/appwidget_prev.xml:4: error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/appwidget_rew_normal').
/home/jpoppe/Android/rockbox/android/res/drawable/appwidget_stop.xml:4: error: Error: No resource found that matches the given name (at 'drawable' with value '@drawable/appwidget_stop_normal').
make: *** [/home/jpoppe/Android/rockbox/android/bin/resources.ap_] Error 1
jpoppe@astray98:~/Android/rockbox/android$
jpoppe@astray98:~/Android/rockbox/android$ svn up
At revision 29161.
poppe@astray98:~/Android/rockbox/android$ cat rockbox-info.txt
Target: application
Target id: 100
Target define: -DAPPLICATION
Memory: 8
CPU: hosted
Manufacturer: android
Version: r29159M-110129
Binary: librockbox.so
Binary size: 848267
Actual size:
RAM usage: 0
Features: crossfade:lcd_bitmap:lcd_non-mono:lcd_color:pitchscreen:quickscreen:swcodec:tagcache:touchscreen:large_plugin_buffer:ab_repeat_buttons:albumart
gcc: arm-linux-androideabi-gcc (GCC) 4.4.3
ld: GNU ar (GNU Binutils) 2.19
Host gcc: gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
Host system: Linux
jpoppe@astray98:~/Android/rockbox/android$
Adding a 3x3 widget simple.
I can add a 3x3 widget if you want (although if you were to ask me I'd say that 3x3 widgets kind of defeat the purpose since they don't leave much space for other elements on the screen ... except maybe on tablets. that's unless you add album art in which case it might make sense).
Albumart could fit well in this 3x3 one. I don't feel I waste space, my home screens aren't full of app icons :)
Let me know if you feel that this can be commited to svn or if some changes are required.
I wonder if it makes sense to make it a separate app? Widgets cannot really be moved to the sdcard.