OSDN Git Service

android-2.1_r1 snapshot
authorThe Android Open Source Project <initial-contribution@android.com>
Tue, 12 Jan 2010 23:19:15 +0000 (15:19 -0800)
committerThe Android Open Source Project <initial-contribution@android.com>
Tue, 12 Jan 2010 23:19:15 +0000 (15:19 -0800)
62 files changed:
AndroidManifest.xml
res/color/tab_indicator_text.xml [new file with mode: 0644]
res/drawable-finger/buttonbarbackground.xml [new file with mode: 0644]
res/drawable-finger/ic_tab_albums.xml [new file with mode: 0644]
res/drawable-finger/ic_tab_artists.xml [new file with mode: 0644]
res/drawable-finger/ic_tab_playback.xml [new file with mode: 0644]
res/drawable-finger/ic_tab_playlists.xml [new file with mode: 0644]
res/drawable-finger/ic_tab_songs.xml [new file with mode: 0644]
res/drawable-hdpi-finger/buttonbar_active.9.png [new file with mode: 0644]
res/drawable-hdpi-finger/buttonbar_focused.9.png [new file with mode: 0644]
res/drawable-hdpi-finger/buttonbar_inactive.9.png [new file with mode: 0644]
res/drawable-hdpi-finger/buttonbar_pressed.9.png [new file with mode: 0644]
res/drawable-hdpi-finger/ic_mp_move.png
res/drawable-hdpi-finger/music_bottom_playback_bg.9.png [new file with mode: 0644]
res/drawable-hdpi/ic_tab_albums_selected.png [new file with mode: 0644]
res/drawable-hdpi/ic_tab_albums_unselected.png [new file with mode: 0644]
res/drawable-hdpi/ic_tab_artists_selected.png [new file with mode: 0644]
res/drawable-hdpi/ic_tab_artists_unselected.png [new file with mode: 0644]
res/drawable-hdpi/ic_tab_playback_selected.png [new file with mode: 0644]
res/drawable-hdpi/ic_tab_playback_unselected.png [new file with mode: 0644]
res/drawable-hdpi/ic_tab_playlists_selected.png [new file with mode: 0644]
res/drawable-hdpi/ic_tab_playlists_unselected.png [new file with mode: 0644]
res/drawable-hdpi/ic_tab_songs_selected.png [new file with mode: 0644]
res/drawable-hdpi/ic_tab_songs_unselected.png [new file with mode: 0644]
res/drawable-mdpi-finger/music_bottom_playback_bg.png [new file with mode: 0644]
res/drawable-mdpi/ic_tab_albums_selected.png [new file with mode: 0644]
res/drawable-mdpi/ic_tab_albums_unselected.png [new file with mode: 0644]
res/drawable-mdpi/ic_tab_artists_selected.png [new file with mode: 0644]
res/drawable-mdpi/ic_tab_artists_unselected.png [new file with mode: 0644]
res/drawable-mdpi/ic_tab_playback_selected.png [new file with mode: 0644]
res/drawable-mdpi/ic_tab_playback_unselected.png [new file with mode: 0644]
res/drawable-mdpi/ic_tab_playlists_selected.png [new file with mode: 0644]
res/drawable-mdpi/ic_tab_playlists_unselected.png [new file with mode: 0644]
res/drawable-mdpi/ic_tab_songs_selected.png [new file with mode: 0644]
res/drawable-mdpi/ic_tab_songs_unselected.png [new file with mode: 0644]
res/layout-finger/buttonbar.xml [new file with mode: 0644]
res/layout-finger/media_picker_activity.xml [new file with mode: 0644]
res/layout-finger/media_picker_activity_expanding.xml [new file with mode: 0644]
res/layout-finger/nowplaying.xml [new file with mode: 0644]
res/layout-land-finger/buttonbar.xml [new file with mode: 0644]
res/layout-land-finger/media_picker_activity.xml [moved from res/layout/media_picker_activity.xml with 94% similarity]
res/layout-land-finger/media_picker_activity_expanding.xml [moved from res/layout/media_picker_activity_expanding.xml with 94% similarity]
res/values-da/strings.xml
res/values-de/strings.xml
res/values-es-rUS/strings.xml
res/values-fr/strings.xml
res/values-it/strings.xml
res/values-pt/strings.xml
res/values-ru/strings.xml
res/values-sv/strings.xml
res/values-tr/strings.xml
res/values-zh-rCN/strings.xml
src/com/android/music/AlbumBrowserActivity.java
src/com/android/music/ArtistAlbumBrowserActivity.java
src/com/android/music/MediaAppWidgetProvider.java
src/com/android/music/MediaPlaybackActivity.java
src/com/android/music/MediaPlaybackActivityStarter.java [new file with mode: 0644]
src/com/android/music/MediaPlaybackService.java
src/com/android/music/MusicBrowserActivity.java
src/com/android/music/MusicUtils.java
src/com/android/music/PlaylistBrowserActivity.java
src/com/android/music/TrackBrowserActivity.java

index 8b8bbfc..5643369 100644 (file)
@@ -31,7 +31,9 @@
             android:name="android.app.default_searchable"
             android:value=".QueryBrowserActivity"
         />
-        <activity android:name="MusicBrowserActivity">
+        <activity android:name="MusicBrowserActivity"
+            android:theme="@android:style/Theme.NoTitleBar"
+        >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.DEFAULT" />
@@ -55,7 +57,7 @@
              to it we want it back in its initial state.  We exclude from
              recents since this is accessible through a notification when
              appropriate. -->
-        <activity android:name="MediaPlaybackActivity"
+        <activity android:name="MediaPlaybackActivityStarter"
                 android:theme="@android:style/Theme.NoTitleBar"
                 android:label="@string/mediaplaybacklabel"
                 android:taskAffinity=""
                 <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
         </activity>
+        <activity android:name="MediaPlaybackActivity"
+                android:theme="@android:style/Theme.NoTitleBar"
+                android:label="@string/mediaplaybacklabel" >
+        </activity>
+
         <activity android:name="StreamStarter" android:theme="@android:style/Theme.Dialog" >
             <intent-filter>
                 <action android:name="android.intent.action.VIEW" />
