220 Commits

Author SHA1 Message Date
Christopher Eby
a3ded6499c Retrieve a random song by selecting a random row from a query of all songs
This means we don't have to keep a long array of song ids around. Speed change is not significant
2010-04-03 10:13:14 -05:00
Christopher Eby
81fa1dd75f Make double tap song selector dismissal activate for any action 2010-04-02 11:16:01 -05:00
Christopher Eby
ededdcf716 Load preferences in onStart in song selector
So the app doesn't need to be restarted to reload these preferences
2010-04-02 11:12:20 -05:00
Christopher Eby
7791663e29 Load dialog code in onCreate
Historical cruft allowed this to creep into the constructor
2010-04-02 11:10:55 -05:00
Christopher Eby
6c58ca2d82 Convert default action preference to use integer strings
Might as well break some more preferences while we're at it
2010-04-02 11:00:09 -05:00
Christopher Eby
b275d5a1b9 Remove debug output 2010-04-02 10:51:46 -05:00
Christopher Eby
efef58276e Allow the notification to never be shown 2010-04-02 10:51:23 -05:00
Christopher Eby
2116ca6fa6 Remove oldState in the changed broadcast
It is not really all that useful
2010-03-28 21:45:17 -05:00
Christopher Eby
e11c0fec25 Move song randomization into Song 2010-03-28 18:37:20 -05:00
Christopher Eby
dc2d1ddbcc Simplify state loading code 2010-03-28 18:14:17 -05:00
Christopher Eby
6a32d69816 Keep Random instance in ContextApplication 2010-03-28 18:07:01 -05:00
Christopher Eby
9183f01fc9 Lazy load mActivities in ContextApplication 2010-03-28 18:04:00 -05:00
Christopher Eby
001215190e Return updateState to old behavior 2010-03-26 22:05:00 -05:00
Christopher Eby
210e2c5513 Change event_loaded to replace_song 2010-03-26 21:57:20 -05:00
Christopher Eby
5528749b59 setCurrentSong on startup
Uhhh where did it go?
2010-03-26 21:47:34 -05:00
Christopher Eby
a76ac9e7c1 Handle the context menu in song selector properly 2010-03-26 21:19:11 -05:00
Christopher Eby
df27c4323a Open the playback activity any time the last played item is pressed
Not just within half a second
2010-03-25 22:47:33 -05:00
Christopher Eby
8b9f851fae Flip around the choose songs check 2010-03-25 22:04:24 -05:00
Christopher Eby
8d738567f1 Handle null intents in onStart 2010-03-25 21:57:34 -05:00
Christopher Eby
b5480992b9 Change togglePlayback to toggleFlag 2010-03-21 22:33:12 -05:00
Christopher Eby
c3f955155f Make the service state a set of flags
I like flags
2010-03-21 22:29:26 -05:00
Christopher Eby
456f3d2504 Double tap inside song selector dismisses it
This doesn't work as well as I would like due to the way Android handles
focusing clicks.. but it's something
2010-03-21 21:40:39 -05:00
Christopher Eby
11b62deb6a Fix the SongSelector background on Android 1.5
Android 1.5 takes a black background to be translucent for some reason
2010-03-21 21:31:17 -05:00
Christopher Eby
aac448f5f7 Add icons to the menu, change the order and rename "media library" to "choose songs" 2010-03-21 21:13:57 -05:00
Christopher Eby
e150b9210c Only display the icon as the cover in the widget when loading from state 2010-03-21 17:45:38 -05:00
Christopher Eby
696e65a18a Cancel the notification through updateState on service destruction
The avoids a flicker to the paused notification if destroyed while playing
2010-03-21 17:43:32 -05:00
Christopher Eby
1d629c7fa2 Update the notification properly when the song changes
Clearly I don't look at the notification very often :)
2010-03-21 17:41:45 -05:00
Christopher Eby
f19927e97e Increase the double-tap time for the widget
This really just needs to be a long press... but I don't think there is any way
to accomplish this inside a RemoteView
2010-03-21 17:31:49 -05:00
Christopher Eby
0542c93faf Don't clear covers on stop 2010-03-21 17:21:29 -05:00
Christopher Eby
c5bf6837c0 Move common setService code into PlaybackActivity
This removes the condition where the mini activity finishes when the service is
set to null. I'm not aware of any time this actually occurs, anyway...
2010-03-21 17:19:03 -05:00
Christopher Eby
e6412a9001 Simplify the way the message overlay works
Take advantage of addContentView and just leave the view around when done with
it; it's not too heavy
2010-03-21 17:10:10 -05:00
Christopher Eby
9e1aff4645 Fix some crashers that show up with no media
Because I never seem to test this code path :)
2010-03-21 17:08:44 -05:00
Christopher Eby
8b9e7a63b7 Rename the main activities to be more consitent
NowPlayingActivity -> FullPlaybackActivity
RemoteActivity -> MiniPlaybackActivity

Also renamed referenced layouts and move the MiniPlaybackActivity layout inside
the main activity file
2010-03-21 16:43:52 -05:00
Christopher Eby
4a24644485 Defer some service startup code
The main advantage to this is the notification will now be executed after any
pending go messages are sent; there won't be a sudden change in the notification
when a play message is sent on startup
2010-03-21 16:29:02 -05:00
Christopher Eby
d936e35483 Don't worry about unsetting the service in unbindService
This isn't necessary now that this only occurs when the activity finishes
2010-03-21 16:26:30 -05:00
Christopher Eby
ff91e51451 Just look for the handler on startup instead of a custom variable
We depend on mHandler to begin with, so the variable could cause trouble
2010-03-21 16:23:52 -05:00
Christopher Eby
a091aabc31 Move quit to ContextApplication 2010-03-21 16:15:00 -05:00
Christopher Eby
41e63e331f Make SongSelector a dialog
This prevents the NowPlayingActivity from being stopped, so the covers will
update in the background when a song is selected in the song selector.
2010-03-21 16:12:17 -05:00
Christopher Eby
adfbe7f78e Set state to paused on service destruction 2010-03-20 19:33:38 -05:00
Christopher Eby
09070cd065 Allow the widget to start the playback service 2010-03-20 19:33:13 -05:00
Christopher Eby
bae99ac33f Update the notification on initial load 2010-03-20 19:06:21 -05:00
Christopher Eby
d1aa74df89 Remove SongData.Field 2010-03-20 18:47:53 -05:00
Christopher Eby
6878e6e37a Don't hide MediaViews when we are not going to reshow them 2010-03-20 17:52:44 -05:00
Christopher Eby
2dcb8eb0e4 Add an expand menu action 2010-03-20 17:21:52 -05:00
Christopher Eby
5fda18dc67 Remove unneeded use of SongData.Field 2010-03-20 16:55:14 -05:00
Christopher Eby
cb013cc51e Integrate MediaView into MediaAdapter 2010-03-20 16:50:06 -05:00
Christopher Eby
9b7254cd5c Replace the stop service function with an exit function 2010-03-20 16:14:15 -05:00
Christopher Eby
cc953001b8 Set a foreground image instead of background image in the widget
This has proper scaling and can be set in RemoteViews. Curiously, it requires
that the transparent placeholder be the same size as the icon---the image size
doesn't seem to be updated when the drawable state changes
2010-03-20 15:24:16 -05:00
Christopher Eby
5fde2d3b82 Enable seeking while paused
I am not too sure why I had this disabled to begin with
2010-03-20 00:30:26 -05:00
Christopher Eby
7f3dd9544d Make updateState thread-safe 2010-03-19 23:54:06 -05:00