+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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_window_focused="false" android:state_enabled="true"
- android:drawable="@android:color/transparent" />
- <item android:state_window_focused="false" android:state_enabled="false"
- android:drawable="@android:color/transparent" />
- <item android:state_pressed="true"
- android:drawable="@android:drawable/btn_default" />
- <item android:state_focused="true" android:state_enabled="true"
- android:drawable="@android:drawable/btn_default" />
- <item android:state_enabled="true"
- android:drawable="@android:color/transparent" />
- <item android:state_focused="true"
- android:drawable="@android:color/transparent" />
- <item
- android:drawable="@android:color/transparent" />
-</selector>
<item android:state_pressed="true"
android:drawable="@drawable/gadget_next_pressed" />
<item android:state_focused="true"
- android:drawable="@drawable/gadget_next_focused" />
+ android:drawable="@drawable/gadget_next_pressed" />
<item
android:drawable="@drawable/gadget_next_normal" />
</selector>
<item android:state_pressed="true"
android:drawable="@drawable/gadget_pause_pressed" />
<item android:state_focused="true"
- android:drawable="@drawable/gadget_pause_focused" />
+ android:drawable="@drawable/gadget_pause_pressed" />
<item
android:drawable="@drawable/gadget_pause_normal" />
</selector>
<item android:state_pressed="true"
android:drawable="@drawable/gadget_play_pressed" />
<item android:state_focused="true"
- android:drawable="@drawable/gadget_play_focused" />
+ android:drawable="@drawable/gadget_play_pressed" />
<item
android:drawable="@drawable/gadget_play_normal" />
</selector>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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_window_focused="false"
- android:drawable="@drawable/gadget_prev_normal" />
- <item android:state_pressed="true"
- android:drawable="@drawable/gadget_prev_pressed" />
- <item android:state_focused="true"
- android:drawable="@drawable/gadget_prev_focused" />
- <item
- android:drawable="@drawable/gadget_prev_normal" />
-</selector>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
-
- <item android:id="@android:id/background">
- <shape>
- <corners android:radius="6dip" />
- <gradient
- android:startColor="@color/gadget_progress_bg_start"
- android:centerColor="@color/gadget_progress_bg_center"
- android:endColor="@color/gadget_progress_bg_end"
- android:centerY="0.4"
- android:angle="270"
- />
- </shape>
- </item>
-
- <item android:id="@android:id/progress">
- <clip>
- <shape>
- <corners android:radius="6dip" />
- <gradient
- android:startColor="@color/gadget_progress_fg_start"
- android:centerColor="@color/gadget_progress_fg_center"
- android:endColor="@color/gadget_progress_fg_end"
- android:centerY="0.15"
- android:angle="270"
- />
- </shape>
- </clip>
- </item>
-
-</layer-list>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/album_gadget"
- android:layout_width="240dip"
- android:layout_height="270dip"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
>
- <ImageView
- android:id="@+id/outline"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_centerHorizontal="true"
- android:src="@drawable/gadget_background"
- />
-
- <ImageView
- android:id="@+id/artwork"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_centerHorizontal="true"
- android:layout_marginTop="24dip"
- />
-
- <ImageView
- android:id="@+id/no_artwork"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_centerHorizontal="true"
- android:layout_marginTop="35dip"
- android:src="@drawable/gadget_no_art"
- android:visibility="gone"
- />
-
- <com.android.internal.widget.TextProgressBar
- android:id="@+id/progress_group"
+ <FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="50dip"
- android:layout_marginLeft="50dip"
- android:layout_marginRight="50dip"
- android:padding="4dip"
- android:gravity="center_vertical"
+ android:layout_centerVertical="true"
+ android:layout_marginLeft="9dip"
+ android:layout_marginRight="10dip"
+ android:background="@drawable/gadget_bg"
>
- <Chronometer
- android:id="@android:id/text1"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:gravity="center_horizontal"
- android:padding="2dip"
- android:textColor="@color/gadget_text"
- android:textSize="12sp"
- android:textStyle="bold"
- android:shadowColor="@color/gadget_text_shadow"
- android:shadowRadius="2.75"
- />
-
- <ProgressBar
- android:id="@android:id/progress"
+ <LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:layout_below="@android:id/text1"
- android:indeterminateOnly="false"
- android:progressDrawable="@drawable/gadget_progress"
- android:minHeight="12dip"
- android:maxHeight="12dip"
- />
+ android:orientation="vertical"
+ android:background="@drawable/gadget_inner"
+ >
- </com.android.internal.widget.TextProgressBar>
+ <TextView
+ android:id="@+id/title"
+ android:layout_width="fill_parent"
+ android:layout_height="0dip"
+ android:layout_weight="1"
+ android:gravity="bottom|left"
+ android:textColor="@color/gadget_text"
+ android:textStyle="bold"
+ android:textSize="11sp"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal"
+ />
- <TextView
- android:id="@+id/title"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="12dip"
- android:layout_marginLeft="34dip"
- android:layout_marginRight="34dip"
- android:layout_below="@id/progress_group"
- android:textColor="@color/gadget_text"
- android:textSize="14sp"
- android:singleLine="true"
- android:ellipsize="marquee"
- android:fadingEdge="horizontal"
- android:shadowColor="@color/gadget_text_shadow"
- android:shadowRadius="2.75"
- />
+ <TextView
+ android:id="@+id/artist"
+ android:layout_width="fill_parent"
+ android:layout_height="0dip"
+ android:layout_weight="1"
+ android:gravity="top|left"
+ android:textColor="@color/gadget_text"
+ android:textSize="11dip"
+ android:singleLine="true"
+ android:ellipsize="marquee"
+ android:fadingEdge="horizontal"
+ />
- <TextView
- android:id="@+id/artist"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="34dip"
- android:layout_marginRight="34dip"
- android:layout_marginBottom="12dip"
- android:layout_below="@id/title"
- android:textColor="@color/gadget_text"
- android:textStyle="bold"
- android:textSize="14dip"
- android:singleLine="true"
- android:ellipsize="marquee"
- android:fadingEdge="horizontal"
- android:shadowColor="@color/gadget_text_shadow"
- android:shadowRadius="2.75"
- />
+ </LinearLayout>
- <ImageButton
- android:id="@+id/control_prev"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/artist"
- android:layout_alignParentLeft="true"
- android:layout_marginLeft="14dip"
- android:src="@drawable/gadget_prev"
- android:background="@android:color/transparent"
- />
+ </FrameLayout>
<ImageButton
android:id="@+id/control_next"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/artist"
+ android:layout_height="fill_parent"
android:layout_alignParentRight="true"
- android:layout_marginRight="14dip"
+ android:layout_centerVertical="true"
+ android:paddingRight="25dip"
+ android:paddingLeft="10dip"
android:src="@drawable/gadget_next"
android:background="@android:color/transparent"
/>
android:id="@+id/control_play"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_centerHorizontal="true"
- android:layout_below="@id/artist"
- android:layout_marginTop="15dip"
- android:nextFocusUp="@id/control_next"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentBottom="true"
+ android:paddingLeft="16dip"
+ android:paddingRight="10dip"
+ android:paddingBottom="3dip"
+ android:paddingTop="10dip"
android:src="@drawable/gadget_play"
android:background="@android:color/transparent"
/>
android:text="@string/browse_menu"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorPrimary"
+ android:textColor="?android:attr/textColorPrimaryDisableOnly"
android:singleLine="true"
android:layout_marginBottom="35dip"
/>
android:text="@string/tracks_menu"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorPrimary"
+ android:textColor="?android:attr/textColorPrimaryDisableOnly"
android:singleLine="true"
android:layout_marginBottom="35dip"
/>
android:text="@string/albums_menu"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorPrimary"
+ android:textColor="?android:attr/textColorPrimaryDisableOnly"
android:singleLine="true"
android:layout_marginBottom="35dip"
/>
android:text="@string/playlists_menu"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorPrimary"
+ android:textColor="?android:attr/textColorPrimaryDisableOnly"
android:singleLine="true"
android:layout_marginBottom="35dip"
/>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/album_gadget"
- android:layout_width="220dip"
- android:layout_height="220dip"
- >
-
- <ImageView
- android:id="@+id/outline"
- android:layout_width="220dip"
- android:layout_height="220dip"
- android:layout_alignParentTop="true"
- android:layout_centerHorizontal="true"
- android:src="@drawable/gadget_background"
- />
-
- <ImageView
- android:id="@+id/artwork"
- android:layout_width="182dip"
- android:layout_height="182dip"
- android:layout_alignParentTop="true"
- android:layout_centerHorizontal="true"
- android:layout_marginTop="22dip"
- />
-
- <ImageView
- android:id="@+id/no_artwork"
- android:layout_width="0dip"
- android:layout_height="0dip"
- android:visibility="gone"
- />
-
- <com.android.internal.widget.TextProgressBar
- android:id="@+id/progress_group"
- android:layout_width="0dip"
- android:layout_height="0dip"
- android:visibility="gone"
- >
-
- <Chronometer
- android:id="@android:id/text1"
- android:layout_width="0dip"
- android:layout_height="0dip"
- />
-
- <ProgressBar
- android:id="@android:id/progress"
- android:layout_width="0dip"
- android:layout_height="0dip"
- />
-
- </com.android.internal.widget.TextProgressBar>
-
- <TextView
- android:id="@+id/title"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="60dip"
- android:layout_marginLeft="40dip"
- android:layout_marginRight="40dip"
- android:layout_below="@id/progress_group"
- android:textColor="@color/gadget_text"
- android:textSize="14sp"
- android:singleLine="true"
- android:ellipsize="marquee"
- android:fadingEdge="horizontal"
- android:shadowColor="@color/gadget_text_shadow"
- android:shadowRadius="2.75"
- />
-
- <TextView
- android:id="@+id/artist"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_centerHorizontal="true"
- android:layout_marginLeft="40dip"
- android:layout_marginRight="40dip"
- android:layout_marginBottom="7dip"
- android:layout_below="@id/title"
- android:textColor="@color/gadget_text"
- android:textStyle="bold"
- android:textSize="14sp"
- android:singleLine="true"
- android:ellipsize="marquee"
- android:fadingEdge="horizontal"
- android:shadowColor="@color/gadget_text_shadow"
- android:shadowRadius="2.75"
- />
-
- <ImageButton
- android:id="@+id/control_prev"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/artist"
- android:layout_alignParentLeft="true"
- android:src="@drawable/gadget_prev"
- android:background="@android:color/transparent"
- />
-
- <ImageButton
- android:id="@+id/control_next"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_below="@id/artist"
- android:layout_alignParentRight="true"
- android:src="@drawable/gadget_next"
- android:background="@android:color/transparent"
- />
-
- <ImageButton
- android:id="@+id/control_play"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_centerHorizontal="true"
- android:layout_below="@id/artist"
- android:layout_marginTop="15dip"
- android:nextFocusUp="@id/control_next"
- android:src="@drawable/gadget_play"
- android:background="@android:color/transparent"
- />
-
-</RelativeLayout>
android:text="@string/browse_menu"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorPrimary"
+ android:textColor="?android:attr/textColorPrimaryDisableOnly"
android:singleLine="true"
android:layout_marginBottom="35dip"
android:layout_marginRight="10dip"
android:text="@string/albums_menu"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorPrimary"
+ android:textColor="?android:attr/textColorPrimaryDisableOnly"
android:singleLine="true"
android:layout_marginBottom="35dip"
android:layout_marginRight="10dip"
android:text="@string/tracks_menu"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorPrimary"
+ android:textColor="?android:attr/textColorPrimaryDisableOnly"
android:singleLine="true"
android:layout_marginBottom="35dip"
android:layout_marginRight="10dip"
android:text="@string/playlists_menu"
android:ellipsize="marquee"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorPrimary"
+ android:textColor="?android:attr/textColorPrimaryDisableOnly"
android:singleLine="true"
android:layout_marginBottom="35dip"
/>
<string name="recentlyadded_title">"Añadidos recientemente"</string>
<string name="podcasts_listitem">"Podcasts"</string>
<string name="podcasts_title">"Podcasts"</string>
- <string name="sdcard_missing_title">"Ninguna tarjeta SD"</string>
- <string name="sdcard_missing_message">"No hay ninguna tarjeta SD en el teléfono."</string>
+ <string name="sdcard_missing_title">"Falta la tarjeta SD"</string>
+ <string name="sdcard_missing_message">"Falta la tarjeta SD en el teléfono"</string>
<string name="sdcard_busy_title">"Tarjeta SD no disponible"</string>
<string name="sdcard_busy_message">"La tarjeta SD está ocupada."</string>
<string name="sdcard_error_title">"Error de tarjeta SD"</string>
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="create_playlist_create_text_prompt">"Nom de la liste de lecture"</string>
+ <string name="create_playlist_create_text_prompt">"Nom de la playlist"</string>
<string name="rename_playlist_same_prompt">"Renommer \"<xliff:g id="PLAYLIST">%s</xliff:g>\" en"</string>
<string name="rename_playlist_diff_prompt">"Renommer \"<xliff:g id="PLAYLIST">%s</xliff:g>\" en"</string>
</resources>
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="create_playlist_create_text_prompt">"Ouvrez le clavier afin de saisir un nom pour votre nouvelle liste de lecture ou sélectionnez Enregistrer pour lui attribuer le nom \"%s\"."</string>
- <string name="rename_playlist_same_prompt">"Ouvrez le clavier pour renommer la liste de lecture \"<xliff:g id="PLAYLIST">%s</xliff:g>\"."</string>
- <string name="rename_playlist_diff_prompt">"Ouvrez le clavier afin de saisir un nom pour votre nouvelle liste de lecture \"<xliff:g id="PLAYLIST">%s</xliff:g>\" ou sélectionnez Enregistrer pour lui attribuer le nom \"%s\"."</string>
+ <string name="create_playlist_create_text_prompt">"Ouvrez le clavier afin de saisir un nom pour votre nouvelle playlist ou sélectionnez Enregistrer pour la nommer \"%s\"."</string>
+ <string name="rename_playlist_same_prompt">"Ouvrez le clavier pour renommer la playlist \"<xliff:g id="PLAYLIST">%s</xliff:g>\"."</string>
+ <string name="rename_playlist_diff_prompt">"Ouvrez le clavier pour saisir un nouveau nom pour la playlist \"<xliff:g id="PLAYLIST">%s</xliff:g>\" ou sélectionnez Enregistrer pour la nommer \"%s\"."</string>
</resources>
<string name="shuffle_all">"Lecture aléatoire de toutes les chansons"</string>
<string name="play_all">"Tout lire"</string>
<string name="delete_artist_desc">"Toutes les chansons de <xliff:g id="ARTIST">%s</xliff:g> seront définitivement supprimées de la carte SD."</string>
- <string name="delete_album_desc">"L\' intégralité de l\'album \"<xliff:g id="ALBUM">%s</xliff:g>\" sera définitivement supprimé de la carte SD."</string>
+ <string name="delete_album_desc">"L\'intégralité de l\'album \"<xliff:g id="ALBUM">%s</xliff:g>\" sera définitivement supprimée de la carte SD."</string>
<string name="delete_song_desc">"La chanson \"<xliff:g id="SONG">%s</xliff:g>\" sera définitivement supprimée de la carte SD."</string>
<string name="delete_confirm_button_text">"OK"</string>
<plurals name="NNNtracksdeleted">
<string name="albums_title">"Albums"</string>
<string name="tracks_menu">"Chansons"</string>
<string name="tracks_title">"Chansons"</string>
- <string name="playlists_menu">"Listes de lecture"</string>
- <string name="playlists_title">"Listes de lecture"</string>
+ <string name="playlists_menu">"Playlists"</string>
+ <string name="playlists_title">"Playlists"</string>
<string name="videos_title">"Vidéos"</string>
- <string name="all_title">"Tous les médias"</string>
+ <string name="all_title">"Tous le multimédia"</string>
<string name="browse_menu">"Artistes"</string>
- <string name="search_title">"Recherche"</string>
+ <string name="search_title">"Rechercher"</string>
<string name="no_tracks_title">"Aucune chanson"</string>
<string name="no_videos_title">"Aucune vidéo trouvée"</string>
- <string name="no_playlists_title">"Aucune liste de lecture trouvée"</string>
+ <string name="no_playlists_title">"Aucune playlist trouvée"</string>
<string name="delete_playlist_menu">"Supprimer"</string>
<string name="edit_playlist_menu">"Modifier"</string>
<string name="rename_playlist_menu">"Renommer"</string>
- <string name="playlist_deleted_message">"La liste de lecture a été supprimée."</string>
- <string name="playlist_renamed_message">"La liste de lecture a été renommée."</string>
+ <string name="playlist_deleted_message">"La playlist a été supprimée."</string>
+ <string name="playlist_renamed_message">"La playlist a été renommée."</string>
<string name="recentlyadded">"Ajoutés récemment"</string>
<string name="recentlyadded_title">"Playlist récente"</string>
<string name="podcasts_listitem">"Podcasts"</string>
<string name="sdcard_error_message">"Une erreur s\'est produite sur votre carte SD."</string>
<string name="unknown_artist_name">"Artiste inconnu"</string>
<string name="unknown_album_name">"Album inconnu"</string>
- <string name="shuffle_on_notif">"La lecture aléatoire est activé."</string>
+ <string name="shuffle_on_notif">"La lecture aléatoire est activée."</string>
<string name="shuffle_off_notif">"Le mode aléatoire est désactivé."</string>
<string name="repeat_off_notif">"La lecture en boucle est désactivée."</string>
- <string name="repeat_current_notif">"Lecture en boucle de la chanson en écoute"</string>
+ <string name="repeat_current_notif">"Lecture en boucle de la chanson en écoute."</string>
<string name="repeat_all_notif">"Lecture en boucle de toutes les chansons"</string>
- <string name="ringtone_menu">"Utiliser comme sonnerie du téléphone"</string>
- <string name="ringtone_menu_short">"Utiliser comme sonnerie"</string>
+ <string name="ringtone_menu">"Utiliser comme sonnerie"</string>
+ <string name="ringtone_menu_short">"Définir comme sonnerie"</string>
<string name="ringtone_set">"\"%s\" a été défini comme sonnerie."</string>
<string name="play_selection">"Lire"</string>
- <string name="add_to_playlist">"Ajouter à la liste de lecture"</string>
- <string name="queue">"Liste de lecture actuelle"</string>
+ <string name="add_to_playlist">"Ajouter à la playlist"</string>
+ <string name="queue">"Playlist actuelle"</string>
<string name="new_playlist">"Nouveau"</string>
- <string name="new_playlist_name_template">"Nouvelle liste de lecture <xliff:g id="NUMBER">%d</xliff:g>"</string>
+ <string name="new_playlist_name_template">"Nouvelle playlist <xliff:g id="NUMBER">%d</xliff:g>"</string>
<plurals name="NNNtrackstoplaylist">
- <item quantity="one">"1 chanson a été ajoutée à la liste de lecture."</item>
- <item quantity="other">"%d chansons ont été ajoutées à la liste de lecture."</item>
+ <item quantity="one">"1 chanson a été ajoutée à la playlist."</item>
+ <item quantity="other">"%d chansons ont été ajoutées à la playlist."</item>
</plurals>
- <string name="emptyplaylist">"La liste de lecture sélectionnée est vide."</string>
+ <string name="emptyplaylist">"La playlist sélectionnée est vide."</string>
<string name="create_playlist_create_text">"Enregistrer"</string>
- <string name="create_playlist_overwrite_text">"Écraser"</string>
+ <string name="create_playlist_overwrite_text">"Remplacer"</string>
<string name="service_start_error_title">"Erreur de lecture"</string>
<string name="service_start_error_msg">"Désolé, la chanson n\'a pas pu être lue."</string>
<string name="service_start_error_button">"OK"</string>
<string-array name="weeklist">
- <item>"1 semaine"</item>
- <item>"2 semaines"</item>
- <item>"3 semaines"</item>
- <item>"4 semaines"</item>
- <item>"5 semaines"</item>
- <item>"6 semaines"</item>
- <item>"7 semaines"</item>
- <item>"8 semaines"</item>
- <item>"9 semaines"</item>
- <item>"10 semaines"</item>
- <item>"11 semaines"</item>
- <item>"12 semaines"</item>
+ <item>"1 sem."</item>
+ <item>"2 sem."</item>
+ <item>"3 sem."</item>
+ <item>"4 sem."</item>
+ <item>"5 sem."</item>
+ <item>"6 sem."</item>
+ <item>"7 sem."</item>
+ <item>"8 sem."</item>
+ <item>"9 sem."</item>
+ <item>"10 sem."</item>
+ <item>"11 sem."</item>
+ <item>"12 sem."</item>
</string-array>
<string name="weekpicker_set">"OK"</string>
<string name="weekpicker_title">"Définir la durée"</string>
- <string name="save_as_playlist">"Enregistrer en tant que liste de lecture"</string>
- <string name="clear_playlist">"Effacer la liste de lecture"</string>
+ <string name="save_as_playlist">"Enregistrer comme playlist"</string>
+ <string name="clear_playlist">"Effacer la playlist"</string>
<string name="musicbrowserlabel">"Musique"</string>
- <string name="musicshortcutlabel">"Liste de lecture musicale"</string>
+ <string name="musicshortcutlabel">"Playlist musicale"</string>
<string name="mediaplaybacklabel">"Musique"</string>
<string name="videobrowserlabel">"Vidéos"</string>
<string name="mediapickerlabel">"Musique"</string>
<string name="playback_failed">"Désolé, le lecteur ne prend pas en charge ce type de fichier audio."</string>
<string name="cancel">"Annuler"</string>
- <string name="remove_from_playlist">"Supprimer de la liste de lecture"</string>
+ <string name="remove_from_playlist">"Supprimer de la playlist"</string>
<string name="streamloadingtext">"Connexion à <xliff:g id="HOST">%s</xliff:g>"</string>
<string name="mediasearch">"Rechercher %s à l\'aide de :"</string>
<string name="working_artists">"Artistes…"</string>
<string name="goto_start">"Raccolta"</string>
<string name="goto_playback">"Riproduci"</string>
<string name="party_shuffle">"Party shuffle"</string>
- <string name="party_shuffle_off">"Party shuffle off"</string>
+ <string name="party_shuffle_off">"Party shuffle non attiva"</string>
<string name="delete_item">"Elimina"</string>
<string name="shuffle_all">"Ripr. casuale"</string>
<string name="play_all">"Riprod. tutti"</string>
<string name="play_selection">"Riprod."</string>
<string name="add_to_playlist">"Aggiungi a playlist"</string>
<string name="queue">"Playlist corrente"</string>
- <string name="new_playlist">"Nuovo"</string>
+ <string name="new_playlist">"Nuova"</string>
<string name="new_playlist_name_template">"Nuova playlist <xliff:g id="NUMBER">%d</xliff:g>"</string>
<plurals name="NNNtrackstoplaylist">
<item quantity="one">"1 brano aggiunto alla playlist."</item>
<string name="shuffle_all">"Stokk alle"</string>
<string name="play_all">"Spill alle"</string>
<string name="delete_artist_desc">"Alle sanger av <xliff:g id="ARTIST">%s</xliff:g> vil vil bli slettet permanent fra minnekortet."</string>
- <string name="delete_album_desc">"Hele albumet \\\\\\\"<xliff:g id="ALBUM">%s</xliff:g>\\\\\\\" vil bli slettet permanent fra minnekortet."</string>
- <string name="delete_song_desc">"\\\\\\\"<xliff:g id="SONG">%s</xliff:g>\\\\\\\" vil bli slettet permanent fra minnekortet."</string>
+ <string name="delete_album_desc">"Hele albumet \"<xliff:g id="ALBUM">%s</xliff:g>\" vil bli slettet permanent fra minnekortet."</string>
+ <string name="delete_song_desc">"\"<xliff:g id="SONG">%s</xliff:g>\" vil bli slettet permanent fra minnekortet."</string>
<string name="delete_confirm_button_text">"OK"</string>
<plurals name="NNNtracksdeleted">
<item quantity="one">"1 sang ble slettet."</item>
<string name="repeat_all_notif">"Gjentar alle sanger."</string>
<string name="ringtone_menu">"Bruk som telefonringetone"</string>
<string name="ringtone_menu_short">"Bruk som ringetone"</string>
- <string name="ringtone_set">"\\\\\\\"%s\\\\\\\" valgt som telefonringetone."</string>
+ <string name="ringtone_set">"\"%s\" valgt som telefonringetone."</string>
<string name="play_selection">"Spill"</string>
<string name="add_to_playlist">"Legg til spillelisten"</string>
<string name="queue">"Gjeldende spilleliste"</string>
<string name="play_all">"Alles afspelen"</string>
<string name="delete_artist_desc">"Alle nummers van <xliff:g id="ARTIST">%s</xliff:g> worden definitief van de SD-kaart verwijderd."</string>
<string name="delete_album_desc">"Het hele album \'<xliff:g id="ALBUM">%s</xliff:g>\' wordt definitief van de SD-kaart verwijderd."</string>
- <string name="delete_song_desc">"\'<xliff:g id="SONG">%s</xliff:g>\' wordt definitief van de SD-kaart verwijderd."</string>
+ <string name="delete_song_desc">"<xliff:g id="SONG">%s</xliff:g>\' wordt definitief van de SD-kaart verwijderd."</string>
<string name="delete_confirm_button_text">"OK"</string>
<plurals name="NNNtracksdeleted">
<item quantity="one">"1 nummer is verwijderd."</item>
<string name="repeat_all_notif">"Alle nummers worden herhaald."</string>
<string name="ringtone_menu">"Gebruiken als beltoon van telefoon"</string>
<string name="ringtone_menu_short">"Gebruiken als beltoon"</string>
- <string name="ringtone_set">"\'%s\' ingesteld als beltoon van telefoon."</string>
+ <string name="ringtone_set">"%s\' ingesteld als beltoon van telefoon."</string>
<string name="play_selection">"Afspelen"</string>
<string name="add_to_playlist">"Toevoegen aan afspeellijst"</string>
<string name="queue">"Huidige afspeellijst"</string>
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="create_playlist_create_text_prompt">"Nazwa listy odtwarzania"</string>
+ <string name="create_playlist_create_text_prompt">"Nazwa playlisty"</string>
<string name="rename_playlist_same_prompt">"Zmień nazwę „<xliff:g id="PLAYLIST">%s</xliff:g>” na"</string>
<string name="rename_playlist_diff_prompt">"Zmień nazwę „<xliff:g id="PLAYLIST">%s</xliff:g>” na"</string>
</resources>
-->
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="create_playlist_create_text_prompt">"Otwórz klawiaturę, aby nazwać nową listę odtwarzania lub wybierz polecenie Zapisz, aby nazwać ją „%s”."</string>
- <string name="rename_playlist_same_prompt">"Otwórz klawiaturę, aby nadać nową nazwę liście odtwarzania „<xliff:g id="PLAYLIST">%s</xliff:g>”."</string>
- <string name="rename_playlist_diff_prompt">"Otwórz klawiaturę, aby nadać liście odtwarzania „<xliff:g id="PLAYLIST">%s</xliff:g>” nową nazwę lub wybierz polecenie Zapisz, aby nazwać ją „%s”."</string>
+ <string name="create_playlist_create_text_prompt">"Otwórz klawiaturę, aby nazwać nową playlistę lub wybierz polecenie Zapisz, aby nazwać ją „%s”."</string>
+ <string name="rename_playlist_same_prompt">"Otwórz klawiaturę, aby nadać nową nazwę playliście „<xliff:g id="PLAYLIST">%s</xliff:g>”."</string>
+ <string name="rename_playlist_diff_prompt">"Otwórz klawiaturę, aby nadać playliście „<xliff:g id="PLAYLIST">%s</xliff:g>” nową nazwę lub wybierz polecenie Zapisz, aby nazwać ją „%s”."</string>
</resources>
</plurals>
<string name="goto_start">"Biblioteka"</string>
<string name="goto_playback">"Odtwórz"</string>
- <string name="party_shuffle">"Odtwarzaj losowo w trybie przyjęcia"</string>
- <string name="party_shuffle_off">"Odtwarzanie losowe w trybie przyjęcia jest wyłączone"</string>
+ <string name="party_shuffle">"Losowo w trybie imprezy"</string>
+ <string name="party_shuffle_off">"Wyłączono losowe odtwarzanie w trybie imprezy"</string>
<string name="delete_item">"Usuń"</string>
- <string name="shuffle_all">"Odtwarzaj losowo wszystkie"</string>
+ <string name="shuffle_all">"Wszystkie losowo"</string>
<string name="play_all">"Odtwórz wszystko"</string>
<string name="delete_artist_desc">"Wszystkie utwory wykonawcy <xliff:g id="ARTIST">%s</xliff:g> zostaną na stałe usunięte z karty SD."</string>
<string name="delete_album_desc">"Cały album „<xliff:g id="ALBUM">%s</xliff:g>” zostanie na stałe usunięty z karty SD."</string>
</plurals>
<string name="scanning">"Skanowanie karty SD..."</string>
<string name="nowplaying_title">"Teraz odtwarzane"</string>
- <string name="partyshuffle_title">"Odtwarzaj losowo w trybie przyjęcia"</string>
+ <string name="partyshuffle_title">"Losowo w trybie imprezy"</string>
<string name="artists_title">"Wykonawcy"</string>
<string name="albums_menu">"Albumy"</string>
<string name="albums_title">"Albumy"</string>
<string name="tracks_menu">"Utwory"</string>
<string name="tracks_title">"Utwory"</string>
- <string name="playlists_menu">"Listy odtwarzania"</string>
- <string name="playlists_title">"Listy odtwarzania"</string>
+ <string name="playlists_menu">"Playlisty"</string>
+ <string name="playlists_title">"Playlisty"</string>
<string name="videos_title">"Filmy wideo"</string>
<string name="all_title">"Wszystkie multimedia"</string>
<string name="browse_menu">"Wykonawcy"</string>
<string name="search_title">"Szukaj"</string>
<string name="no_tracks_title">"Brak utworów"</string>
<string name="no_videos_title">"Brak filmów wideo"</string>
- <string name="no_playlists_title">"Brak list odtwarzania"</string>
+ <string name="no_playlists_title">"Brak playlist"</string>
<string name="delete_playlist_menu">"Usuń"</string>
<string name="edit_playlist_menu">"Edytuj"</string>
<string name="rename_playlist_menu">"Zmień nazwę"</string>
- <string name="playlist_deleted_message">"Lista odtwarzania została usunięta."</string>
- <string name="playlist_renamed_message">"Nazwa listy odtwarzania została zmieniona."</string>
+ <string name="playlist_deleted_message">"Playlista została usunięta."</string>
+ <string name="playlist_renamed_message">"Zmieniono nazwę playlisty."</string>
<string name="recentlyadded">"Ostatnio dodane"</string>
<string name="recentlyadded_title">"Ostatnio dodane"</string>
<string name="podcasts_listitem">"Podcasty"</string>
<string name="sdcard_error_message">"Napotkano błąd na karcie SD."</string>
<string name="unknown_artist_name">"Nieznany wykonawca"</string>
<string name="unknown_album_name">"Nieznany album"</string>
- <string name="shuffle_on_notif">"Odtwarzanie losowe jest włączone."</string>
- <string name="shuffle_off_notif">"Odtwarzanie losowe jest wyłączone."</string>
+ <string name="shuffle_on_notif">"Odtwarzanie losowe włączone"</string>
+ <string name="shuffle_off_notif">"Odtwarzanie losowe wyłączone"</string>
<string name="repeat_off_notif">"Powtarzanie jest wyłączone."</string>
<string name="repeat_current_notif">"Powtarzanie obecnego utworu."</string>
<string name="repeat_all_notif">"Powtarzanie wszystkich utworów."</string>
- <string name="ringtone_menu">"Zastosuj jako dzwonek telefonu"</string>
- <string name="ringtone_menu_short">"Zastosuj jako dzwonek"</string>
+ <string name="ringtone_menu">"Ustaw jako dzwonek telefonu"</string>
+ <string name="ringtone_menu_short">"Ustaw jako dzwonek"</string>
<string name="ringtone_set">"„%s” ustawiono jako dzwonek telefonu."</string>
<string name="play_selection">"Odtwórz"</string>
- <string name="add_to_playlist">"Dodaj do listy odtwarzania"</string>
- <string name="queue">"Obecna lista odtwarzania"</string>
+ <string name="add_to_playlist">"Dodaj do playlisty"</string>
+ <string name="queue">"Bieżąca playlista"</string>
<string name="new_playlist">"Nowy"</string>
- <string name="new_playlist_name_template">"Nowa lista odtwarzania <xliff:g id="NUMBER">%d</xliff:g>"</string>
+ <string name="new_playlist_name_template">"Nowa playlista <xliff:g id="NUMBER">%d</xliff:g>"</string>
<plurals name="NNNtrackstoplaylist">
- <item quantity="one">"1 utwór został dodany do listy odtwarzania."</item>
+ <item quantity="one">"Dodano 1 utwór do playlisty."</item>
<item quantity="other">"%d utworów dodano do listy odtwarzania."</item>
</plurals>
- <string name="emptyplaylist">"Wybrana lista odtwarzania jest pusta."</string>
+ <string name="emptyplaylist">"Wybrana playlista jest pusta."</string>
<string name="create_playlist_create_text">"Zapisz"</string>
<string name="create_playlist_overwrite_text">"Zastąp"</string>
<string name="service_start_error_title">"Problem z odtwarzaniem"</string>
</string-array>
<string name="weekpicker_set">"Gotowe"</string>
<string name="weekpicker_title">"Ustaw czas"</string>
- <string name="save_as_playlist">"Zapisz jako listę odtwarzania"</string>
- <string name="clear_playlist">"Wyczyść listę odtwarzania"</string>
+ <string name="save_as_playlist">"Zapisz jako playlistę"</string>
+ <string name="clear_playlist">"Wyczyść playlistę"</string>
<string name="musicbrowserlabel">"Muzyka"</string>
- <string name="musicshortcutlabel">"Lista odtwarzania muzyki"</string>
+ <string name="musicshortcutlabel">"Playlista muzyczna"</string>
<string name="mediaplaybacklabel">"Muzyka"</string>
<string name="videobrowserlabel">"Filmy wideo"</string>
<string name="mediapickerlabel">"Muzyka"</string>
<string name="playback_failed">"Niestety, odtwarzacz nie obsługuje plików audio tego typu."</string>
<string name="cancel">"Anuluj"</string>
- <string name="remove_from_playlist">"Usuń z listy odtwarzania"</string>
+ <string name="remove_from_playlist">"Usuń z playlisty"</string>
<string name="streamloadingtext">"Łączenie z: <xliff:g id="HOST">%s</xliff:g>"</string>
<string name="mediasearch">"Wyszukaj %s z wykorzystaniem:"</string>
<string name="working_artists">"Wykonawcy…"</string>
-->
<resources>
- <color name="gadget_progress_bg_start">#ffc2c7bc</color>
- <color name="gadget_progress_bg_center">#fff8fff1</color>
- <color name="gadget_progress_bg_end">#ffe9f0e9</color>
- <color name="gadget_progress_fg_start">#ff8aa841</color>
- <color name="gadget_progress_fg_center">#ffadd252</color>
- <color name="gadget_progress_fg_end">#ffadd252</color>
-
- <color name="gadget_text">#ff003533</color>
- <color name="gadget_text_shadow">#ffffffff</color>
+ <color name="gadget_text">#ffffffff</color>
</resources>
-->
<gadget-provider xmlns:android="http://schemas.android.com/apk/res/android"
- android:minWidth="220dip"
- android:minHeight="220dip"
+ android:minWidth="294dip"
+ android:minHeight="72dip"
android:updatePeriodMillis="0"
android:initialLayout="@layout/gadget"
>
android:searchSuggestAuthority="media"
android:searchSuggestPath="external/audio"
+ android:searchSuggestIntentAction="android.intent.action.VIEW"
/>
private AlphabetIndexer mIndexer;
private AlbumBrowserActivity mActivity;
private AsyncQueryHandler mQueryHandler;
+ private String mConstraint = null;
+ private boolean mConstraintIsValid = false;
class ViewHolder {
TextView line1;
@Override
public Cursor runQueryOnBackgroundThread(CharSequence constraint) {
- return mActivity.getAlbumCursor(null, constraint.toString());
+ String s = constraint.toString();
+ if (mConstraintIsValid && (
+ (s == null && mConstraint == null) ||
+ (s != null && s.equals(mConstraint)))) {
+ return getCursor();
+ }
+ Cursor c = mActivity.getAlbumCursor(null, s);
+ mConstraint = s;
+ mConstraintIsValid = true;
+ return c;
}
public Object[] getSections() {
private MusicAlphabetIndexer mIndexer;
private ArtistAlbumBrowserActivity mActivity;
private AsyncQueryHandler mQueryHandler;
+ private String mConstraint = null;
+ private boolean mConstraintIsValid = false;
class ViewHolder {
TextView line1;
@Override
public Cursor runQueryOnBackgroundThread(CharSequence constraint) {
- return mActivity.getArtistCursor(null, constraint.toString());
+ String s = constraint.toString();
+ if (mConstraintIsValid && (
+ (s == null && mConstraint == null) ||
+ (s != null && s.equals(mConstraint)))) {
+ return getCursor();
+ }
+ Cursor c = mActivity.getArtistCursor(null, s);
+ mConstraint = s;
+ mConstraintIsValid = true;
+ return c;
}
public Object[] getSections() {
import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.media.MediaFile;
+import android.os.Environment;
import android.os.SystemClock;
import android.util.Config;
import android.util.Log;
public static final String CMDGADGETUPDATE = "gadgetupdate";
+ static final ComponentName THIS_GADGET =
+ new ComponentName("com.android.music",
+ "com.android.music.MediaGadgetProvider");
+
+ private static MediaGadgetProvider sInstance;
+
+ static synchronized MediaGadgetProvider getInstance() {
+ if (sInstance == null) {
+ sInstance = new MediaGadgetProvider();
+ }
+ return sInstance;
+ }
+
@Override
public void onUpdate(Context context, GadgetManager gadgetManager, int[] gadgetIds) {
defaultGadget(context, gadgetIds);
* Initialize given gadgets to default state, where we launch Music on default click
* and hide actions if service not running.
*/
- static void defaultGadget(Context context, int[] gadgetIds) {
+ private void defaultGadget(Context context, int[] gadgetIds) {
+ final Resources res = context.getResources();
final RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.gadget);
+
+ views.setTextViewText(R.id.title, res.getText(R.string.emptyplaylist));
- linkButtons(context, views, false /* not from service */);
+ linkButtons(context, views, false /* not playing */);
pushUpdate(context, gadgetIds, views);
}
- private static void pushUpdate(Context context, int[] gadgetIds, RemoteViews views) {
+ private void pushUpdate(Context context, int[] gadgetIds, RemoteViews views) {
// Update specific list of gadgetIds if given, otherwise default to all
final GadgetManager gm = GadgetManager.getInstance(context);
if (gadgetIds != null) {
}
/**
+ * Check against {@link GadgetManager} if there are any instances of this gadget.
+ */
+ private boolean hasInstances(Context context) {
+ GadgetManager gadgetManager = GadgetManager.getInstance(context);
+ int[] gadgetIds = gadgetManager.getGadgetIds(THIS_GADGET);
+ return (gadgetIds.length > 0);
+ }
+
+ /**
+ * Handle a change notification coming over from {@link MediaPlaybackService}
+ */
+ void notifyChange(MediaPlaybackService service, String what) {
+ if (hasInstances(service)) {
+ if (MediaPlaybackService.PLAYBACK_COMPLETE.equals(what) ||
+ MediaPlaybackService.META_CHANGED.equals(what) ||
+ MediaPlaybackService.PLAYSTATE_CHANGED.equals(what)) {
+ performUpdate(service, null);
+ }
+ }
+ }
+
+ /**
* Update all active gadget instances by pushing changes
- * @param metaChanged
*/
- static void updateAllGadgets(MediaPlaybackService service, int[] gadgetIds) {
+ void performUpdate(MediaPlaybackService service, int[] gadgetIds) {
final Resources res = service.getResources();
final RemoteViews views = new RemoteViews(service.getPackageName(), R.layout.gadget);
final int track = service.getQueuePosition() + 1;
final String titleName = service.getTrackName();
final String artistName = service.getArtistName();
- final String albumName = service.getAlbumName();
- int albumId = service.getAlbumId();
- if (MediaFile.UNKNOWN_STRING.equals(albumName)) {
- albumId = -1;
- }
-
- // Try loading album artwork and resize if found
- Bitmap artwork = MusicUtils.getArtwork(service, albumId, false);
- if (artwork != null) {
- artwork = scaleArtwork(artwork, service);
- views.setImageViewBitmap(R.id.artwork, artwork);
- views.setViewVisibility(R.id.artwork, View.VISIBLE);
- views.setViewVisibility(R.id.no_artwork, View.GONE);
+ // Format title string with track number, or show SD card message
+ CharSequence titleString = "";
+ String status = Environment.getExternalStorageState();
+ if (titleName != null) {
+ titleString = res.getString(R.string.gadget_track_num_title, track, titleName);
+ } else if (status.equals(Environment.MEDIA_SHARED) ||
+ status.equals(Environment.MEDIA_UNMOUNTED)) {
+ titleString = res.getText(R.string.sdcard_busy_title);
+ } else if (status.equals(Environment.MEDIA_REMOVED)) {
+ titleString = res.getText(R.string.sdcard_missing_title);
} else {
- views.setViewVisibility(R.id.artwork, View.GONE);
- views.setViewVisibility(R.id.no_artwork, View.VISIBLE);
+ titleString = res.getText(R.string.emptyplaylist);
}
- // Format title string with track number
- final String titleString = res.getString(R.string.gadget_track_num_title, track, titleName);
-
views.setTextViewText(R.id.title, titleString);
views.setTextViewText(R.id.artist, artistName);
- // Set chronometer to correct value
- final boolean playing = service.isPlaying();
- final long start = SystemClock.elapsedRealtime() - service.position();
- final long end = start + service.duration();
-
- views.setChronometer(android.R.id.text1, start, null, playing);
- views.setLong(R.id.progress_group, "setDurationBase", end);
-
// Set correct drawable for pause state
+ final boolean playing = service.isPlaying();
views.setImageViewResource(R.id.control_play, playing ?
R.drawable.gadget_pause : R.drawable.gadget_play);
// Link actions buttons to intents
- linkButtons(service, views, true /* not from service */);
+ linkButtons(service, views, playing);
pushUpdate(service, gadgetIds, views);
}
/**
* Link up various button actions using {@link PendingIntents}.
*
- * @param fromService If false, {@link MediaPlaybackService} isn't running,
- * and we should link the play button to start that service.
- * Otherwise, we assume the service is awake and send broadcast
- * Intents instead.
+ * @param playerActive True if player is active in background, which means
+ * gadget click will launch {@link MediaPlaybackActivity},
+ * otherwise we launch {@link MusicBrowserActivity}.
*/
- private static void linkButtons(Context context, RemoteViews views, boolean fromService) {
+ private void linkButtons(Context context, RemoteViews views, boolean playerActive) {
// Connect up various buttons and touch events
Intent intent;
PendingIntent pendingIntent;
- intent = new Intent(context, MediaPlaybackActivity.class);
- pendingIntent = PendingIntent.getActivity(context,
- 0 /* no requestCode */, intent, 0 /* no flags */);
- views.setOnClickPendingIntent(R.id.album_gadget, pendingIntent);
+ final ComponentName serviceName = new ComponentName(context, MediaPlaybackService.class);
- intent = new Intent(MediaPlaybackService.PREVIOUS_ACTION);
- pendingIntent = PendingIntent.getBroadcast(context,
- 0 /* no requestCode */, intent, 0 /* no flags */);
- views.setOnClickPendingIntent(R.id.control_prev, pendingIntent);
-
- // Use broadcast to trigger play/pause, otherwise
- if (fromService) {
- intent = new Intent(MediaPlaybackService.TOGGLEPAUSE_ACTION);
- pendingIntent = PendingIntent.getBroadcast(context,
+ if (playerActive) {
+ intent = new Intent(context, MediaPlaybackActivity.class);
+ pendingIntent = PendingIntent.getActivity(context,
0 /* no requestCode */, intent, 0 /* no flags */);
- views.setOnClickPendingIntent(R.id.control_play, pendingIntent);
+ views.setOnClickPendingIntent(R.id.album_gadget, pendingIntent);
} else {
- intent = new Intent(MediaPlaybackService.TOGGLEPAUSE_ACTION);
- intent.setComponent(new ComponentName(context, MediaPlaybackService.class));
- pendingIntent = PendingIntent.getService(context,
+ intent = new Intent(context, MusicBrowserActivity.class);
+ pendingIntent = PendingIntent.getActivity(context,
0 /* no requestCode */, intent, 0 /* no flags */);
- views.setOnClickPendingIntent(R.id.control_play, pendingIntent);
+ views.setOnClickPendingIntent(R.id.album_gadget, pendingIntent);
}
+ intent = new Intent(MediaPlaybackService.TOGGLEPAUSE_ACTION);
+ intent.setComponent(serviceName);
+ pendingIntent = PendingIntent.getService(context,
+ 0 /* no requestCode */, intent, 0 /* no flags */);
+ views.setOnClickPendingIntent(R.id.control_play, pendingIntent);
+
intent = new Intent(MediaPlaybackService.NEXT_ACTION);
- pendingIntent = PendingIntent.getBroadcast(context,
+ intent.setComponent(serviceName);
+ pendingIntent = PendingIntent.getService(context,
0 /* no requestCode */, intent, 0 /* no flags */);
views.setOnClickPendingIntent(R.id.control_next, pendingIntent);
}
-
- /**
- * Scale and chop given album artwork to prepare as gadget background.
- */
- private static Bitmap scaleArtwork(Bitmap bitmap, Context context) {
- final int cutoutSize = (int) context.getResources().getDimension(R.dimen.gadget_cutout);
- final int srcWidth = bitmap.getWidth();
- final int srcHeight = bitmap.getHeight();
- final int srcDiameter = Math.min(srcWidth, srcHeight);
-
- // Figure out best circle size
- final Rect src = new Rect((srcWidth - srcDiameter) / 2,
- (srcHeight - srcDiameter) / 2, srcDiameter, srcDiameter);
- final Rect dest = new Rect(0, 0, cutoutSize, cutoutSize);
-
- final Bitmap thumb = Bitmap.createBitmap(cutoutSize, cutoutSize,
- Bitmap.Config.ARGB_8888);
-
- final Canvas canvas = new Canvas(thumb);
- final Paint paint = new Paint();
-
- paint.setAntiAlias(true);
-
- // Draw a mask circle using default paint
- final int radius = cutoutSize / 2;
- canvas.drawCircle(radius, radius, radius, paint);
-
- paint.setDither(false);
- paint.setFilterBitmap(true);
- paint.setAlpha(96);
-
- // Draw the actual album art, using the mask circle from earlier. Using
- // this approach allows us to alpha-blend the circle edges, which isn't
- // possible with Canvas.clipPath()
- paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
- canvas.drawBitmap(bitmap, src, dest, paint);
-
- return thumb;
- }
-
}
// This will have to change if we want to support multiple simultaneous cards.
private int mCardId;
+ private MediaGadgetProvider mGadgetProvider = MediaGadgetProvider.getInstance();
+
// interval after which we stop the service when idle
private static final int IDLE_DELAY = 60000;
next(false);
} else {
notifyChange(PLAYBACK_COMPLETE);
- pushGadgetUpdate();
}
break;
case RELEASE_WAKELOCK:
// Someone asked us to refresh a set of specific gadgets, probably
// because they were just added.
int[] gadgetIds = intent.getIntArrayExtra(GadgetManager.EXTRA_GADGET_IDS);
- MediaGadgetProvider.updateAllGadgets(MediaPlaybackService.this, gadgetIds);
+ mGadgetProvider.performUpdate(MediaPlaybackService.this, gadgetIds);
}
}
};
stop(true);
notifyChange(QUEUE_CHANGED);
notifyChange(META_CHANGED);
- pushGadgetUpdate();
}
/**
reloadQueue();
notifyChange(QUEUE_CHANGED);
notifyChange(META_CHANGED);
- pushGadgetUpdate();
}
}
};
} else {
saveQueue(false);
}
+
+ // Share this notification directly with our gadgets
+ mGadgetProvider.notifyChange(this, what);
}
private void ensurePlayListCapacity(int size) {
if (action == NOW) {
mPlayPos = mPlayListLen - list.length;
openCurrent();
- play(false /* we push update */);
+ play();
notifyChange(META_CHANGED);
- pushGadgetUpdate();
return;
}
}
if (mPlayPos < 0) {
mPlayPos = 0;
openCurrent();
- play(false /* we push update */);
+ play();
notifyChange(META_CHANGED);
- pushGadgetUpdate();
}
}
}
/**
* Starts playback of a previously opened file.
*/
- public void play(boolean shouldPushUpdate) {
+ public void play() {
if (mPlayer.isInitialized()) {
mPlayer.start();
setForeground(true);
- mWasPlaying = true;
NotificationManager nm = (NotificationManager)
getSystemService(Context.NOTIFICATION_SERVICE);
status.contentIntent = PendingIntent.getActivity(this, 0,
new Intent("com.android.music.PLAYBACK_VIEWER"), 0);
nm.notify(PLAYBACKSERVICE_STATUS, status);
- notifyChange(PLAYSTATE_CHANGED);
- if (shouldPushUpdate) {
- pushGadgetUpdate();
+ if (!mWasPlaying) {
+ notifyChange(PLAYSTATE_CHANGED);
}
+ mWasPlaying = true;
} else if (mPlayListLen <= 0) {
// This is mostly so that if you press 'play' on a bluetooth headset
// without every having played anything before, it will still play
}
}
- /**
- * Starts playback of a previously opened file.
- */
- public void play() {
- // Default play action should push gadget updates
- play(true);
- }
-
- /**
- * Push an update to all music gadgets.
- */
- private void pushGadgetUpdate() {
- MediaGadgetProvider.updateAllGadgets(this, null);
- }
-
private void stop(boolean remove_status_icon) {
if (mPlayer.isInitialized()) {
mPlayer.stop();
gotoIdleState();
}
setForeground(false);
- mWasPlaying = false;
+ if (remove_status_icon) {
+ mWasPlaying = false;
+ }
}
/**
mWasPlaying = false;
notifyChange(PLAYSTATE_CHANGED);
saveBookmarkIfNeeded();
- pushGadgetUpdate();
}
}
saveBookmarkIfNeeded();
stop(false);
openCurrent();
- play(false /* we push update */);
+ play();
notifyChange(META_CHANGED);
- pushGadgetUpdate();
}
}
// all done
gotoIdleState();
notifyChange(PLAYBACK_COMPLETE);
- pushGadgetUpdate();
return;
} else if (mRepeatMode == REPEAT_ALL || force) {
mPlayPos = 0;
saveBookmarkIfNeeded();
stop(false);
openCurrent();
- play(false /* we push update */);
+ play();
notifyChange(META_CHANGED);
- pushGadgetUpdate();
}
}
doAutoShuffleUpdate();
mPlayPos = 0;
openCurrent();
- play(false /* we push update */);
+ play();
notifyChange(META_CHANGED);
- pushGadgetUpdate();
return;
} else {
// failed to build a list of files to shuffle
stop(false);
mPlayPos = pos;
openCurrent();
- play(false /* we push update */);
+ play();
notifyChange(META_CHANGED);
- pushGadgetUpdate();
}
}
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);
}
}
};
int mIdIdx;
private PlaylistBrowserActivity mActivity = null;
private AsyncQueryHandler mQueryHandler;
+ private String mConstraint = null;
+ private boolean mConstraintIsValid = false;
class QueryHandler extends AsyncQueryHandler {
QueryHandler(ContentResolver res) {
@Override
public Cursor runQueryOnBackgroundThread(CharSequence constraint) {
- return mActivity.getPlaylistCursor(null, constraint.toString());
+ String s = constraint.toString();
+ if (mConstraintIsValid && (
+ (s == null && mConstraint == null) ||
+ (s != null && s.equals(mConstraint)))) {
+ return getCursor();
+ }
+ Cursor c = mActivity.getPlaylistCursor(null, s);
+ mConstraint = s;
+ mConstraintIsValid = true;
+ return c;
}
}
static class QueryListAdapter extends SimpleCursorAdapter {
private QueryBrowserActivity mActivity = null;
private AsyncQueryHandler mQueryHandler;
+ private String mConstraint = null;
+ private boolean mConstraintIsValid = false;
class QueryHandler extends AsyncQueryHandler {
QueryHandler(ContentResolver res) {
}
@Override
public Cursor runQueryOnBackgroundThread(CharSequence constraint) {
- return mActivity.getQueryCursor(null, constraint.toString());
+ String s = constraint.toString();
+ if (mConstraintIsValid && (
+ (s == null && mConstraint == null) ||
+ (s != null && s.equals(mConstraint)))) {
+ return getCursor();
+ }
+ Cursor c = mActivity.getQueryCursor(null, s);
+ mConstraint = s;
+ mConstraintIsValid = true;
+ return c;
}
}
MediaStore.Audio.Playlists.Members.AUDIO_ID
};
- MusicUtils.bindToService(this, this);
- }
-
- public void onServiceConnected(ComponentName name, IBinder service)
- {
- IntentFilter f = new IntentFilter();
- f.addAction(Intent.ACTION_MEDIA_SCANNER_STARTED);
- f.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED);
- f.addAction(Intent.ACTION_MEDIA_UNMOUNTED);
- f.addDataScheme("file");
- registerReceiver(mScanListener, f);
-
setContentView(R.layout.media_picker_activity);
mTrackList = getListView();
mTrackList.setOnCreateContextMenuListener(this);
mTrackList.setTextFilterEnabled(true);
}
mAdapter = (TrackListAdapter) getLastNonConfigurationInstance();
+
+ if (mAdapter != null) {
+ mAdapter.setActivity(this);
+ setListAdapter(mAdapter);
+ }
+ MusicUtils.bindToService(this, this);
+ }
+
+ public void onServiceConnected(ComponentName name, IBinder service)
+ {
+ IntentFilter f = new IntentFilter();
+ f.addAction(Intent.ACTION_MEDIA_SCANNER_STARTED);
+ f.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED);
+ f.addAction(Intent.ACTION_MEDIA_UNMOUNTED);
+ f.addDataScheme("file");
+ registerReceiver(mScanListener, f);
+
if (mAdapter == null) {
//Log.i("@@@", "starting query");
mAdapter = new TrackListAdapter(
setTitle(R.string.working_songs);
getTrackCursor(mAdapter.getQueryHandler(), null);
} else {
- mAdapter.setActivity(this);
- setListAdapter(mAdapter);
mTrackCursor = mAdapter.getCursor();
// If mTrackCursor is null, this can be because it doesn't have
// a cursor yet (because the initial query that sets its cursor
private TrackBrowserActivity mActivity = null;
private AsyncQueryHandler mQueryHandler;
+ private String mConstraint = null;
+ private boolean mConstraintIsValid = false;
class ViewHolder {
TextView line1;
@Override
public Cursor runQueryOnBackgroundThread(CharSequence constraint) {
- return mActivity.getTrackCursor(null, constraint.toString());
+ String s = constraint.toString();
+ if (mConstraintIsValid && (
+ (s == null && mConstraint == null) ||
+ (s != null && s.equals(mConstraint)))) {
+ return getCursor();
+ }
+ Cursor c = mActivity.getTrackCursor(null, s);
+ mConstraint = s;
+ mConstraintIsValid = true;
+ return c;
}
// SectionIndexer methods
public static int NO_SKIPPING_SONGS = 500;
public static final String DELETESONG = "/sdcard/toBeDeleted.amr";
- public static final String GOLDENSONG = "/sdcard/music/AMRNB.amr";
+ public static final String GOLDENSONG = "/sdcard/media_api/music/AMRNB.amr";
public static final String TOBEDELETESONGNAME = "toBeDeleted";
- public static int EXPECTED_NO_RINGTONE = 23;
+ public static int EXPECTED_NO_RINGTONE = 1;
}