diff --git a/res/color/tab_indicator_text.xml b/res/color/tab_indicator_text.xml
new file mode 100644 (file)
index 0000000..62f522b
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_selected="true" android:color="#ffffff"/>
+    <item android:state_focused="true" android:color="#ffffff"/>
+    <item android:color="#808080"/> <!-- not selected -->
+</selector>
diff --git a/res/drawable-finger/buttonbarbackground.xml b/res/drawable-finger/buttonbarbackground.xml
new file mode 100644 (file)
index 0000000..54f4181
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item
+        android:state_focused="true"
+        android:drawable="@drawable/buttonbar_focused" />
+    <item
+        android:state_pressed="true"
+        android:drawable="@drawable/buttonbar_pressed" />
+    <item
+        android:state_selected="true"
+        android:drawable="@drawable/buttonbar_active" />
+    <item
+        android:state_selected="false"
+        android:drawable="@drawable/buttonbar_inactive" />
+</selector>
diff --git a/res/drawable-finger/ic_tab_albums.xml b/res/drawable-finger/ic_tab_albums.xml
new file mode 100644 (file)
index 0000000..72957df
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/ic_tab_albums_selected" />
+    <item android:drawable="@drawable/ic_tab_albums_unselected" />
+</selector>
+
diff --git a/res/drawable-finger/ic_tab_artists.xml b/res/drawable-finger/ic_tab_artists.xml
new file mode 100644 (file)
index 0000000..e79766a
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/ic_tab_artists_selected" />
+    <item android:drawable="@drawable/ic_tab_artists_unselected" />
+</selector>
+
diff --git a/res/drawable-finger/ic_tab_playback.xml b/res/drawable-finger/ic_tab_playback.xml
new file mode 100644 (file)
index 0000000..bcb8312
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/ic_tab_playback_selected" />
+    <item android:drawable="@drawable/ic_tab_playback_unselected" />
+</selector>
+
diff --git a/res/drawable-finger/ic_tab_playlists.xml b/res/drawable-finger/ic_tab_playlists.xml
new file mode 100644 (file)
index 0000000..64e6353
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/ic_tab_playlists_selected" />
+    <item android:drawable="@drawable/ic_tab_playlists_unselected" />
+</selector>
+
diff --git a/res/drawable-finger/ic_tab_songs.xml b/res/drawable-finger/ic_tab_songs.xml
new file mode 100644 (file)
index 0000000..7642017
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/ic_tab_songs_selected" />
+    <item android:drawable="@drawable/ic_tab_songs_unselected" />
+</selector>
+
diff --git a/res/drawable-hdpi-finger/buttonbar_active.9.png b/res/drawable-hdpi-finger/buttonbar_active.9.png
new file mode 100644 (file)
index 0000000..f036b9a
Binary files /dev/null and b/res/drawable-hdpi-finger/buttonbar_active.9.png differ
diff --git a/res/drawable-hdpi-finger/buttonbar_focused.9.png b/res/drawable-hdpi-finger/buttonbar_focused.9.png
new file mode 100644 (file)
index 0000000..6e8a71f
Binary files /dev/null and b/res/drawable-hdpi-finger/buttonbar_focused.9.png differ
diff --git a/res/drawable-hdpi-finger/buttonbar_inactive.9.png b/res/drawable-hdpi-finger/buttonbar_inactive.9.png
new file mode 100644 (file)
index 0000000..c3a1f30
Binary files /dev/null and b/res/drawable-hdpi-finger/buttonbar_inactive.9.png differ
diff --git a/res/drawable-hdpi-finger/buttonbar_pressed.9.png b/res/drawable-hdpi-finger/buttonbar_pressed.9.png
new file mode 100644 (file)
index 0000000..119b2c6
Binary files /dev/null and b/res/drawable-hdpi-finger/buttonbar_pressed.9.png differ
index ee9034b..0ff8d1a 100644 (file)
Binary files a/res/drawable-hdpi-finger/ic_mp_move.png and b/res/drawable-hdpi-finger/ic_mp_move.png differ
diff --git a/res/drawable-hdpi-finger/music_bottom_playback_bg.9.png b/res/drawable-hdpi-finger/music_bottom_playback_bg.9.png
new file mode 100644 (file)
index 0000000..df5bb44
Binary files /dev/null and b/res/drawable-hdpi-finger/music_bottom_playback_bg.9.png differ
diff --git a/res/drawable-hdpi/ic_tab_albums_selected.png b/res/drawable-hdpi/ic_tab_albums_selected.png
new file mode 100644 (file)
index 0000000..d12864c
Binary files /dev/null and b/res/drawable-hdpi/ic_tab_albums_selected.png differ
diff --git a/res/drawable-hdpi/ic_tab_albums_unselected.png b/res/drawable-hdpi/ic_tab_albums_unselected.png
new file mode 100644 (file)
index 0000000..7e3a933
Binary files /dev/null and b/res/drawable-hdpi/ic_tab_albums_unselected.png differ
diff --git a/res/drawable-hdpi/ic_tab_artists_selected.png b/res/drawable-hdpi/ic_tab_artists_selected.png
new file mode 100644 (file)
index 0000000..e6d3e99
Binary files /dev/null and b/res/drawable-hdpi/ic_tab_artists_selected.png differ
diff --git a/res/drawable-hdpi/ic_tab_artists_unselected.png b/res/drawable-hdpi/ic_tab_artists_unselected.png
new file mode 100644 (file)
index 0000000..3139529
Binary files /dev/null and b/res/drawable-hdpi/ic_tab_artists_unselected.png differ
diff --git a/res/drawable-hdpi/ic_tab_playback_selected.png b/res/drawable-hdpi/ic_tab_playback_selected.png
new file mode 100644 (file)
index 0000000..c23f761
Binary files /dev/null and b/res/drawable-hdpi/ic_tab_playback_selected.png differ
diff --git a/res/drawable-hdpi/ic_tab_playback_unselected.png b/res/drawable-hdpi/ic_tab_playback_unselected.png
new file mode 100644 (file)
index 0000000..136da63
Binary files /dev/null and b/res/drawable-hdpi/ic_tab_playback_unselected.png differ
diff --git a/res/drawable-hdpi/ic_tab_playlists_selected.png b/res/drawable-hdpi/ic_tab_playlists_selected.png
new file mode 100644 (file)
index 0000000..4588822
Binary files /dev/null and b/res/drawable-hdpi/ic_tab_playlists_selected.png differ
diff --git a/res/drawable-hdpi/ic_tab_playlists_unselected.png b/res/drawable-hdpi/ic_tab_playlists_unselected.png
new file mode 100644 (file)
index 0000000..e42392e
Binary files /dev/null and b/res/drawable-hdpi/ic_tab_playlists_unselected.png differ
diff --git a/res/drawable-hdpi/ic_tab_songs_selected.png b/res/drawable-hdpi/ic_tab_songs_selected.png
new file mode 100644 (file)
index 0000000..44e9cd1
Binary files /dev/null and b/res/drawable-hdpi/ic_tab_songs_selected.png differ
diff --git a/res/drawable-hdpi/ic_tab_songs_unselected.png b/res/drawable-hdpi/ic_tab_songs_unselected.png
new file mode 100644 (file)
index 0000000..41edb5c
Binary files /dev/null and b/res/drawable-hdpi/ic_tab_songs_unselected.png differ
diff --git a/res/drawable-mdpi-finger/music_bottom_playback_bg.png b/res/drawable-mdpi-finger/music_bottom_playback_bg.png
new file mode 100644 (file)
index 0000000..3c59e90
Binary files /dev/null and b/res/drawable-mdpi-finger/music_bottom_playback_bg.png differ
diff --git a/res/drawable-mdpi/ic_tab_albums_selected.png b/res/drawable-mdpi/ic_tab_albums_selected.png
new file mode 100644 (file)
index 0000000..702436e
Binary files /dev/null and b/res/drawable-mdpi/ic_tab_albums_selected.png differ
diff --git a/res/drawable-mdpi/ic_tab_albums_unselected.png b/res/drawable-mdpi/ic_tab_albums_unselected.png
new file mode 100644 (file)
index 0000000..f8083f6
Binary files /dev/null and b/res/drawable-mdpi/ic_tab_albums_unselected.png differ
diff --git a/res/drawable-mdpi/ic_tab_artists_selected.png b/res/drawable-mdpi/ic_tab_artists_selected.png
new file mode 100644 (file)
index 0000000..3b010d5
Binary files /dev/null and b/res/drawable-mdpi/ic_tab_artists_selected.png differ
diff --git a/res/drawable-mdpi/ic_tab_artists_unselected.png b/res/drawable-mdpi/ic_tab_artists_unselected.png
new file mode 100644 (file)
index 0000000..0737253
Binary files /dev/null and b/res/drawable-mdpi/ic_tab_artists_unselected.png differ
diff --git a/res/drawable-mdpi/ic_tab_playback_selected.png b/res/drawable-mdpi/ic_tab_playback_selected.png
new file mode 100644 (file)
index 0000000..629516a
Binary files /dev/null and b/res/drawable-mdpi/ic_tab_playback_selected.png differ
diff --git a/res/drawable-mdpi/ic_tab_playback_unselected.png b/res/drawable-mdpi/ic_tab_playback_unselected.png
new file mode 100644 (file)
index 0000000..8a924d9
Binary files /dev/null and b/res/drawable-mdpi/ic_tab_playback_unselected.png differ
diff --git a/res/drawable-mdpi/ic_tab_playlists_selected.png b/res/drawable-mdpi/ic_tab_playlists_selected.png
new file mode 100644 (file)
index 0000000..78b128e
Binary files /dev/null and b/res/drawable-mdpi/ic_tab_playlists_selected.png differ
diff --git a/res/drawable-mdpi/ic_tab_playlists_unselected.png b/res/drawable-mdpi/ic_tab_playlists_unselected.png
new file mode 100644 (file)
index 0000000..969366b
Binary files /dev/null and b/res/drawable-mdpi/ic_tab_playlists_unselected.png differ
diff --git a/res/drawable-mdpi/ic_tab_songs_selected.png b/res/drawable-mdpi/ic_tab_songs_selected.png
new file mode 100644 (file)
index 0000000..fa3ad84
Binary files /dev/null and b/res/drawable-mdpi/ic_tab_songs_selected.png differ
diff --git a/res/drawable-mdpi/ic_tab_songs_unselected.png b/res/drawable-mdpi/ic_tab_songs_unselected.png
new file mode 100644 (file)
index 0000000..48144f1
Binary files /dev/null and b/res/drawable-mdpi/ic_tab_songs_unselected.png differ
diff --git a/res/layout-finger/buttonbar.xml b/res/layout-finger/buttonbar.xml
new file mode 100644 (file)
index 0000000..472889a
--- /dev/null
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2008, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<TabWidget xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/buttonbar"
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content" >
+
+    <TextView
+        android:id="@+id/artisttab"
+        android:focusable="true"
+        android:background="@drawable/buttonbarbackground"
+        android:drawableTop="@drawable/ic_tab_artists"
+        android:text="@string/browse_menu"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:textColor="@color/tab_indicator_text"
+        android:paddingTop="7dip"
+        android:paddingBottom="2dip"
+        android:gravity="center"
+        android:layout_weight="1"
+        android:layout_marginLeft="-3dip"
+        android:layout_marginRight="-3dip"
+        android:layout_width="fill_parent"
+        android:layout_height="64dip" />
+
+    <TextView
+        android:id="@+id/albumtab"
+        android:focusable="true"
+        android:background="@drawable/buttonbarbackground"
+        android:drawableTop="@drawable/ic_tab_albums"
+        android:text="@string/albums_menu"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:textColor="@color/tab_indicator_text"
+        android:paddingTop="7dip"
+        android:paddingBottom="2dip"
+        android:gravity="center"
+        android:layout_weight="1"
+        android:layout_marginLeft="-3dip"
+        android:layout_marginRight="-3dip"
+        android:layout_width="fill_parent"
+        android:layout_height="64dip" />
+
+    <TextView
+        android:id="@+id/songtab"
+        android:focusable="true"
+        android:background="@drawable/buttonbarbackground"
+        android:drawableTop="@drawable/ic_tab_songs"
+        android:text="@string/tracks_menu"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:textColor="@color/tab_indicator_text"
+        android:paddingTop="7dip"
+        android:paddingBottom="2dip"
+        android:gravity="center"
+        android:layout_weight="1"
+        android:layout_marginLeft="-3dip"
+        android:layout_marginRight="-3dip"
+        android:layout_width="fill_parent"
+        android:layout_height="64dip" />
+
+    <TextView
+        android:id="@+id/playlisttab"
+        android:focusable="true"
+        android:background="@drawable/buttonbarbackground"
+        android:drawableTop="@drawable/ic_tab_playlists"
+        android:text="@string/playlists_menu"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:textColor="@color/tab_indicator_text"
+        android:paddingTop="7dip"
+        android:paddingBottom="2dip"
+        android:gravity="center"
+        android:layout_weight="1"
+        android:layout_marginLeft="-3dip"
+        android:layout_marginRight="-3dip"
+        android:layout_width="fill_parent"
+        android:layout_height="64dip" />
+
+</TabWidget>
+
diff --git a/res/layout-finger/media_picker_activity.xml b/res/layout-finger/media_picker_activity.xml
new file mode 100644 (file)
index 0000000..6513dcb
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<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_vertical" >
+
+    <include layout="@layout/sd_error" />
+
+    <include layout="@layout/buttonbar" />
+
+    <com.android.music.TouchInterceptor
+        android:id="@android:id/list"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:layout_weight="1"
+        android:textSize="18sp"
+        android:drawSelectorOnTop="false"
+        android:fastScrollEnabled="true" /> 
+
+    <include layout="@layout/nowplaying" />
+
+</LinearLayout>
diff --git a/res/layout-finger/media_picker_activity_expanding.xml b/res/layout-finger/media_picker_activity_expanding.xml
new file mode 100644 (file)
index 0000000..17dde1a
--- /dev/null
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<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_vertical" >
+
+    <include layout="@layout/sd_error" />
+
+    <include layout="@layout/buttonbar" />
+
+    <ExpandableListView
+        android:id="@android:id/list"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:layout_weight="1"
+        android:textSize="18sp"
+        android:drawSelectorOnTop="false"
+        android:fastScrollEnabled="true"
+        android:indicatorLeft="8dip"
+        android:indicatorRight="52dip" />
+
+    <include layout="@layout/nowplaying" />
+
+</LinearLayout>
diff --git a/res/layout-finger/nowplaying.xml b/res/layout-finger/nowplaying.xml
new file mode 100644 (file)
index 0000000..86dde1f
--- /dev/null
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2008, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/nowplaying"
+    android:layout_width="fill_parent"
+    android:layout_height="64dip"
+    android:focusable="true"
+    android:visibility="gone"
+    android:background="@drawable/music_bottom_playback_bg"
+    android:orientation="vertical">
+
+    <LinearLayout
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:orientation="horizontal">
+
+        <LinearLayout
+            android:layout_width="0dip"
+            android:layout_weight="1"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_vertical"
+            android:orientation="vertical">
+
+            <TextView
+                android:id="@+id/title"
+                android:textAppearance="?android:attr/textAppearanceMedium"
+                android:singleLine="true"
+                android:ellipsize="end"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+            />
+            <TextView
+                android:id="@+id/artist"
+                android:textAppearance="?android:attr/textAppearanceSmall"
+                android:singleLine="true"
+                android:ellipsize="end"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+            />
+        </LinearLayout>
+
+        <ImageView android:id="@+id/icon"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_vertical"
+            android:layout_marginLeft="16dip"
+            android:background="@drawable/indicator_ic_mp_playing_large"
+        />
+
+    </LinearLayout>
+</LinearLayout>   
+
diff --git a/res/layout-land-finger/buttonbar.xml b/res/layout-land-finger/buttonbar.xml
new file mode 100644 (file)
index 0000000..c7f610f
--- /dev/null
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+**
+** Copyright 2008, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+**     http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<TabWidget xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/buttonbar"
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content" >
+
+    <TextView
+        android:id="@+id/artisttab"
+        android:focusable="true"
+        android:background="@drawable/buttonbarbackground"
+        android:drawableTop="@drawable/ic_tab_artists"
+        android:text="@string/browse_menu"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:textColor="@color/tab_indicator_text"
+        android:paddingTop="7dip"
+        android:paddingBottom="2dip"
+        android:gravity="center"
+        android:layout_weight="1"
+        android:layout_marginLeft="-3dip"
+        android:layout_marginRight="-3dip"
+        android:layout_width="fill_parent"
+        android:layout_height="64dip" />
+
+    <TextView
+        android:id="@+id/albumtab"
+        android:focusable="true"
+        android:background="@drawable/buttonbarbackground"
+        android:drawableTop="@drawable/ic_tab_albums"
+        android:text="@string/albums_menu"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:textColor="@color/tab_indicator_text"
+        android:paddingTop="7dip"
+        android:paddingBottom="2dip"
+        android:gravity="center"
+        android:layout_weight="1"
+        android:layout_marginLeft="-3dip"
+        android:layout_marginRight="-3dip"
+        android:layout_width="fill_parent"
+        android:layout_height="64dip" />
+
+    <TextView
+        android:id="@+id/songtab"
+        android:focusable="true"
+        android:background="@drawable/buttonbarbackground"
+        android:drawableTop="@drawable/ic_tab_songs"
+        android:text="@string/tracks_menu"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:textColor="@color/tab_indicator_text"
+        android:paddingTop="7dip"
+        android:paddingBottom="2dip"
+        android:gravity="center"
+        android:layout_weight="1"
+        android:layout_marginLeft="-3dip"
+        android:layout_marginRight="-3dip"
+        android:layout_width="fill_parent"
+        android:layout_height="64dip" />
+
+    <TextView
+        android:id="@+id/playlisttab"
+        android:focusable="true"
+        android:background="@drawable/buttonbarbackground"
+        android:drawableTop="@drawable/ic_tab_playlists"
+        android:text="@string/playlists_menu"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:textColor="@color/tab_indicator_text"
+        android:paddingTop="7dip"
+        android:paddingBottom="2dip"
+        android:gravity="center"
+        android:layout_weight="1"
+        android:layout_marginLeft="-3dip"
+        android:layout_marginRight="-3dip"
+        android:layout_width="fill_parent"
+        android:layout_height="64dip" />
+
+    <TextView
+        android:id="@+id/nowplayingtab"
+        android:focusable="false"
+        android:background="@drawable/buttonbarbackground"
+        android:drawableTop="@drawable/ic_tab_playback"
+        android:text="@string/nowplaying_title"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:textColor="@color/tab_indicator_text"
+        android:paddingTop="7dip"
+        android:paddingBottom="2dip"
+        android:gravity="center"
+        android:layout_weight="1"
+        android:layout_marginLeft="3dip"
+        android:layout_marginRight="-3dip"
+        android:layout_width="fill_parent"
+        android:layout_height="64dip" />
+
+</TabWidget>
+
similarity index 94%
rename from res/layout/media_picker_activity.xml
rename to res/layout-land-finger/media_picker_activity.xml
index 79f080e..5277356 100644 (file)
 
     <include layout="@layout/sd_error" />
 
+    <include layout="@layout/buttonbar" />
+
     <com.android.music.TouchInterceptor
         android:id="@android:id/list"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent"
+        android:layout_weight="1"
         android:textSize="18sp"
         android:drawSelectorOnTop="false"
         android:fastScrollEnabled="true" /> 
 
     <include layout="@layout/sd_error" />
 
+    <include layout="@layout/buttonbar" />
+
     <ExpandableListView
         android:id="@android:id/list"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent"
+        android:layout_weight="1"
         android:textSize="18sp"
         android:drawSelectorOnTop="false"
         android:fastScrollEnabled="true"
index c76f19e..6779d17 100644 (file)
@@ -63,8 +63,8 @@
     <string name="rename_playlist_menu" msgid="3133463747389494668">"Omdøb"</string>
     <string name="playlist_deleted_message" msgid="9008053828193961455">"Afspilningsliste slettet."</string>
     <string name="playlist_renamed_message" msgid="7187580192703005990">"Afspilningslisten er omdøbt."</string>
-    <string name="recentlyadded" msgid="110978416756366953">"Tilføjet for nyligt"</string>
-    <string name="recentlyadded_title" msgid="3153322287249901914">"Tilføjet for nyligt"</string>
+    <string name="recentlyadded" msgid="110978416756366953">"Tilføjet for nylig"</string>
+    <string name="recentlyadded_title" msgid="3153322287249901914">"Tilføjet for nylig"</string>
     <string name="podcasts_listitem" msgid="8657809279717670634">"Podcasts"</string>
     <string name="podcasts_title" msgid="4928414142496858304">"Podcasts"</string>
     <string name="sdcard_missing_title" msgid="9008284946643270850">"Der er intet SD-kort"</string>
     <string name="sdcard_error_message" msgid="4574563894036627855">"Der opstod en fejl på dit SD-kort."</string>
     <string name="unknown_artist_name" msgid="5567811106415855219">"Ukendt kunstner"</string>
     <string name="unknown_album_name" msgid="8525145988941244727">"Ukendt album"</string>
-    <string name="shuffle_on_notif" msgid="5453708337808483943">"Bland er slået til."</string>
-    <string name="shuffle_off_notif" msgid="4251189610017886263">"Bland er slået fra."</string>
+    <string name="shuffle_on_notif" msgid="5453708337808483943">"Blanding er slået til."</string>
+    <string name="shuffle_off_notif" msgid="4251189610017886263">"Blanding er slået fra."</string>
     <string name="repeat_off_notif" msgid="1149406899083479716">"Gentagelse er slået fra."</string>
     <string name="repeat_current_notif" msgid="1227153936360904196">"Den aktuelle sang gentages."</string>
     <string name="repeat_all_notif" msgid="6443293055987316642">"Gentager alle sange."</string>
-    <string name="ringtone_menu" msgid="2737472190159134599">"Brug som telefonringetone"</string>
+    <string name="ringtone_menu" msgid="2737472190159134599">"Brug som ringetone"</string>
     <string name="ringtone_menu_short" msgid="3367622038867238133">"Brug som ringetone"</string>
     <string name="ringtone_set" msgid="5325818347613843130">"\"<xliff:g id="NAME">%s</xliff:g>\" er indstillet som ringetone for telefonen."</string>
     <string name="play_selection" msgid="2854921021814550018">"Afspil"</string>
     <item msgid="2727959579637914171">"11 uger"</item>
     <item msgid="8708754966127584739">"12 uger"</item>
   </string-array>
-    <string name="weekpicker_set" msgid="7636608790418067496">"Færdig"</string>
-    <string name="weekpicker_title" msgid="699535378922101701">"Indstil tid"</string>
+    <string name="weekpicker_set" msgid="7636608790418067496">"Udfør"</string>
+    <string name="weekpicker_title" msgid="699535378922101701">"Angiv tid"</string>
     <string name="save_as_playlist" msgid="5180413608901885255">"Gem som afspilningsliste"</string>
     <string name="clear_playlist" msgid="4565515100924905315">"Ryd afspilningsliste"</string>
     <string name="musicbrowserlabel" msgid="3162022214114562892">"Musik"</string>
index be3b13b..c5d9996 100644 (file)
@@ -29,7 +29,7 @@
     <string name="goto_start" msgid="8979658707407220934">"Bibliothek"</string>
     <string name="goto_playback" msgid="4885216161312176550">"Wiedergeben"</string>
     <string name="party_shuffle" msgid="8213359225506006168">"Party-Shuffle"</string>
-    <string name="party_shuffle_off" msgid="1828744483354711679">"Party-Shuffle deaktivieren"</string>
+    <string name="party_shuffle_off" msgid="1828744483354711679">"Party-Shuffle aus"</string>
     <string name="delete_item" msgid="3363330144534750601">"Löschen"</string>
     <string name="shuffle_all" msgid="1388193611787878773">"Alle zufällig wiedergeben"</string>
     <string name="play_all" msgid="6309622568869321842">"Alle wiedergeben"</string>
@@ -80,7 +80,7 @@
     <string name="repeat_off_notif" msgid="1149406899083479716">"Wiederholung ist deaktiviert."</string>
     <string name="repeat_current_notif" msgid="1227153936360904196">"Aktueller Titel wird wiederholt."</string>
     <string name="repeat_all_notif" msgid="6443293055987316642">"Alle Titel werden wiederholt."</string>
-    <string name="ringtone_menu" msgid="2737472190159134599">"Als Telefonklingelton verwenden"</string>
+    <string name="ringtone_menu" msgid="2737472190159134599">"Als Klingelton verwenden"</string>
     <string name="ringtone_menu_short" msgid="3367622038867238133">"Als Klingelton verwenden"</string>
     <string name="ringtone_set" msgid="5325818347613843130">"\"<xliff:g id="NAME">%s</xliff:g>\" wurde als Telefonklingelton festgelegt."</string>
     <string name="play_selection" msgid="2854921021814550018">"Wiedergeben"</string>
     <item msgid="8708754966127584739">"12 Wochen"</item>
   </string-array>
     <string name="weekpicker_set" msgid="7636608790418067496">"Fertig"</string>
-    <string name="weekpicker_title" msgid="699535378922101701">"Uhrzeit einstellen"</string>
+    <string name="weekpicker_title" msgid="699535378922101701">"Zeit einstellen"</string>
     <string name="save_as_playlist" msgid="5180413608901885255">"Als Playlist speichern"</string>
     <string name="clear_playlist" msgid="4565515100924905315">"Playlist löschen"</string>
     <string name="musicbrowserlabel" msgid="3162022214114562892">"Musik"</string>
index 13c62f9..f073f57 100644 (file)
@@ -49,7 +49,7 @@
     <string name="albums_title" msgid="8773880394961378035">"Álbumes"</string>
     <string name="tracks_menu" msgid="6942246568246092330">"Canciones"</string>
     <string name="tracks_title" msgid="3229389424532295124">"Canciones"</string>
-    <string name="playlists_menu" msgid="5382792649771928849">"Listas de repr."</string>
+    <string name="playlists_menu" msgid="5382792649771928849">"Listas de rep."</string>
     <string name="playlists_title" msgid="5094238486322957927">"Listas de reproducción"</string>
     <string name="videos_title" msgid="2066741954354129115">"Videos"</string>
     <string name="all_title" msgid="6880186414437237653">"Todos los medios"</string>
index 03dd64c..c61ed96 100644 (file)
@@ -29,7 +29,7 @@
     <string name="goto_start" msgid="8979658707407220934">"Bibliothèque"</string>
     <string name="goto_playback" msgid="4885216161312176550">"Lecture"</string>
     <string name="party_shuffle" msgid="8213359225506006168">"Lecture aléatoire"</string>
-    <string name="party_shuffle_off" msgid="1828744483354711679">"La lecture aléatoire est désactivée."</string>
+    <string name="party_shuffle_off" msgid="1828744483354711679">"Désactiver la lecture aléatoire"</string>
     <string name="delete_item" msgid="3363330144534750601">"Supprimer"</string>
     <string name="shuffle_all" msgid="1388193611787878773">"Lecture aléatoire de toutes les chansons"</string>
     <string name="play_all" msgid="6309622568869321842">"Tout lire"</string>
@@ -86,7 +86,7 @@
     <string name="play_selection" msgid="2854921021814550018">"Lire"</string>
     <string name="add_to_playlist" msgid="7110273488645072783">"Ajouter à la playlist"</string>
     <string name="queue" msgid="2937629819482787704">"Playlist actuelle"</string>
-    <string name="new_playlist" msgid="7588112979692632867">"Nouveau"</string>
+    <string name="new_playlist" msgid="7588112979692632867">"Nouvelle"</string>
     <string name="new_playlist_name_template" msgid="905710296728900597">"Nouvelle playlist <xliff:g id="NUMBER">%d</xliff:g>"</string>
   <plurals name="NNNtrackstoplaylist">
     <item quantity="one" msgid="422388042993582235">"1 chanson a été ajoutée à la playlist."</item>
index 61a6113..770089d 100644 (file)
@@ -31,7 +31,7 @@
     <string name="party_shuffle" msgid="8213359225506006168">"Party shuffle"</string>
     <string name="party_shuffle_off" msgid="1828744483354711679">"Party shuffle non attiva"</string>
     <string name="delete_item" msgid="3363330144534750601">"Elimina"</string>
-    <string name="shuffle_all" msgid="1388193611787878773">"Ripr. casuale"</string>
+    <string name="shuffle_all" msgid="1388193611787878773">"Casuale"</string>
     <string name="play_all" msgid="6309622568869321842">"Riprod. tutti"</string>
     <string name="delete_artist_desc" msgid="1843750591006508005">"Tutti i brani di <xliff:g id="ARTIST">%s</xliff:g> verranno eliminati definitivamente dalla scheda SD."</string>
     <string name="delete_album_desc" msgid="535515999268177079">"L\'intero album \"<xliff:g id="ALBUM">%s</xliff:g>\" verrà eliminato definitivamente dalla scheda SD."</string>
@@ -83,7 +83,7 @@
     <string name="ringtone_menu" msgid="2737472190159134599">"Usa come suoneria"</string>
     <string name="ringtone_menu_short" msgid="3367622038867238133">"Usa come suoneria"</string>
     <string name="ringtone_set" msgid="5325818347613843130">"\"<xliff:g id="NAME">%s</xliff:g>\" impostato come suoneria del telefono."</string>
-    <string name="play_selection" msgid="2854921021814550018">"Riprod."</string>
+    <string name="play_selection" msgid="2854921021814550018">"Riproduci"</string>
     <string name="add_to_playlist" msgid="7110273488645072783">"Aggiungi a playlist"</string>
     <string name="queue" msgid="2937629819482787704">"Playlist corrente"</string>
     <string name="new_playlist" msgid="7588112979692632867">"Nuova"</string>
index a38af23..eec54ee 100644 (file)
@@ -49,7 +49,7 @@
     <string name="albums_title" msgid="8773880394961378035">"Álbuns"</string>
     <string name="tracks_menu" msgid="6942246568246092330">"Músicas"</string>
     <string name="tracks_title" msgid="3229389424532295124">"Músicas"</string>
-    <string name="playlists_menu" msgid="5382792649771928849">"Listas de reprodução"</string>
+    <string name="playlists_menu" msgid="5382792649771928849">"Listas"</string>
     <string name="playlists_title" msgid="5094238486322957927">"Listas de reprodução"</string>
     <string name="videos_title" msgid="2066741954354129115">"Vídeos"</string>
     <string name="all_title" msgid="6880186414437237653">"Todas as mídias"</string>
index f9491b0..140671e 100644 (file)
@@ -80,8 +80,8 @@
     <string name="repeat_off_notif" msgid="1149406899083479716">"Режим повторного воспроизведения отключен."</string>
     <string name="repeat_current_notif" msgid="1227153936360904196">"Повторение текущей композиции."</string>
     <string name="repeat_all_notif" msgid="6443293055987316642">"Повтор всех композиций."</string>
-    <string name="ringtone_menu" msgid="2737472190159134599">"СделаÑ\82Ñ\8c Ð¼ÐµÐ»Ð¾Ð´Ð¸ÐµÐ¹ Ð·Ð²Ð¾Ð½ÐºÐ°"</string>
-    <string name="ringtone_menu_short" msgid="3367622038867238133">"СделаÑ\82Ñ\8c Ð¼ÐµÐ»Ð¾Ð´Ð¸ÐµÐ¹ Ð·Ð²Ð¾Ð½ÐºÐ°"</string>
+    <string name="ringtone_menu" msgid="2737472190159134599">"Ð\9fоÑ\81Ñ\82авиÑ\82Ñ\8c Ð½Ð° Ð·Ð²Ð¾Ð½Ð¾Ðº"</string>
+    <string name="ringtone_menu_short" msgid="3367622038867238133">"Ð\9fоÑ\81Ñ\82авиÑ\82Ñ\8c Ð½Ð° Ð·Ð²Ð¾Ð½Ð¾Ðº"</string>
     <string name="ringtone_set" msgid="5325818347613843130">"Композиция \"<xliff:g id="NAME">%s</xliff:g>\" установлена в качестве мелодии звонка."</string>
     <string name="play_selection" msgid="2854921021814550018">"Воспроизвести"</string>
     <string name="add_to_playlist" msgid="7110273488645072783">"Добавить в плейлист"</string>
     <string name="music_picker_title" msgid="1561623486324013570">"Выбрать музыкальную дорожку"</string>
     <string name="gadget_track" msgid="3186569295893300114">"Трек <xliff:g id="TRACK_NUMBER">%d</xliff:g>"</string>
     <string name="fail_to_start_stream" msgid="3605390187703912835">"Не удается выполнить совместный просмотр."</string>
-    <string name="search_settings_description" msgid="6520975349259883368">"Ð\98Ñ\81полниÑ\82ели, Ð°Ð»Ñ\8cбомÑ\8b Ð¸ Ð´Ð¾Ñ\80ожки"</string>
+    <string name="search_settings_description" msgid="6520975349259883368">"Ð\98Ñ\81полниÑ\82ели, Ð°Ð»Ñ\8cбомÑ\8b Ð¸ ÐºÐ¾Ð¼Ð¿Ð¾Ð·Ð¸Ñ\86ии"</string>
 </resources>
index 5c81ea0..c2e6d5c 100644 (file)
@@ -29,7 +29,7 @@
     <string name="goto_start" msgid="8979658707407220934">"Bibliotek"</string>
     <string name="goto_playback" msgid="4885216161312176550">"Uppspelning"</string>
     <string name="party_shuffle" msgid="8213359225506006168">"Blanda alla spår"</string>
-    <string name="party_shuffle_off" msgid="1828744483354711679">"Blandar inte hela listan"</string>
+    <string name="party_shuffle_off" msgid="1828744483354711679">"Blanda inte hela listan"</string>
     <string name="delete_item" msgid="3363330144534750601">"Ta bort"</string>
     <string name="shuffle_all" msgid="1388193611787878773">"Blanda hela listan"</string>
     <string name="play_all" msgid="6309622568869321842">"Spela alla"</string>
index f8d41f4..3d4803c 100644 (file)
@@ -82,7 +82,7 @@
     <string name="repeat_all_notif" msgid="6443293055987316642">"Tüm şarkılar tekrarlanıyor."</string>
     <string name="ringtone_menu" msgid="2737472190159134599">"Telefon zil sesi olarak kullan"</string>
     <string name="ringtone_menu_short" msgid="3367622038867238133">"Zil sesi olarak kullan"</string>
-    <string name="ringtone_set" msgid="5325818347613843130">"\"<xliff:g id="NAME">%s</xliff:g>\" telefon zil sesi olarak ayarlanmış."</string>
+    <string name="ringtone_set" msgid="5325818347613843130">"<xliff:g id="NAME">%s</xliff:g> telefon zil sesi olarak ayarlandı."</string>
     <string name="play_selection" msgid="2854921021814550018">"Yürüt"</string>
     <string name="add_to_playlist" msgid="7110273488645072783">"Şarkı listesine ekle"</string>
     <string name="queue" msgid="2937629819482787704">"Geçerli şarkı listesi"</string>
index 3b27017..acf550e 100644 (file)
     <string name="delete_item" msgid="3363330144534750601">"删除"</string>
     <string name="shuffle_all" msgid="1388193611787878773">"全部随机播放"</string>
     <string name="play_all" msgid="6309622568869321842">"全部播放"</string>
-    <string name="delete_artist_desc" msgid="1843750591006508005">"将会从 SD 卡上永久删除<xliff:g id="ARTIST">%s</xliff:g>的所有歌曲。"</string>
-    <string name="delete_album_desc" msgid="535515999268177079">"将会从 SD 卡上永久删除整张“<xliff:g id="ALBUM">%s</xliff:g>”专辑。"</string>
-    <string name="delete_song_desc" msgid="1856800468541831408">"将会从 SD 卡上永久删除“<xliff:g id="SONG">%s</xliff:g>”。"</string>
+    <string name="delete_artist_desc" msgid="1843750591006508005">"<xliff:g id="ARTIST">%s</xliff:g>的所有歌曲会从 SD 卡中永久删除。"</string>
+    <string name="delete_album_desc" msgid="535515999268177079">"整张“<xliff:g id="ALBUM">%s</xliff:g>”专辑会从 SD 卡中永久删除。"</string>
+    <string name="delete_song_desc" msgid="1856800468541831408">"“<xliff:g id="SONG">%s</xliff:g>”会从 SD 卡中永久删除。"</string>
     <string name="delete_confirm_button_text" msgid="7008121194944357274">"确定"</string>
   <plurals name="NNNtracksdeleted">
     <item quantity="one" msgid="8560276109508404217">"已删除 1 首歌曲。"</item>
-    <item quantity="other" msgid="5156740163031225200">"<xliff:g id="SONGS_TO_DELETE">%d</xliff:g> 首歌曲已删除。"</item>
+    <item quantity="other" msgid="5156740163031225200">"已删除 <xliff:g id="SONGS_TO_DELETE">%d</xliff:g> 首歌曲。"</item>
   </plurals>
     <string name="scanning" msgid="3529383847223198502">"正在扫描 SD 卡..."</string>
-    <string name="nowplaying_title" msgid="8342523844307751761">"当前播放列表"</string>
+    <string name="nowplaying_title" msgid="8342523844307751761">"正在播放"</string>
     <string name="partyshuffle_title" msgid="6582413231529992125">"派对随机播放"</string>
     <string name="artists_title" msgid="8490372367259160067">"艺术家"</string>
     <string name="albums_menu" msgid="5807982055590211900">"专辑"</string>
@@ -63,8 +63,8 @@
     <string name="rename_playlist_menu" msgid="3133463747389494668">"重命名"</string>
     <string name="playlist_deleted_message" msgid="9008053828193961455">"播放列表已删除。"</string>
     <string name="playlist_renamed_message" msgid="7187580192703005990">"播放列表已重命名。"</string>
-    <string name="recentlyadded" msgid="110978416756366953">"æ\9c\80è¿\91æ·»å\8a ç\9a\84æ\96\87件"</string>
-    <string name="recentlyadded_title" msgid="3153322287249901914">"æ\9c\80è¿\91æ·»å\8a ç\9a\84æ\96\87件"</string>
+    <string name="recentlyadded" msgid="110978416756366953">"æ\9c\80è¿\91æ·»å\8a ç\9a\84æ­\8cæ\9b²"</string>
+    <string name="recentlyadded_title" msgid="3153322287249901914">"æ\96°å¢\9eæ­\8cæ\9b²"</string>
     <string name="podcasts_listitem" msgid="8657809279717670634">"播客"</string>
     <string name="podcasts_title" msgid="4928414142496858304">"播客"</string>
     <string name="sdcard_missing_title" msgid="9008284946643270850">"无 SD 卡"</string>
@@ -72,7 +72,7 @@
     <string name="sdcard_busy_title" msgid="1162763571147174655">"SD 卡不可用"</string>
     <string name="sdcard_busy_message" msgid="8071868348072728830">"抱歉,SD 卡正忙。"</string>
     <string name="sdcard_error_title" msgid="165682155008600643">"SD 卡错误"</string>
-    <string name="sdcard_error_message" msgid="4574563894036627855">"SD 卡出现错误。"</string>
+    <string name="sdcard_error_message" msgid="4574563894036627855">"SD 卡出现错误。"</string>
     <string name="unknown_artist_name" msgid="5567811106415855219">"未知艺术家"</string>
     <string name="unknown_album_name" msgid="8525145988941244727">"未知专辑"</string>
     <string name="shuffle_on_notif" msgid="5453708337808483943">"随机播放已打开。"</string>
     <string name="repeat_all_notif" msgid="6443293055987316642">"重复播放所有歌曲。"</string>
     <string name="ringtone_menu" msgid="2737472190159134599">"用作手机铃声"</string>
     <string name="ringtone_menu_short" msgid="3367622038867238133">"用作铃声"</string>
-    <string name="ringtone_set" msgid="5325818347613843130">"已将“<xliff:g id="NAME">%s</xliff:g>”设为手机铃声。"</string>
+    <string name="ringtone_set" msgid="5325818347613843130">"已将“<xliff:g id="NAME">%s</xliff:g>”设为手机铃声。"</string>
     <string name="play_selection" msgid="2854921021814550018">"播放"</string>
     <string name="add_to_playlist" msgid="7110273488645072783">"添加到播放列表"</string>
-    <string name="queue" msgid="2937629819482787704">"当前播放列表"</string>
-    <string name="new_playlist" msgid="7588112979692632867">"新建"</string>
-    <string name="new_playlist_name_template" msgid="905710296728900597">"新播放列表 <xliff:g id="NUMBER">%d</xliff:g>"</string>
+    <string name="queue" msgid="2937629819482787704">"当前播放列表"</string>
+    <string name="new_playlist" msgid="7588112979692632867">"新建播放列表"</string>
+    <string name="new_playlist_name_template" msgid="905710296728900597">"新播放列表 <xliff:g id="NUMBER">%d</xliff:g>"</string>
   <plurals name="NNNtrackstoplaylist">
     <item quantity="one" msgid="422388042993582235">"已将 1 首歌曲添加到播放列表。"</item>
     <item quantity="other" msgid="7662771987109627255">"<xliff:g id="NUMBER">%d</xliff:g> 首歌曲已添加到播放列表。"</item>
   </plurals>
-    <string name="emptyplaylist" msgid="6711555673997896344">"选定的播放列表为空。"</string>
+    <string name="emptyplaylist" msgid="6711555673997896344">"您选的播放列表是空的。"</string>
     <string name="create_playlist_create_text" msgid="8149755205483279143">"保存"</string>
     <string name="create_playlist_overwrite_text" msgid="2007808383561024706">"覆盖"</string>
     <string name="service_start_error_title" msgid="8649916852210198813">"播放问题"</string>
index 49a3893..ba3e212 100644 (file)
@@ -20,10 +20,12 @@ import android.app.ListActivity;
 import android.app.SearchManager;
 import android.content.AsyncQueryHandler;
 import android.content.BroadcastReceiver;
+import android.content.ComponentName;
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
+import android.content.ServiceConnection;
 import android.content.res.Resources;
 import android.database.Cursor;
 import android.graphics.Bitmap;
@@ -35,6 +37,7 @@ import android.media.MediaFile;
 import android.net.Uri;
 import android.os.Bundle;
 import android.os.Handler;
+import android.os.IBinder;
 import android.os.Message;
 import android.provider.MediaStore;
 import android.util.Log;
@@ -49,6 +52,7 @@ import android.view.ContextMenu.ContextMenuInfo;
 import android.widget.Adapter;
 import android.widget.AlphabetIndexer;
 import android.widget.CursorAdapter;
+import android.widget.ExpandableListView;
 import android.widget.ImageView;
 import android.widget.ListAdapter;
 import android.widget.ListView;
@@ -60,7 +64,7 @@ import android.widget.AdapterView.AdapterContextMenuInfo;
 import java.text.Collator;
 
 public class AlbumBrowserActivity extends ListActivity
-    implements View.OnCreateContextMenuListener, MusicUtils.Defs
+    implements View.OnCreateContextMenuListener, MusicUtils.Defs, ServiceConnection
 {
     private String mCurrentAlbumId;
     private String mCurrentAlbumName;
@@ -70,6 +74,8 @@ public class AlbumBrowserActivity extends ListActivity
     private AlbumListAdapter mAdapter;
     private boolean mAdapterSent;
     private final static int SEARCH = CHILD_MENU_BASE;
+    private static int mLastListPosCourse = -1;
+    private static int mLastListPosFine = -1;
 
     public AlbumBrowserActivity()
     {
@@ -87,8 +93,9 @@ public class AlbumBrowserActivity extends ListActivity
         }
         super.onCreate(icicle);
         requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
+        requestWindowFeature(Window.FEATURE_NO_TITLE);
         setVolumeControlStream(AudioManager.STREAM_MUSIC);
-        MusicUtils.bindToService(this);
+        MusicUtils.bindToService(this, this);
 
         IntentFilter f = new IntentFilter();
         f.addAction(Intent.ACTION_MEDIA_SCANNER_STARTED);
@@ -98,8 +105,8 @@ public class AlbumBrowserActivity extends ListActivity
         registerReceiver(mScanListener, f);
 
         setContentView(R.layout.media_picker_activity);
+        MusicUtils.updateButtonBar(this, R.id.albumtab);
         ListView lv = getListView();
-        lv.setFastScrollEnabled(true);
         lv.setOnCreateContextMenuListener(this);
         lv.setTextFilterEnabled(true);
 
@@ -146,6 +153,14 @@ public class AlbumBrowserActivity extends ListActivity
 
     @Override
     public void onDestroy() {
+        ListView lv = getListView();
+        if (lv != null) {
+            mLastListPosCourse = lv.getFirstVisiblePosition();
+            View cv = lv.getChildAt(0);
+            if (cv != null) {
+                mLastListPosFine = cv.getTop();
+            }
+        }
         MusicUtils.unbindFromService(this);
         if (!mAdapterSent) {
             Cursor c = mAdapter.getCursor();
@@ -178,6 +193,7 @@ public class AlbumBrowserActivity extends ListActivity
         @Override
         public void onReceive(Context context, Intent intent) {
             getListView().invalidateViews();
+            MusicUtils.updateNowPlaying(AlbumBrowserActivity.this);
         }
     };
     private BroadcastReceiver mScanListener = new BroadcastReceiver() {
@@ -220,8 +236,15 @@ public class AlbumBrowserActivity extends ListActivity
             mReScanHandler.sendEmptyMessageDelayed(0, 1000);
             return;
         }
-        
+
+        // restore previous position
+        if (mLastListPosCourse >= 0) {
+            getListView().setSelectionFromTop(mLastListPosCourse, mLastListPosFine);
+            mLastListPosCourse = -1;
+        }
+
         MusicUtils.hideDatabaseError(this);
+        MusicUtils.updateButtonBar(this, R.id.albumtab);
         setTitle();
     }
 
@@ -382,15 +405,14 @@ public class AlbumBrowserActivity extends ListActivity
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
         super.onCreateOptionsMenu(menu);
-        menu.add(0, GOTO_START, 0, R.string.goto_start).setIcon(R.drawable.ic_menu_music_library);
-        menu.add(0, GOTO_PLAYBACK, 0, R.string.goto_playback).setIcon(R.drawable.ic_menu_playback);
+        menu.add(0, PARTY_SHUFFLE, 0, R.string.party_shuffle); // icon will be set in onPrepareOptionsMenu()
         menu.add(0, SHUFFLE_ALL, 0, R.string.shuffle_all).setIcon(R.drawable.ic_menu_shuffle);
         return true;
     }
 
     @Override
     public boolean onPrepareOptionsMenu(Menu menu) {
-        menu.findItem(GOTO_PLAYBACK).setVisible(MusicUtils.isMusicLoaded());
+        MusicUtils.setPartyShuffleMenuIcon(menu);
         return super.onPrepareOptionsMenu(menu);
     }
 
@@ -399,17 +421,9 @@ public class AlbumBrowserActivity extends ListActivity
         Intent intent;
         Cursor cursor;
         switch (item.getItemId()) {
-            case GOTO_START:
-                intent = new Intent();
-                intent.setClass(this, MusicBrowserActivity.class);
-                intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
-                startActivity(intent);
-                return true;
-
-            case GOTO_PLAYBACK:
-                intent = new Intent("com.android.music.PLAYBACK_VIEWER");
-                startActivity(intent);
-                return true;
+            case PARTY_SHUFFLE:
+                MusicUtils.togglePartyShuffle();
+                break;
 
             case SHUFFLE_ALL:
                 cursor = MusicUtils.query(this, MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
@@ -657,5 +671,13 @@ public class AlbumBrowserActivity extends ListActivity
 
     private Cursor mAlbumCursor;
     private String mArtistId;
+
+    public void onServiceConnected(ComponentName name, IBinder service) {
+        MusicUtils.updateNowPlaying(this);
+    }
+
+    public void onServiceDisconnected(ComponentName name) {
+        finish();
+    }
 }
 
index 9aa42b4..11ea0c3 100644 (file)
@@ -22,10 +22,12 @@ import android.app.ExpandableListActivity;
 import android.app.SearchManager;
 import android.content.AsyncQueryHandler;
 import android.content.BroadcastReceiver;
+import android.content.ComponentName;
 import android.content.ContentResolver;
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
+import android.content.ServiceConnection;
 import android.content.res.Resources;
 import android.database.Cursor;
 import android.database.CursorWrapper;
@@ -36,9 +38,13 @@ import android.media.MediaFile;
 import android.net.Uri;
 import android.os.Bundle;
 import android.os.Handler;
+import android.os.IBinder;
 import android.os.Message;
+import android.os.Parcel;
+import android.os.Parcelable;
 import android.provider.MediaStore;
 import android.util.Log;
+import android.util.SparseArray;
 import android.view.ContextMenu;
 import android.view.Menu;
 import android.view.MenuItem;
@@ -47,9 +53,6 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.view.Window;
 import android.view.ContextMenu.ContextMenuInfo;
-import android.widget.CursorAdapter;
-import android.widget.CursorTreeAdapter;
-import android.widget.ExpandableListAdapter;
 import android.widget.ExpandableListView;
 import android.widget.ImageView;
 import android.widget.SectionIndexer;
@@ -61,7 +64,7 @@ import java.text.Collator;
 
 
 public class ArtistAlbumBrowserActivity extends ExpandableListActivity
-        implements View.OnCreateContextMenuListener, MusicUtils.Defs
+        implements View.OnCreateContextMenuListener, MusicUtils.Defs, ServiceConnection
 {
     private String mCurrentArtistId;
     private String mCurrentArtistName;
@@ -73,16 +76,15 @@ public class ArtistAlbumBrowserActivity extends ExpandableListActivity
     private ArtistAlbumListAdapter mAdapter;
     private boolean mAdapterSent;
     private final static int SEARCH = CHILD_MENU_BASE;
-
-    public ArtistAlbumBrowserActivity()
-    {
-    }
+    private static int mLastListPosCourse = -1;
+    private static int mLastListPosFine = -1;
 
     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
         requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
+        requestWindowFeature(Window.FEATURE_NO_TITLE);
         setVolumeControlStream(AudioManager.STREAM_MUSIC);
         if (icicle != null) {
             mCurrentAlbumId = icicle.getString("selectedalbum");
@@ -90,7 +92,7 @@ public class ArtistAlbumBrowserActivity extends ExpandableListActivity
             mCurrentArtistId = icicle.getString("selectedartist");
             mCurrentArtistName = icicle.getString("selectedartistname");
         }
-        MusicUtils.bindToService(this);
+        MusicUtils.bindToService(this, this);
 
         IntentFilter f = new IntentFilter();
         f.addAction(Intent.ACTION_MEDIA_SCANNER_STARTED);
@@ -100,8 +102,8 @@ public class ArtistAlbumBrowserActivity extends ExpandableListActivity
         registerReceiver(mScanListener, f);
 
         setContentView(R.layout.media_picker_activity_expanding);
+        MusicUtils.updateButtonBar(this, R.id.artisttab);
         ExpandableListView lv = getExpandableListView();
-        lv.setFastScrollEnabled(true);
         lv.setOnCreateContextMenuListener(this);
         lv.setTextFilterEnabled(true);
 
@@ -153,6 +155,15 @@ public class ArtistAlbumBrowserActivity extends ExpandableListActivity
 
     @Override
     public void onDestroy() {
+        ExpandableListView lv = getExpandableListView();
+        if (lv != null) {
+            mLastListPosCourse = lv.getFirstVisiblePosition();
+            View cv = lv.getChildAt(0);
+            if (cv != null) {
+                mLastListPosFine = cv.getTop();
+            }
+        }
+        
         MusicUtils.unbindFromService(this);
         if (!mAdapterSent) {
             Cursor c = mAdapter.getCursor();
@@ -186,6 +197,7 @@ public class ArtistAlbumBrowserActivity extends ExpandableListActivity
         @Override
         public void onReceive(Context context, Intent intent) {
             getExpandableListView().invalidateViews();
+            MusicUtils.updateNowPlaying(ArtistAlbumBrowserActivity.this);
         }
     };
     private BroadcastReceiver mScanListener = new BroadcastReceiver() {
@@ -229,7 +241,15 @@ public class ArtistAlbumBrowserActivity extends ExpandableListActivity
             return;
         }
 
+        // restore previous position
+        if (mLastListPosCourse >= 0) {
+            ExpandableListView elv = getExpandableListView();
+            elv.setSelectionFromTop(mLastListPosCourse, mLastListPosFine);
+            mLastListPosCourse = -1;
+        }
+
         MusicUtils.hideDatabaseError(this);
+        MusicUtils.updateButtonBar(this, R.id.artisttab);
         setTitle();
     }
 
@@ -260,15 +280,14 @@ public class ArtistAlbumBrowserActivity extends ExpandableListActivity
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
         super.onCreateOptionsMenu(menu);
-        menu.add(0, GOTO_START, 0, R.string.goto_start).setIcon(R.drawable.ic_menu_music_library);
-        menu.add(0, GOTO_PLAYBACK, 0, R.string.goto_playback).setIcon(R.drawable.ic_menu_playback);
+        menu.add(0, PARTY_SHUFFLE, 0, R.string.party_shuffle); // icon will be set in onPrepareOptionsMenu()
         menu.add(0, SHUFFLE_ALL, 0, R.string.shuffle_all).setIcon(R.drawable.ic_menu_shuffle);
         return true;
     }
     
     @Override
     public boolean onPrepareOptionsMenu(Menu menu) {
-        menu.findItem(GOTO_PLAYBACK).setVisible(MusicUtils.isMusicLoaded());
+        MusicUtils.setPartyShuffleMenuIcon(menu);
         return super.onPrepareOptionsMenu(menu);
     }
 
@@ -277,17 +296,9 @@ public class ArtistAlbumBrowserActivity extends ExpandableListActivity
         Intent intent;
         Cursor cursor;
         switch (item.getItemId()) {
-            case GOTO_START:
-                intent = new Intent();
-                intent.setClass(this, MusicBrowserActivity.class);
-                intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
-                startActivity(intent);
-                return true;
-
-            case GOTO_PLAYBACK:
-                intent = new Intent("com.android.music.PLAYBACK_VIEWER");
-                startActivity(intent);
-                return true;
+            case PARTY_SHUFFLE:
+                MusicUtils.togglePartyShuffle();
+                break;
                 
             case SHUFFLE_ALL:
                 cursor = MusicUtils.query(this, MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
@@ -843,5 +854,13 @@ public class ArtistAlbumBrowserActivity extends ExpandableListActivity
     }
     
     private Cursor mArtistCursor;
+
+    public void onServiceConnected(ComponentName name, IBinder service) {
+        MusicUtils.updateNowPlaying(this);
+    }
+
+    public void onServiceDisconnected(ComponentName name) {
+        finish();
+    }
 }
 
index 8347164..5e5b715 100644 (file)
@@ -162,7 +162,7 @@ public class MediaAppWidgetProvider extends AppWidgetProvider {
      * Link up various button actions using {@link PendingIntents}.
      * 
      * @param playerActive True if player is active in background, which means
-     *            widget click will launch {@link MediaPlaybackActivity},
+     *            widget click will launch {@link MediaPlaybackActivityStarter},
      *            otherwise we launch {@link MusicBrowserActivity}.
      */
     private void linkButtons(Context context, RemoteViews views, boolean playerActive) {
@@ -173,7 +173,7 @@ public class MediaAppWidgetProvider extends AppWidgetProvider {
         final ComponentName serviceName = new ComponentName(context, MediaPlaybackService.class);
         
         if (playerActive) {
-            intent = new Intent(context, MediaPlaybackActivity.class);
+            intent = new Intent(context, MediaPlaybackActivityStarter.class);
             pendingIntent = PendingIntent.getActivity(context,
                     0 /* no requestCode */, intent, 0 /* no flags */);
             views.setOnClickPendingIntent(R.id.album_appwidget, pendingIntent);
index f01b808..021a199 100644 (file)
@@ -102,7 +102,6 @@ public class MediaPlaybackActivity extends Activity implements MusicUtils.Defs,
         mAlbumArtHandler = new AlbumArtHandler(mAlbumArtWorker.getLooper());
 
         requestWindowFeature(Window.FEATURE_NO_TITLE);
-        getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
         setContentView(R.layout.audio_player);
 
         mCurrentTime = (TextView) findViewById(R.id.currenttime);
@@ -574,9 +573,8 @@ public class MediaPlaybackActivity extends Activity implements MusicUtils.Defs,
                 case GOTO_START:
                     intent = new Intent();
                     intent.setClass(this, MusicBrowserActivity.class);
-                    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK
-                            | Intent.FLAG_ACTIVITY_CLEAR_TOP);
                     startActivity(intent);
+                    finish();
                     break;
                 case USE_AS_RINGTONE: {
                     // Set the system setting to make this the current ringtone
@@ -586,14 +584,7 @@ public class MediaPlaybackActivity extends Activity implements MusicUtils.Defs,
                     return true;
                 }
                 case PARTY_SHUFFLE:
-                    if (mService != null) {
-                        int shuffle = mService.getShuffleMode();
-                        if (shuffle == MediaPlaybackService.SHUFFLE_AUTO) {
-                            mService.setShuffleMode(MediaPlaybackService.SHUFFLE_NONE);
-                        } else {
-                            mService.setShuffleMode(MediaPlaybackService.SHUFFLE_AUTO);
-                        }
-                    }
+                    MusicUtils.togglePartyShuffle();
                     setShuffleButtonImage();
                     break;
                     
diff --git a/src/com/android/music/MediaPlaybackActivityStarter.java b/src/com/android/music/MediaPlaybackActivityStarter.java
new file mode 100644 (file)
index 0000000..248a5f1
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.music;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+
+public class MediaPlaybackActivityStarter extends Activity
+{
+    public MediaPlaybackActivityStarter()
+    {
+    }
+
+    @Override
+    public void onCreate(Bundle icicle)
+    {
+        super.onCreate(icicle);
+        Intent i = new Intent(getIntent());
+        i.setClass(this, MediaPlaybackActivity.class);
+        startActivity(i);
+        finish();
+    }
+    
+
+}
+
index 09edf52..85bb797 100644 (file)
@@ -303,7 +303,7 @@ public class MediaPlaybackService extends Service {
     public void onDestroy() {
         // Check that we're not being destroyed while something is still playing.
         if (isPlaying()) {
-            Log.e("MediaPlaybackService", "Service being destroyed while still playing.");
+            Log.e(LOGTAG, "Service being destroyed while still playing.");
         }
         // release all MediaPlayer resources, including the native player and wakelocks
         mPlayer.release();
@@ -492,6 +492,9 @@ public class MediaPlaybackService extends Service {
             
             long seekpos = mPreferences.getLong("seekpos", 0);
             seek(seekpos >= 0 && seekpos < duration() ? seekpos : 0);
+            Log.d(LOGTAG, "restored queue, currently at position "
+                    + position() + "/" + duration()
+                    + " (requested " + seekpos + ")");
             
             int repmode = mPreferences.getInt("repeatmode", REPEAT_NONE);
             if (repmode != REPEAT_ALL && repmode != REPEAT_CURRENT) {
@@ -572,7 +575,12 @@ public class MediaPlaybackService extends Service {
             if (CMDNEXT.equals(cmd) || NEXT_ACTION.equals(action)) {
                 next(true);
             } else if (CMDPREVIOUS.equals(cmd) || PREVIOUS_ACTION.equals(action)) {
-                prev();
+                if (position() < 2000) {
+                    prev();
+                } else {
+                    seek(0);
+                    play();
+                }
             } else if (CMDTOGGLEPAUSE.equals(cmd) || TOGGLEPAUSE_ACTION.equals(action)) {
                 if (isPlaying()) {
                     pause();
@@ -1015,6 +1023,7 @@ public class MediaPlaybackService extends Service {
                     if (!mQuietMode) {
                         Toast.makeText(this, R.string.playback_failed, Toast.LENGTH_SHORT).show();
                     }
+                    Log.d(LOGTAG, "Failed to open file for playback");
                 }
             } else {
                 mOpenFailedCounter = 0;
@@ -1063,7 +1072,8 @@ public class MediaPlaybackService extends Service {
             status.flags |= Notification.FLAG_ONGOING_EVENT;
             status.icon = R.drawable.stat_notify_musicplayer;
             status.contentIntent = PendingIntent.getActivity(this, 0,
-                    new Intent("com.android.music.PLAYBACK_VIEWER"), 0);
+                    new Intent("com.android.music.PLAYBACK_VIEWER")
+                    .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK), 0);
             startForeground(PLAYBACKSERVICE_STATUS, status);
             if (!mIsSupposedToBePlaying) {
                 mIsSupposedToBePlaying = true;
@@ -1194,6 +1204,7 @@ public class MediaPlaybackService extends Service {
             }
 
             if (mPlayListLen <= 0) {
+                Log.d(LOGTAG, "No play queue");
                 return;
             }
 
@@ -1543,6 +1554,9 @@ public class MediaPlaybackService extends Service {
             openCurrent();
             play();
             notifyChange(META_CHANGED);
+            if (mShuffleMode == SHUFFLE_AUTO) {
+                doAutoShuffleUpdate();
+            }
         }
     }
 
@@ -1767,6 +1781,7 @@ public class MediaPlaybackService extends Service {
                     mHandler.sendMessageDelayed(mHandler.obtainMessage(SERVER_DIED), 2000);
                     return true;
                 default:
+                    Log.d("MultiPlayer", "Error: " + what + "," + extra);
                     break;
                 }
                 return false;
index 8208771..3554234 100644 (file)
@@ -24,6 +24,7 @@ import android.content.Context;
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.content.ServiceConnection;
+import android.content.SharedPreferences;
 import android.graphics.drawable.Drawable;
 import android.media.AudioManager;
 import android.media.MediaFile;
@@ -42,12 +43,7 @@ import android.widget.ImageButton;
 import android.widget.TextView;
 
 public class MusicBrowserActivity extends Activity
-    implements MusicUtils.Defs, View.OnClickListener {
-    private View mNowPlayingView;
-    private TextView mTitle;
-    private TextView mArtist;
-    private boolean mAutoShuffle = false;
-    private static final int SEARCH_MUSIC = CHILD_MENU_BASE;
+    implements MusicUtils.Defs {
 
     public MusicBrowserActivity() {
     }
@@ -58,23 +54,19 @@ public class MusicBrowserActivity extends Activity
     @Override
     public void onCreate(Bundle icicle) {
         super.onCreate(icicle);
-        setVolumeControlStream(AudioManager.STREAM_MUSIC);
+        int activeTab = MusicUtils.getIntPref(this, "activetab", R.id.artisttab);
+        if (activeTab != R.id.artisttab
+                && activeTab != R.id.albumtab
+                && activeTab != R.id.songtab
+                && activeTab != R.id.playlisttab) {
+            activeTab = R.id.artisttab;
+        }
+        MusicUtils.activateTab(this, activeTab);
+        
         String shuf = getIntent().getStringExtra("autoshuffle");
         if ("true".equals(shuf)) {
-            mAutoShuffle = true;
+            bindService((new Intent()).setClass(this, MediaPlaybackService.class), autoshuffle, 0);
         }
-        MusicUtils.bindToService(this, new ServiceConnection() {
-            public void onServiceConnected(ComponentName classname, IBinder obj) {
-                updateMenu();
-            }
-
-            public void onServiceDisconnected(ComponentName classname) {
-                updateMenu();
-            }
-        
-        });
-        setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
-        init();
     }
 
     @Override
@@ -83,138 +75,6 @@ public class MusicBrowserActivity extends Activity
         super.onDestroy();
     }
 
-    public void init() {
-        setContentView(R.layout.music_library);
-        mNowPlayingView = findViewById(R.id.nowplaying);
-        mTitle = (TextView) mNowPlayingView.findViewById(R.id.title);
-        mArtist = (TextView) mNowPlayingView.findViewById(R.id.artist);
-        
-        View b = (View) findViewById(R.id.browse_button); 
-        b.setOnClickListener(this);
-        
-        b = (View) findViewById(R.id.albums_button);
-        b.setOnClickListener(this);
-
-        b = (View) findViewById(R.id.tracks_button);
-        b.setOnClickListener(this);
-
-        b = (View) findViewById(R.id.playlists_button);
-        b.setOnClickListener(this);
-    }
-    
-    private void updateMenu() {
-        try {
-            if (MusicUtils.sService != null && MusicUtils.sService.getAudioId() != -1) {
-                makeNowPlayingView();
-                mNowPlayingView.setVisibility(View.VISIBLE);
-                return;
-            }
-        } catch (RemoteException ex) {
-        }
-        mNowPlayingView.setVisibility(View.INVISIBLE);
-    }
-
-    @Override
-    public void onResume() {
-        super.onResume();
-        IntentFilter f = new IntentFilter();
-        f.addAction(MediaPlaybackService.META_CHANGED);
-        registerReceiver(mStatusListener, new IntentFilter(f));
-        updateMenu();
-        if (mAutoShuffle) {
-            mAutoShuffle = false;
-            doAutoShuffle();
-        }
-    }
-    
-    @Override
-    public void onPause() {
-        super.onPause();
-        unregisterReceiver(mStatusListener);
-    }
-
-    @Override
-    public boolean onCreateOptionsMenu(Menu menu) {
-        super.onCreateOptionsMenu(menu);
-         menu.add(0, PARTY_SHUFFLE, 0, R.string.party_shuffle); // icon will be set in onPrepareOptionsMenu()
-         menu.add(0, SEARCH_MUSIC, 0, R.string.search_title).setIcon(android.R.drawable.ic_menu_search);
-        return true;
-    }
-
-    @Override
-    public boolean onPrepareOptionsMenu(Menu menu) {
-        MenuItem item = menu.findItem(PARTY_SHUFFLE);
-        if (item != null) {
-            int shuffle = MusicUtils.getCurrentShuffleMode();
-            if (shuffle == MediaPlaybackService.SHUFFLE_AUTO) {
-                item.setIcon(R.drawable.ic_menu_party_shuffle);
-                item.setTitle(R.string.party_shuffle_off);
-            } else {
-                item.setIcon(R.drawable.ic_menu_party_shuffle);
-                item.setTitle(R.string.party_shuffle);
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public boolean onOptionsItemSelected(MenuItem item) {
-        Intent intent;
-        try {
-            switch (item.getItemId()) {
-                case PARTY_SHUFFLE:
-                    int shuffle = MusicUtils.sService.getShuffleMode();
-                    if (shuffle == MediaPlaybackService.SHUFFLE_AUTO) {
-                        MusicUtils.sService.setShuffleMode(MediaPlaybackService.SHUFFLE_NONE);
-                    } else {
-                        MusicUtils.sService.setShuffleMode(MediaPlaybackService.SHUFFLE_AUTO);
-                    }
-                    break;
-                    
-                case SEARCH_MUSIC: {
-                    startSearch("", false, null, false);
-                    return true;
-                }
-            }
-        } catch (RemoteException ex) {
-        }
-        return super.onOptionsItemSelected(item);
-    }
-    
-    public void onClick(View v) {
-        Intent intent;
-        switch (v.getId()) {
-            case R.id.browse_button:
-                intent = new Intent(Intent.ACTION_PICK);
-                intent.setDataAndType(Uri.EMPTY, "vnd.android.cursor.dir/artistalbum");
-                startActivity(intent);
-                break;
-            case R.id.albums_button:
-                intent = new Intent(Intent.ACTION_PICK);
-                intent.setDataAndType(Uri.EMPTY, "vnd.android.cursor.dir/album");
-                startActivity(intent);
-                break;
-            case R.id.tracks_button:
-                intent = new Intent(Intent.ACTION_PICK);
-                intent.setDataAndType(Uri.EMPTY, "vnd.android.cursor.dir/track");
-                startActivity(intent);
-                break;
-            case R.id.playlists_button:
-                intent = new Intent(Intent.ACTION_PICK);
-                intent.setDataAndType(Uri.EMPTY, MediaStore.Audio.Playlists.CONTENT_TYPE);
-                startActivity(intent);
-                break;
-            case R.id.nowplaying:
-                intent = new Intent("com.android.music.PLAYBACK_VIEWER");
-                startActivity(intent);
-                break;
-        }
-    }
-
-    private void doAutoShuffle() {
-        bindService((new Intent()).setClass(this, MediaPlaybackService.class), autoshuffle, 0);
-    }
-
     private ServiceConnection autoshuffle = new ServiceConnection() {
         public void onServiceConnected(ComponentName classname, IBinder obj) {
             // we need to be able to bind again, so unbind
@@ -226,7 +86,6 @@ public class MusicBrowserActivity extends Activity
             if (serv != null) {
                 try {
                     serv.setShuffleMode(MediaPlaybackService.SHUFFLE_AUTO);
-                    updateMenu();
                 } catch (RemoteException ex) {
                 }
             }
@@ -236,46 +95,5 @@ public class MusicBrowserActivity extends Activity
         }
     };
 
-    private void makeNowPlayingView() {
-        try {
-            mTitle.setText(MusicUtils.sService.getTrackName());
-            String artistName = MusicUtils.sService.getArtistName();
-            if (MediaFile.UNKNOWN_STRING.equals(artistName)) {
-                artistName = getString(R.string.unknown_artist_name);
-            }
-            mArtist.setText(artistName);
-            mNowPlayingView.setOnFocusChangeListener(mFocuser);
-            mNowPlayingView.setOnClickListener(this);
-        } catch (RemoteException ex) {
-
-        }
-    }
-
-    View.OnFocusChangeListener mFocuser = new View.OnFocusChangeListener() {
-        Drawable mBack;
-
-        public void onFocusChange(View v, boolean hasFocus) {
-            if (hasFocus) {
-                if (mBack == null) {
-                    mBack = mNowPlayingView.getBackground();
-                }
-                Drawable dr = getResources().getDrawable(android.R.drawable.menuitem_background);
-                dr.setState(new int[] { android.R.attr.state_focused});
-                mNowPlayingView.setBackgroundDrawable(dr);
-                mNowPlayingView.setSelected(true);
-            } else {
-                mNowPlayingView.setBackgroundDrawable(mBack);
-                mNowPlayingView.setSelected(false);
-            }
-        }
-    };
-
-    private BroadcastReceiver mStatusListener = new BroadcastReceiver() {
-        @Override
-        public void onReceive(Context context, Intent intent) {
-            // this receiver is only used for META_CHANGED events
-            updateMenu();
-        }
-    };
 }
 
index cdc7251..d1aea06 100644 (file)
@@ -32,9 +32,14 @@ import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
 import android.graphics.Canvas;
 import android.graphics.ColorFilter;
+import android.graphics.ColorMatrix;
+import android.graphics.ColorMatrixColorFilter;
+import android.graphics.Matrix;
+import android.graphics.Paint;
 import android.graphics.PixelFormat;
 import android.graphics.drawable.BitmapDrawable;
 import android.graphics.drawable.Drawable;
+import android.media.MediaFile;
 import android.net.Uri;
 import android.os.Environment;
 import android.os.ParcelFileDescriptor;
@@ -43,9 +48,13 @@ import android.provider.MediaStore;
 import android.provider.Settings;
 import android.text.TextUtils;
 import android.util.Log;
+import android.view.Menu;
+import android.view.MenuItem;
 import android.view.SubMenu;
 import android.view.View;
+import android.view.ViewGroup;
 import android.view.Window;
+import android.widget.TabWidget;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -231,6 +240,34 @@ public class MusicUtils {
         return mode;
     }
     
+    public static void togglePartyShuffle() {
+        if (sService != null) {
+            int shuffle = getCurrentShuffleMode();
+            try {
+                if (shuffle == MediaPlaybackService.SHUFFLE_AUTO) {
+                    sService.setShuffleMode(MediaPlaybackService.SHUFFLE_NONE);
+                } else {
+                    sService.setShuffleMode(MediaPlaybackService.SHUFFLE_AUTO);
+                }
+            } catch (RemoteException ex) {
+            }
+        }
+    }
+    
+    public static void setPartyShuffleMenuIcon(Menu menu) {
+        MenuItem item = menu.findItem(Defs.PARTY_SHUFFLE);
+        if (item != null) {
+            int shuffle = MusicUtils.getCurrentShuffleMode();
+            if (shuffle == MediaPlaybackService.SHUFFLE_AUTO) {
+                item.setIcon(R.drawable.ic_menu_party_shuffle);
+                item.setTitle(R.string.party_shuffle_off);
+            } else {
+                item.setIcon(R.drawable.ic_menu_party_shuffle);
+                item.setTitle(R.string.party_shuffle);
+            }
+        }
+    }
+    
     /*
      * Returns true if a file is currently opened for playback (regardless
      * of whether it's playing or paused).
@@ -602,6 +639,10 @@ public class MusicUtils {
         if (v != null) {
             v.setVisibility(View.GONE);
         }
+        v = a.findViewById(R.id.buttonbar);
+        if (v != null) {
+            v.setVisibility(View.GONE);
+        }
         TextView tv = (TextView) a.findViewById(R.id.sd_message);
         tv.setText(message);
     }
@@ -709,7 +750,7 @@ public class MusicUtils {
             sService.play();
         } catch (RemoteException ex) {
         } finally {
-            Intent intent = new Intent("com.android.music.PLAYBACK_VIEWER")
+            Intent intent = new Intent(context, MediaPlaybackActivity.class)
                 .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
             context.startActivity(intent);
         }
@@ -866,11 +907,20 @@ public class MusicUtils {
         }
         return null;
     }
-    
+
     /** Get album art for specified album. You should not pass in the album id
      * for the "unknown" album here (use -1 instead)
+     * This method always returns the default album art icon when no album art is found.
      */
     public static Bitmap getArtwork(Context context, long song_id, long album_id) {
+        return getArtwork(context, song_id, album_id, true);
+    }
+
+    /** Get album art for specified album. You should not pass in the album id
+     * for the "unknown" album here (use -1 instead)
+     */
+    public static Bitmap getArtwork(Context context, long song_id, long album_id,
+            boolean allowdefault) {
 
         if (album_id < 0) {
             // This is something that is not in the database, so get the album art directly
@@ -881,7 +931,10 @@ public class MusicUtils {
                     return bm;
                 }
             }
-            return getDefaultArtwork(context);
+            if (allowdefault) {
+                return getDefaultArtwork(context);
+            }
+            return null;
         }
 
         ContentResolver res = context.getContentResolver();
@@ -898,11 +951,11 @@ public class MusicUtils {
                 if (bm != null) {
                     if (bm.getConfig() == null) {
                         bm = bm.copy(Bitmap.Config.RGB_565, false);
-                        if (bm == null) {
+                        if (bm == null && allowdefault) {
                             return getDefaultArtwork(context);
                         }
                     }
-                } else {
+                } else if (allowdefault) {
                     bm = getDefaultArtwork(context);
                 }
                 return bm;
@@ -1014,4 +1067,170 @@ public class MusicUtils {
             }
         }
     }
+    
+    static int sActiveTabIndex = -1;
+    
+    static boolean updateButtonBar(Activity a, int highlight) {
+        final TabWidget ll = (TabWidget) a.findViewById(R.id.buttonbar);
+        boolean withtabs = false;
+        Intent intent = a.getIntent();
+        if (intent != null) {
+            withtabs = intent.getBooleanExtra("withtabs", false);
+        }
+        
+        if (highlight == 0 || !withtabs) {
+            ll.setVisibility(View.GONE);
+            return withtabs;
+        } else if (withtabs) {
+            ll.setVisibility(View.VISIBLE);
+        }
+        for (int i = ll.getChildCount() - 1; i >= 0; i--) {
+            
+            View v = ll.getChildAt(i);
+            boolean isActive = (v.getId() == highlight);
+            if (isActive) {
+                ll.setCurrentTab(i);
+                sActiveTabIndex = i;
+            }
+            v.setTag(i);
+            v.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+
+                public void onFocusChange(View v, boolean hasFocus) {
+                    if (hasFocus) {
+                        for (int i = 0; i < ll.getTabCount(); i++) {
+                            if (ll.getChildTabViewAt(i) == v) {
+                                ll.setCurrentTab(i);
+                                processTabClick((Activity)ll.getContext(), v, ll.getChildAt(sActiveTabIndex).getId());
+                                break;
+                            }
+                        }
+                    }
+                }});
+            
+            v.setOnClickListener(new View.OnClickListener() {
+
+                public void onClick(View v) {
+                    processTabClick((Activity)ll.getContext(), v, ll.getChildAt(sActiveTabIndex).getId());
+                }});
+        }
+        return withtabs;
+    }
+
+    static void processTabClick(Activity a, View v, int current) {
+        int id = v.getId();
+        if (id == current) {
+            return;
+        }
+
+        final TabWidget ll = (TabWidget) a.findViewById(R.id.buttonbar);
+        ll.setCurrentTab((Integer) v.getTag());
+
+        activateTab(a, id);
+        if (id != R.id.nowplayingtab) {
+            setIntPref(a, "activetab", id);
+        }
+    }
+    
+    static void activateTab(Activity a, int id) {
+        Intent intent = new Intent(Intent.ACTION_PICK);
+        switch (id) {
+            case R.id.artisttab:
+                intent.setDataAndType(Uri.EMPTY, "vnd.android.cursor.dir/artistalbum");
+                break;
+            case R.id.albumtab:
+                intent.setDataAndType(Uri.EMPTY, "vnd.android.cursor.dir/album");
+                break;
+            case R.id.songtab:
+                intent.setDataAndType(Uri.EMPTY, "vnd.android.cursor.dir/track");
+                break;
+            case R.id.playlisttab:
+                intent.setDataAndType(Uri.EMPTY, MediaStore.Audio.Playlists.CONTENT_TYPE);
+                break;
+            case R.id.nowplayingtab:
+                intent = new Intent(a, MediaPlaybackActivity.class);
+                a.startActivity(intent);
+                // fall through and return
+            default:
+                return;
+        }
+        intent.putExtra("withtabs", true);
+        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+        a.startActivity(intent);
+        a.finish();
+        a.overridePendingTransition(0, 0);
+    }
+    
+    static void updateNowPlaying(Activity a) {
+        View nowPlayingView = a.findViewById(R.id.nowplaying);
+        if (nowPlayingView == null) {
+            return;
+        }
+        try {
+            boolean withtabs = false;
+            Intent intent = a.getIntent();
+            if (intent != null) {
+                withtabs = intent.getBooleanExtra("withtabs", false);
+            }
+            if (true && MusicUtils.sService != null && MusicUtils.sService.getAudioId() != -1) {
+                TextView title = (TextView) nowPlayingView.findViewById(R.id.title);
+                TextView artist = (TextView) nowPlayingView.findViewById(R.id.artist);
+                title.setText(MusicUtils.sService.getTrackName());
+                String artistName = MusicUtils.sService.getArtistName();
+                if (MediaFile.UNKNOWN_STRING.equals(artistName)) {
+                    artistName = a.getString(R.string.unknown_artist_name);
+                }
+                artist.setText(artistName);
+                //mNowPlayingView.setOnFocusChangeListener(mFocuser);
+                //mNowPlayingView.setOnClickListener(this);
+                nowPlayingView.setVisibility(View.VISIBLE);
+                nowPlayingView.setOnClickListener(new View.OnClickListener() {
+
+                    public void onClick(View v) {
+                        Context c = v.getContext();
+                        c.startActivity(new Intent(c, MediaPlaybackActivity.class));
+                    }});
+                return;
+            }
+        } catch (RemoteException ex) {
+        }
+        nowPlayingView.setVisibility(View.GONE);
+    }
+
+    static void setBackground(View v, Bitmap bm) {
+
+        if (bm == null) {
+            v.setBackgroundResource(0);
+            return;
+        }
+
+        int vwidth = v.getWidth();
+        int vheight = v.getHeight();
+        int bwidth = bm.getWidth();
+        int bheight = bm.getHeight();
+        float scalex = (float) vwidth / bwidth;
+        float scaley = (float) vheight / bheight;
+        float scale = Math.max(scalex, scaley) * 1.3f;
+
+        Bitmap.Config config = Bitmap.Config.ARGB_8888;
+        Bitmap bg = Bitmap.createBitmap(vwidth, vheight, config);
+        Canvas c = new Canvas(bg);
+        Paint paint = new Paint();
+        paint.setAntiAlias(true);
+        paint.setFilterBitmap(true);
+        ColorMatrix greymatrix = new ColorMatrix();
+        greymatrix.setSaturation(0);
+        ColorMatrix darkmatrix = new ColorMatrix();
+        darkmatrix.setScale(.3f, .3f, .3f, 1.0f);
+        greymatrix.postConcat(darkmatrix);
+        ColorFilter filter = new ColorMatrixColorFilter(greymatrix);
+        paint.setColorFilter(filter);
+        Matrix matrix = new Matrix();
+        matrix.setTranslate(-bwidth/2, -bheight/2); // move bitmap center to origin
+        matrix.postRotate(10);
+        matrix.postScale(scale, scale);
+        matrix.postTranslate(vwidth/2, vheight/2);  // Move bitmap center to view center
+        c.drawBitmap(bm, matrix, paint);
+        v.setBackgroundDrawable(new BitmapDrawable(bg));
+    }
+
 }
index ccdb529..447c75b 100644 (file)
@@ -70,6 +70,8 @@ public class PlaylistBrowserActivity extends ListActivity
     private static final long PODCASTS_PLAYLIST = -3;
     private PlaylistListAdapter mAdapter;
     boolean mAdapterSent;
+    private static int mLastListPosCourse = -1;
+    private static int mLastListPosFine = -1;
 
     private boolean mCreateShortcut;
 
@@ -90,6 +92,7 @@ public class PlaylistBrowserActivity extends ListActivity
         }
 
         requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
+        requestWindowFeature(Window.FEATURE_NO_TITLE);
         setVolumeControlStream(AudioManager.STREAM_MUSIC);
         MusicUtils.bindToService(this, new ServiceConnection() {
             public void onServiceConnected(ComponentName classname, IBinder obj) {
@@ -108,7 +111,9 @@ public class PlaylistBrowserActivity extends ListActivity
                         MusicUtils.playPlaylist(PlaylistBrowserActivity.this, id);
                     }
                     finish();
+                    return;
                 }
+                MusicUtils.updateNowPlaying(PlaylistBrowserActivity.this);
             }
 
             public void onServiceDisconnected(ComponentName classname) {
@@ -123,6 +128,7 @@ public class PlaylistBrowserActivity extends ListActivity
         registerReceiver(mScanListener, f);
 
         setContentView(R.layout.media_picker_activity);
+        MusicUtils.updateButtonBar(this, R.id.playlisttab);
         ListView lv = getListView();
         lv.setOnCreateContextMenuListener(this);
         lv.setTextFilterEnabled(true);
@@ -168,6 +174,14 @@ public class PlaylistBrowserActivity extends ListActivity
     
     @Override
     public void onDestroy() {
+        ListView lv = getListView();
+        if (lv != null) {
+            mLastListPosCourse = lv.getFirstVisiblePosition();
+            View cv = lv.getChildAt(0);
+            if (cv != null) {
+                mLastListPosFine = cv.getTop();
+            }
+        }
         MusicUtils.unbindFromService(this);
         if (!mAdapterSent) {
             Cursor c = mAdapter.getCursor();
@@ -189,6 +203,7 @@ public class PlaylistBrowserActivity extends ListActivity
         super.onResume();
 
         MusicUtils.setSpinnerState(this);
+        MusicUtils.updateNowPlaying(PlaylistBrowserActivity.this);
     }
     @Override
     public void onPause() {
@@ -225,7 +240,13 @@ public class PlaylistBrowserActivity extends ListActivity
             return;
         }
 
+        // restore previous position
+        if (mLastListPosCourse >= 0) {
+            getListView().setSelectionFromTop(mLastListPosCourse, mLastListPosFine);
+            mLastListPosCourse = -1;
+        }
         MusicUtils.hideDatabaseError(this);
+        MusicUtils.updateButtonBar(this, R.id.playlisttab);
         setTitle();
     }
 
@@ -236,29 +257,24 @@ public class PlaylistBrowserActivity extends ListActivity
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
         if (!mCreateShortcut) {
-            menu.add(0, GOTO_START, 0, R.string.goto_start).setIcon(
-                    R.drawable.ic_menu_music_library);
-            menu.add(0, GOTO_PLAYBACK, 0, R.string.goto_playback).setIcon(
-                    R.drawable.ic_menu_playback).setVisible(MusicUtils.isMusicLoaded());
+            menu.add(0, PARTY_SHUFFLE, 0, R.string.party_shuffle); // icon will be set in onPrepareOptionsMenu()
         }
         return super.onCreateOptionsMenu(menu);
     }
 
     @Override
+    public boolean onPrepareOptionsMenu(Menu menu) {
+        MusicUtils.setPartyShuffleMenuIcon(menu);
+        return super.onPrepareOptionsMenu(menu);
+    }
+
+    @Override
     public boolean onOptionsItemSelected(MenuItem item) {
         Intent intent;
         switch (item.getItemId()) {
-            case GOTO_START:
-                intent = new Intent();
-                intent.setClass(this, MusicBrowserActivity.class);
-                intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
-                startActivity(intent);
-                return true;
-
-            case GOTO_PLAYBACK:
-                intent = new Intent("com.android.music.PLAYBACK_VIEWER");
-                startActivity(intent);
-                return true;
+            case PARTY_SHUFFLE:
+                MusicUtils.togglePartyShuffle();
+                break;
         }
         return super.onOptionsItemSelected(item);
     }
index 078b17c..f972892 100644 (file)
@@ -31,6 +31,7 @@ import android.content.ServiceConnection;
 import android.database.AbstractCursor;
 import android.database.CharArrayBuffer;
 import android.database.Cursor;
+import android.graphics.Bitmap;
 import android.media.AudioManager;
 import android.media.MediaFile;
 import android.net.Uri;
@@ -94,6 +95,9 @@ public class TrackBrowserActivity extends ListActivity
     private String mSortOrder;
     private int mSelectedPosition;
     private long mSelectedId;
+    private static int mLastListPosCourse = -1;
+    private static int mLastListPosFine = -1;
+    private boolean mUseLastListPos = false;
 
     public TrackBrowserActivity()
     {
@@ -105,6 +109,12 @@ public class TrackBrowserActivity extends ListActivity
     {
         super.onCreate(icicle);
         requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
+        Intent intent = getIntent();
+        if (intent != null) {
+            if (intent.getBooleanExtra("withtabs", false)) {
+                requestWindowFeature(Window.FEATURE_NO_TITLE);
+            }
+        }
         setVolumeControlStream(AudioManager.STREAM_MUSIC);
         if (icicle != null) {
             mSelectedId = icicle.getLong("selectedtrack");
@@ -114,10 +124,9 @@ public class TrackBrowserActivity extends ListActivity
             mGenre = icicle.getString("genre");
             mEditMode = icicle.getBoolean("editmode", false);
         } else {
-            mAlbumId = getIntent().getStringExtra("album");
+            mAlbumId = intent.getStringExtra("album");
             // If we have an album, show everything on the album, not just stuff
             // by a particular artist.
-            Intent intent = getIntent();
             mArtistId = intent.getStringExtra("artist");
             mPlaylist = intent.getStringExtra("playlist");
             mGenre = intent.getStringExtra("genre");
@@ -149,6 +158,7 @@ public class TrackBrowserActivity extends ListActivity
         };
 
         setContentView(R.layout.media_picker_activity);
+        mUseLastListPos = MusicUtils.updateButtonBar(this, R.id.songtab);
         mTrackList = getListView();
         mTrackList.setOnCreateContextMenuListener(this);
         if (mEditMode) {
@@ -165,6 +175,14 @@ public class TrackBrowserActivity extends ListActivity
             setListAdapter(mAdapter);
         }
         MusicUtils.bindToService(this, this);
+
+        // don't set the album art until after the view has been layed out
+        mTrackList.post(new Runnable() {
+
+            public void run() {
+                setAlbumArtBackground();
+            }
+        });
     }
 
     public void onServiceConnected(ComponentName name, IBinder service)
@@ -200,12 +218,15 @@ public class TrackBrowserActivity extends ListActivity
             // first case, simply retry the query when the cursor is null.
             // Worst case, we end up doing the same query twice.
             if (mTrackCursor != null) {
-                init(mTrackCursor);
+                init(mTrackCursor, false);
             } else {
                 setTitle(R.string.working_songs);
                 getTrackCursor(mAdapter.getQueryHandler(), null, true);
             }
         }
+        if (!mEditMode) {
+            MusicUtils.updateNowPlaying(this);
+        }
     }
     
     public void onServiceDisconnected(ComponentName name) {
@@ -222,6 +243,14 @@ public class TrackBrowserActivity extends ListActivity
     
     @Override
     public void onDestroy() {
+        ListView lv = getListView();
+        if (lv != null && mUseLastListPos) {
+            mLastListPosCourse = lv.getFirstVisiblePosition();
+            View cv = lv.getChildAt(0);
+            if (cv != null) {
+                mLastListPosFine = cv.getTop();
+            }
+        }
         MusicUtils.unbindFromService(this);
         try {
             if ("nowplaying".equals(mPlaylist)) {
@@ -319,7 +348,7 @@ public class TrackBrowserActivity extends ListActivity
         super.onSaveInstanceState(outcicle);
     }
     
-    public void init(Cursor newCursor) {
+    public void init(Cursor newCursor, boolean isLimited) {
 
         if (mAdapter == null) {
             return;
@@ -332,10 +361,23 @@ public class TrackBrowserActivity extends ListActivity
             mReScanHandler.sendEmptyMessageDelayed(0, 1000);
             return;
         }
-        
+
         MusicUtils.hideDatabaseError(this);
+        mUseLastListPos = MusicUtils.updateButtonBar(this, R.id.songtab);
         setTitle();
 
+        // Restore previous position
+        if (mLastListPosCourse >= 0 && mUseLastListPos) {
+            ListView lv = getListView();
+            // this hack is needed because otherwise the position doesn't change
+            // for the 2nd (non-limited) cursor
+            lv.setAdapter(lv.getAdapter());
+            lv.setSelectionFromTop(mLastListPosCourse, mLastListPosFine);
+            if (!isLimited) {
+                mLastListPosCourse = -1;
+            }
+        }
+
         // When showing the queue, position the selection on the currently playing track
         // Otherwise, position the selection on the first matching artist, if any
         IntentFilter f = new IntentFilter();
@@ -368,6 +410,21 @@ public class TrackBrowserActivity extends ListActivity
         }
     }
 
+    private void setAlbumArtBackground() {
+        try {
+            long albumid = Long.valueOf(mAlbumId);
+            Bitmap bm = MusicUtils.getArtwork(TrackBrowserActivity.this, -1, albumid, false);
+            if (bm != null) {
+                MusicUtils.setBackground(mTrackList, bm);
+                mTrackList.setCacheColorHint(0);
+                return;
+            }
+        } catch (Exception ex) {
+        }
+        mTrackList.setBackgroundResource(0);
+        mTrackList.setCacheColorHint(0xff000000);
+    }
+
     private void setTitle() {
 
         CharSequence fancyName = null;
@@ -543,6 +600,9 @@ public class TrackBrowserActivity extends ListActivity
         @Override
         public void onReceive(Context context, Intent intent) {
             getListView().invalidateViews();
+            if (!mEditMode) {
+                MusicUtils.updateNowPlaying(TrackBrowserActivity.this);
+            }
         }
     };
 
@@ -833,6 +893,18 @@ public class TrackBrowserActivity extends ListActivity
         if (mTrackCursor.getCount() == 0) {
             return;
         }
+        // When selecting a track from the queue, just jump there instead of
+        // reloading the queue. This is both faster, and prevents accidentally
+        // dropping out of party shuffle.
+        if (mTrackCursor instanceof NowPlayingCursor) {
+            if (MusicUtils.sService != null) {
+                try {
+                    MusicUtils.sService.setQueuePosition(position);
+                    return;
+                } catch (RemoteException ex) {
+                }
+            }
+        }
         MusicUtils.playAll(this, mTrackCursor, position);
     }
 
@@ -847,9 +919,7 @@ public class TrackBrowserActivity extends ListActivity
         if (mPlaylist == null) {
             menu.add(0, PLAY_ALL, 0, R.string.play_all).setIcon(com.android.internal.R.drawable.ic_menu_play_clip);
         }
-        menu.add(0, GOTO_START, 0, R.string.goto_start).setIcon(R.drawable.ic_menu_music_library);
-        menu.add(0, GOTO_PLAYBACK, 0, R.string.goto_playback).setIcon(R.drawable.ic_menu_playback)
-                .setVisible(MusicUtils.isMusicLoaded());
+        menu.add(0, PARTY_SHUFFLE, 0, R.string.party_shuffle); // icon will be set in onPrepareOptionsMenu()
         menu.add(0, SHUFFLE_ALL, 0, R.string.shuffle_all).setIcon(R.drawable.ic_menu_shuffle);
         if (mPlaylist != null) {
             menu.add(0, SAVE_AS_PLAYLIST, 0, R.string.save_as_playlist).setIcon(android.R.drawable.ic_menu_save);
@@ -861,6 +931,12 @@ public class TrackBrowserActivity extends ListActivity
     }
 
     @Override
+    public boolean onPrepareOptionsMenu(Menu menu) {
+        MusicUtils.setPartyShuffleMenuIcon(menu);
+        return super.onPrepareOptionsMenu(menu);
+    }
+
+    @Override
     public boolean onOptionsItemSelected(MenuItem item) {
         Intent intent;
         Cursor cursor;
@@ -870,18 +946,9 @@ public class TrackBrowserActivity extends ListActivity
                 return true;
             }
 
-            case GOTO_START:
-                intent = new Intent();
-                intent.setClass(this, MusicBrowserActivity.class);
-                intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
-                startActivity(intent);
-                return true;
-
-            case GOTO_PLAYBACK:
-                intent = new Intent("com.android.music.PLAYBACK_VIEWER");
-                intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
-                startActivity(intent);
-                return true;
+            case PARTY_SHUFFLE:
+                MusicUtils.togglePartyShuffle();
+                break;
                 
             case SHUFFLE_ALL:
                 // Should 'shuffle all' shuffle ALL, or only the tracks shown?
@@ -1022,7 +1089,7 @@ public class TrackBrowserActivity extends ListActivity
         // This special case is for the "nowplaying" cursor, which cannot be handled
         // asynchronously using AsyncQueryHandler, so we do some extra initialization here.
         if (ret != null && async) {
-            init(ret);
+            init(ret, false);
             setTitle();
         }
         return ret;
@@ -1325,7 +1392,7 @@ public class TrackBrowserActivity extends ListActivity
             @Override
             protected void onQueryComplete(int token, Object cookie, Cursor cursor) {
                 //Log.i("@@@", "query complete: " + cursor.getCount() + "   " + mActivity);
-                mActivity.init(cursor);
+                mActivity.init(cursor, cookie != null);
                 if (token == 0 && cookie != null && cursor != null && cursor.getCount() >= 100) {
                     QueryArgs args = (QueryArgs) cookie;
                     startQuery(1, null, args.uri, args.projection, args.selection,