diff options
author | Amith Yamasani <yamasani@google.com> | 2010-01-25 09:17:53 -0800 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2010-01-25 14:58:34 -0800 |
commit | 992f10240d0bfd78bb99855fe23ec7a1b61a2551 (patch) | |
tree | f898ca1a619aab382747bb2629fe51b6459df584 | |
parent | 3587f3d1bbd8c0ea525d216bd1c37ab948493671 (diff) | |
download | packages_apps_Settings-992f10240d0bfd78bb99855fe23ec7a1b61a2551.tar.gz packages_apps_Settings-992f10240d0bfd78bb99855fe23ec7a1b61a2551.tar.bz2 packages_apps_Settings-992f10240d0bfd78bb99855fe23ec7a1b61a2551.zip |
Refactor settings hierarchy and clump all volumes in one dialog.
Bug:2362077 Bug:2312836 Bug:2166486
Split Sound and Display into separate top-level settings.
All volume settings (including Alarm volume) now in one Volume dialog.
Remove some sub-texts to reduce clutter.
34 files changed, 393 insertions, 274 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 0f6dae3a6..a89db90d0 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -249,16 +249,28 @@ </intent-filter> </activity> - <activity android:name="SoundAndDisplaySettings" - android:label="@string/sound_and_display_settings_title" + <activity android:name="SoundSettings" + android:label="@string/sound_settings" android:clearTaskOnLaunch="true" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <action android:name="com.android.settings.SOUND_SETTINGS" /> + <action android:name="android.settings.SOUND_SETTINGS" /> + <category android:name="android.intent.category.DEFAULT" /> + <category android:name="android.intent.category.VOICE_LAUNCH" /> + <category android:name="com.android.settings.SHORTCUT" /> + </intent-filter> + </activity> + + <activity android:name="DisplaySettings" + android:label="@string/display_settings" + android:clearTaskOnLaunch="true" + > + <intent-filter> + <action android:name="android.intent.action.MAIN" /> <action android:name="com.android.settings.DISPLAY_SETTINGS" /> <action android:name="android.settings.DISPLAY_SETTINGS" /> - <action android:name="android.settings.SOUND_SETTINGS" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.VOICE_LAUNCH" /> <category android:name="com.android.settings.SHORTCUT" /> diff --git a/res/drawable-hdpi/ic_settings_display.png b/res/drawable-hdpi/ic_settings_display.png Binary files differindex 20568d227..8efbe760c 100644 --- a/res/drawable-hdpi/ic_settings_display.png +++ b/res/drawable-hdpi/ic_settings_display.png diff --git a/res/drawable-hdpi/ic_settings_sound_display.png b/res/drawable-hdpi/ic_settings_sound.png Binary files differindex 6ed90399e..6ed90399e 100755 --- a/res/drawable-hdpi/ic_settings_sound_display.png +++ b/res/drawable-hdpi/ic_settings_sound.png diff --git a/res/drawable-mdpi/ic_settings_display.png b/res/drawable-mdpi/ic_settings_display.png Binary files differindex b676b85f8..1e5628cbf 100644 --- a/res/drawable-mdpi/ic_settings_display.png +++ b/res/drawable-mdpi/ic_settings_display.png diff --git a/res/drawable-mdpi/ic_settings_sound_display.png b/res/drawable-mdpi/ic_settings_sound.png Binary files differindex 73c93bdf1..73c93bdf1 100755 --- a/res/drawable-mdpi/ic_settings_sound_display.png +++ b/res/drawable-mdpi/ic_settings_sound.png diff --git a/res/layout/preference_dialog_ringervolume.xml b/res/layout/preference_dialog_ringervolume.xml index a23e3131b..e8dc70444 100644 --- a/res/layout/preference_dialog_ringervolume.xml +++ b/res/layout/preference_dialog_ringervolume.xml @@ -34,7 +34,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/incoming_call_volume_title" - android:paddingTop="20dip" + android:paddingTop="10dip" android:paddingLeft="20dip" android:paddingRight="20dip" /> @@ -46,6 +46,36 @@ android:paddingLeft="20dip" android:paddingRight="20dip" /> + <!-- Used for the media volume --> + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/media_volume_title" + android:paddingTop="10dip" + android:paddingLeft="20dip" + android:paddingRight="20dip" /> + <SeekBar android:id="@+id/media_volume_seekbar" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingTop="6dip" + android:paddingLeft="20dip" + android:paddingRight="20dip" /> + + <!-- Used for the alarm volume --> + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/alarm_volume_title" + android:paddingTop="10dip" + android:paddingLeft="20dip" + android:paddingRight="20dip" /> + <SeekBar android:id="@+id/alarm_volume_seekbar" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingTop="6dip" + android:paddingLeft="20dip" + android:paddingRight="20dip" /> + <CheckBox android:id="@+id/same_notification_volume" android:layout_width="match_parent" android:layout_height="wrap_content" diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml index 44dc06921..17556c8a5 100644 --- a/res/values-cs/strings.xml +++ b/res/values-cs/strings.xml @@ -382,10 +382,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"Odpojování..."</string> <string name="status_disconnected" msgid="7561688569905126046">"Odpojeno"</string> <string name="status_failed" msgid="610462050405904601">"Připojení se nezdařilo."</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"Obraz a zvuk"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"Nastavení obrazu a zvuku"</string> <string name="sound_settings" msgid="5007659014828162881">"Nastavení zvuku"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"Umožňuje nastavit vyzváněcí tón, oznámení a jas obrazovky"</string> <string name="silent_mode_title" msgid="3181479108593217704">"Tichý režim"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"Ztiší všechny zvuky kromě médií a budíků"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"Všechny zvuky kromě médií jsou ztišeny."</string> diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml index 9822439b1..0b5abc259 100644 --- a/res/values-da/strings.xml +++ b/res/values-da/strings.xml @@ -382,10 +382,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"Afbryder ..."</string> <string name="status_disconnected" msgid="7561688569905126046">"Afbrudt"</string> <string name="status_failed" msgid="610462050405904601">"Mislykkedes"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"Lyd og visning"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"Indstillinger for lyd og visning"</string> <string name="sound_settings" msgid="5007659014828162881">"Indstillinger for lyd"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"Angiv ringetoner, meddelelser, skærmlysstyrke"</string> <string name="silent_mode_title" msgid="3181479108593217704">"Lydløs"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"Alle lyde undtagen medier og alarmer er slået fra"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"Al lyd undtagen medier er slået fra"</string> diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index 722655d18..dd25ee6e1 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -382,10 +382,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"Verbindung wird getrennt..."</string> <string name="status_disconnected" msgid="7561688569905126046">"Nicht verbunden"</string> <string name="status_failed" msgid="610462050405904601">"Fehlgeschlagen"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"Sound und Display"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"Einstellungen für Sound & Display"</string> <string name="sound_settings" msgid="5007659014828162881">"Toneinstellungen"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"Klingeltöne, Benachrichtigungen und Helligkeit festlegen"</string> <string name="silent_mode_title" msgid="3181479108593217704">"Lautlosmodus"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"Alle Töne außer für Medien und Warnungen sind stummgeschaltet"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"Alle Sounds außer Medien sind stumm geschaltet"</string> diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml index d90247ea4..18a8df544 100644 --- a/res/values-el/strings.xml +++ b/res/values-el/strings.xml @@ -382,10 +382,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"Αποσύνδεση..."</string> <string name="status_disconnected" msgid="7561688569905126046">"Αποσυνδέθηκε"</string> <string name="status_failed" msgid="610462050405904601">"Ανεπιτυχής"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"Ήχος και εικόνα"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"Ρυθμίσεις ήχου & προβολής"</string> <string name="sound_settings" msgid="5007659014828162881">"Ρυθμίσεις ήχου"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"Ρύθμιση ήχων κλήσης, ειδοποιήσεων, φωτεινότητας οθόνης"</string> <string name="silent_mode_title" msgid="3181479108593217704">"Λειτουργία σίγασης"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"Όλοι οι ήχοι εκτός των πολυμέσων & ξυπνητηριών έχουν σιγασθεί"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"Όλοι οι ήχοι εκτός από τους ήχους πολυμέσων έχουν σιγασθεί"</string> diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml index 47bb242c0..c8cb4231a 100644 --- a/res/values-es-rUS/strings.xml +++ b/res/values-es-rUS/strings.xml @@ -382,10 +382,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"Desconectando…"</string> <string name="status_disconnected" msgid="7561688569905126046">"Desconectado"</string> <string name="status_failed" msgid="610462050405904601">"Incorrecto"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"Sonido y visualización"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"Configuración de sonido y visualización"</string> <string name="sound_settings" msgid="5007659014828162881">"Configuración de sonido"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"Establecer tonos de llamada, notificaciones, brillo de pantalla"</string> <string name="silent_mode_title" msgid="3181479108593217704">"Modo silencioso"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"Todos los sonidos excepto los medios y las alarmas están en silencio"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"Todos los sonidos excepto los medios están en silencio"</string> diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml index add50e8d7..b311835b3 100644 --- a/res/values-es/strings.xml +++ b/res/values-es/strings.xml @@ -382,10 +382,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"Desconectando..."</string> <string name="status_disconnected" msgid="7561688569905126046">"Desconectada"</string> <string name="status_failed" msgid="610462050405904601">"Con error"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"Sonido y pantalla"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"Configuración de sonido y de pantalla"</string> <string name="sound_settings" msgid="5007659014828162881">"Configuración de sonido"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"Establecer tonos, notificaciones, brillo de la pantalla"</string> <string name="silent_mode_title" msgid="3181479108593217704">"Modo silencio"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"Silencio de todos los sonidos (excepto los multimedia y las alarmas)"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"Todos los sonidos excepto los multimedia están silenciados."</string> diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index ddc54901a..98c0290b1 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -382,10 +382,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"Déconnexion…"</string> <string name="status_disconnected" msgid="7561688569905126046">"Déconnecté"</string> <string name="status_failed" msgid="610462050405904601">"Échec"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"Sons et affichage"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"Paramètres des sons et affichages"</string> <string name="sound_settings" msgid="5007659014828162881">"Paramètres sonores"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"Configurer les sonneries, les notifications et la luminosité"</string> <string name="silent_mode_title" msgid="3181479108593217704">"Mode silencieux"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"Aucun son sauf pour le multimédia et le réveil"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"Toutes les sonneries seront définies sur Silencieux, sauf les fichiers multimédia."</string> diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml index 31f26c481..c2a0ee77e 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -382,10 +382,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"Disconnessione..."</string> <string name="status_disconnected" msgid="7561688569905126046">"Disconnesso"</string> <string name="status_failed" msgid="610462050405904601">"Non riuscita"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"Audio e display"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"Impostazioni audio e display"</string> <string name="sound_settings" msgid="5007659014828162881">"Impostazioni audio"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"Imposta suonerie, notifiche e luminosità dello schermo"</string> <string name="silent_mode_title" msgid="3181479108593217704">"Modalità silenziosa"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"Tutti i suoni eccetto quelli multimediali verranno disattivati"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"Tutti i suoni eccetto quelli multimediali verranno disattivati"</string> diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml index 058eaee42..ae51b3225 100644 --- a/res/values-ja/strings.xml +++ b/res/values-ja/strings.xml @@ -382,10 +382,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"切断中..."</string> <string name="status_disconnected" msgid="7561688569905126046">"切断"</string> <string name="status_failed" msgid="610462050405904601">"失敗"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"サウンド & 画面設定"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"音と表示の設定"</string> <string name="sound_settings" msgid="5007659014828162881">"音の設定"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"着信音、操作音、画面の明るさなど"</string> <string name="silent_mode_title" msgid="3181479108593217704">"マナーモード"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"音楽、動画メディア、アラーム以外は消音"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"音楽と動画メディア以外は消音"</string> diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml index abca2cb31..fc7e11e04 100644 --- a/res/values-ko/strings.xml +++ b/res/values-ko/strings.xml @@ -382,10 +382,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"연결을 끊는 중..."</string> <string name="status_disconnected" msgid="7561688569905126046">"연결 끊김"</string> <string name="status_failed" msgid="610462050405904601">"실패"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"소리 및 디스플레이"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"소리 및 디스플레이 설정"</string> <string name="sound_settings" msgid="5007659014828162881">"소리 설정"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"벨소리, 알림, 화면 밝기 설정"</string> <string name="silent_mode_title" msgid="3181479108593217704">"무음 모드"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"미디어 및 알람을 제외하고 모두 무음 모드로 전환"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"미디어를 제외하고 모두 무음 모드로 전환됩니다."</string> diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml index 30b7e8677..55b7d1953 100644 --- a/res/values-nb/strings.xml +++ b/res/values-nb/strings.xml @@ -382,10 +382,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"Kobler fra…"</string> <string name="status_disconnected" msgid="7561688569905126046">"Frakoblet"</string> <string name="status_failed" msgid="610462050405904601">"Mislykket"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"Lyd og skjerm"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"Lyd og bilde"</string> <string name="sound_settings" msgid="5007659014828162881">"Lydinnstillinger"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"Ringetoner, varsling, lysstyrke"</string> <string name="silent_mode_title" msgid="3181479108593217704">"Stillemodus"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"Slå av alle lyder unntatt media og alarmer"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"Alle lyder unntatt media og alarmer er slått av"</string> diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml index 3710ef49c..edf3d7e83 100644 --- a/res/values-nl/strings.xml +++ b/res/values-nl/strings.xml @@ -382,10 +382,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"Verbinding verbreken..."</string> <string name="status_disconnected" msgid="7561688569905126046">"Verbinding verbroken"</string> <string name="status_failed" msgid="610462050405904601">"Mislukt"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"Geluid en weergave"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"Geluid- en weergaveinstellingen"</string> <string name="sound_settings" msgid="5007659014828162881">"Geluidsinstellingen"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"Beltonen, meldingen, schermhelderheid instellen"</string> <string name="silent_mode_title" msgid="3181479108593217704">"Stille modus"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"Alle geluiden worden uitgeschakeld, behalve media- en alarmtonen"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"Alle geluiden, behalve media, worden uitgeschakeld"</string> diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml index 29c3d2272..05b9595ab 100644 --- a/res/values-pl/strings.xml +++ b/res/values-pl/strings.xml @@ -382,10 +382,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"Rozłączanie..."</string> <string name="status_disconnected" msgid="7561688569905126046">"Rozłączona"</string> <string name="status_failed" msgid="610462050405904601">"Niepowodzenie"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"Dźwięk i wyświetlacz"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"Ustawienia dźwięku i wyświetlania"</string> <string name="sound_settings" msgid="5007659014828162881">"Ustawienia dźwięku"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"Ustaw dzwonki, powiadomienia, jasność ekranu"</string> <string name="silent_mode_title" msgid="3181479108593217704">"Tryb cichy"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"Wszystkie dźwięki oprócz multimediów i alarmów są wyciszone"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"Wszystkie dźwięki za wyjątkiem multimediów są wyciszone"</string> diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml index 24aef1742..c2e2660e6 100644 --- a/res/values-pt-rPT/strings.xml +++ b/res/values-pt-rPT/strings.xml @@ -387,10 +387,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"A desligar..."</string> <string name="status_disconnected" msgid="7561688569905126046">"Desligado"</string> <string name="status_failed" msgid="610462050405904601">"Sem sucesso"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"Som e visualização"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"Definições de som e visualização"</string> <string name="sound_settings" msgid="5007659014828162881">"Definições de som"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"Definir toques, notificações, brilho do ecrã"</string> <string name="silent_mode_title" msgid="3181479108593217704">"Modo silencioso"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"Todos os sons são silenciados, excepto multimédia e alarmes"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"Todos os sons estão silenciados, excepto multimédia"</string> diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml index 827c32439..9c548b086 100644 --- a/res/values-pt/strings.xml +++ b/res/values-pt/strings.xml @@ -387,10 +387,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"Desconectando…"</string> <string name="status_disconnected" msgid="7561688569905126046">"Desconectado"</string> <string name="status_failed" msgid="610462050405904601">"Falha"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"Som e tela"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"Configurações de som e tela"</string> <string name="sound_settings" msgid="5007659014828162881">"Configurações de som"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"Definir toques, notificações, brilho da tela"</string> <string name="silent_mode_title" msgid="3181479108593217704">"Modo silencioso"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"Todos os sons, exceto de mídia e alarmes, são silenciados."</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"Todos os sons, exceto de mídia, estão silenciados"</string> diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml index 88e183c1e..47667ca51 100644 --- a/res/values-ru/strings.xml +++ b/res/values-ru/strings.xml @@ -382,10 +382,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"Отключение..."</string> <string name="status_disconnected" msgid="7561688569905126046">"Отключено"</string> <string name="status_failed" msgid="610462050405904601">"Сбой"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"Звук и изображение"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"Звук и изображение"</string> <string name="sound_settings" msgid="5007659014828162881">"Настройки звука"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"Настройка мелодий, уведомлений, яркости экрана"</string> <string name="silent_mode_title" msgid="3181479108593217704">"Бесшумный режим"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"Все звуки, кроме мультимедиа и будильника, отключены"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"Все звуки, кроме аудио и видео, отключены"</string> diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml index b707a68e1..8e550d9ba 100644 --- a/res/values-sv/strings.xml +++ b/res/values-sv/strings.xml @@ -382,10 +382,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"Kopplar ifrån…"</string> <string name="status_disconnected" msgid="7561688569905126046">"Frånkopplad"</string> <string name="status_failed" msgid="610462050405904601">"Misslyckades"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"Ljud och skärm"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"Inställningar för ljud och skärm"</string> <string name="sound_settings" msgid="5007659014828162881">"Ljudinställningar"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"Ställ in ringsignaler, aviseringar, skärmens ljusstryka"</string> <string name="silent_mode_title" msgid="3181479108593217704">"Tyst läge"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"Alla ljud utom media och larm tystas"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"Alla ljud utom media tystas"</string> diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml index d9b347f14..37b35710d 100644 --- a/res/values-tr/strings.xml +++ b/res/values-tr/strings.xml @@ -382,10 +382,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"Bağlantı kesiliyor…"</string> <string name="status_disconnected" msgid="7561688569905126046">"Bağlantı kesildi"</string> <string name="status_failed" msgid="610462050405904601">"Başarısız"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"Ses ve görüntü"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"Ses ve görüntü ayarları"</string> <string name="sound_settings" msgid="5007659014828162881">"Ses ayarları"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"Zil seslerini, bildirimleri, ekran parlaklığını ayarla"</string> <string name="silent_mode_title" msgid="3181479108593217704">"Sessiz mod"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"Medya ve alarmlar dışında tüm sesleri susturulur"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"Medya dışında tüm sesler susturulur"</string> diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml index aa9b80378..651b0ac47 100644 --- a/res/values-zh-rCN/strings.xml +++ b/res/values-zh-rCN/strings.xml @@ -382,10 +382,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"正在断开连接..."</string> <string name="status_disconnected" msgid="7561688569905126046">"已断开连接"</string> <string name="status_failed" msgid="610462050405904601">"失败"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"声音和显示"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"声音和显示设置"</string> <string name="sound_settings" msgid="5007659014828162881">"声音设置"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"设置铃声、通知和屏幕亮度"</string> <string name="silent_mode_title" msgid="3181479108593217704">"静音模式"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"除媒体和闹钟之外,所有声音均设为静音"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"对所有非多媒体声音进行静音处理"</string> diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml index 170681c54..d8127ccb4 100644 --- a/res/values-zh-rTW/strings.xml +++ b/res/values-zh-rTW/strings.xml @@ -382,10 +382,7 @@ <string name="status_disconnecting" msgid="8468213362967337584">"連線中斷..."</string> <string name="status_disconnected" msgid="7561688569905126046">"已中斷連線"</string> <string name="status_failed" msgid="610462050405904601">"失敗"</string> - <string name="sound_and_display_settings" msgid="349770582993029003">"音效與顯示"</string> - <string name="sound_and_display_settings_title" msgid="5036144539683697330">"音效與顯示設定"</string> <string name="sound_settings" msgid="5007659014828162881">"音效設定"</string> - <string name="sound_and_display_settings_summary" msgid="1433943789593286064">"設定鈴聲、通知與螢幕亮度"</string> <string name="silent_mode_title" msgid="3181479108593217704">"靜音模式"</string> <string name="silent_mode_summary" msgid="9081534746589616108">"將媒體和鬧鐘以外的所有音效靜音"</string> <string name="silent_mode_incl_alarm_summary" msgid="2088830834182228458">"將所有非媒體音效設為靜音"</string> diff --git a/res/values/strings.xml b/res/values/strings.xml index 86cd087e1..a70e7df09 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -713,15 +713,15 @@ <string name="ip_address">IP address</string> <!-- Label for the signal strength --> <string name="signal">Signal strength</string> - <!-- Summary text when turning Wi-Fi or bluetooth on --> + <!--Summary text when turning Wi-Fi or bluetooth on --> <string name="wifi_starting">Turning on\u2026</string> - <!-- Summary text when turning Wi-Fi or bluetooth off --> + <!--Summary text when turning Wi-Fi or bluetooth off --> <string name="wifi_stopping">Turning off\u2026</string> <!-- Summary text when Wi-Fi or bluetooth has error --> <string name="wifi_error">Error</string> <!-- Toast message when Wi-Fi or bluetooth is disallowed in airplane mode --> <string name="wifi_in_airplane_mode">In airplane mode</string> - <!-- Error message when Wi-Fi can't start --> + <!-- Error message when Wi-Fi can't start --> <string name="error_starting">Unable to start Wi-Fi</string> <!-- Error message when Wi-Fi can't stop --> <string name="error_stopping">Unable to stop Wi-Fi</string> @@ -952,28 +952,28 @@ <string name="status_failed">Unsuccessful</string> <!-- Sound and alerts settings --> - <!-- Main Settings screen setting option name to go into the sound and display settings screen --> - <string name="sound_and_display_settings">Sound & display</string> - <!-- Main Settings screen setting option name to go into the sound and display settings screen --> - <string name="sound_and_display_settings_title">Sound & display settings</string> + <!-- Main Settings screen setting option name to go into the sound settings screen --> + <string name="sound_settings_title">Sound</string> + <!-- Main Settings screen setting option name to go into the display settings screen --> + <string name="display_settings_title">Display</string> <!-- Sound settings screen heading --> <string name="sound_settings">Sound settings</string> - <!-- Main Settings screen setting option summary text for the item to go into the soudn and display settings screen--> - <string name="sound_and_display_settings_summary">Set ringtones, notifications, screen brightness</string> <!-- Sound settings screen, setting option name checkbox --> <string name="silent_mode_title">Silent mode</string> <!-- Sound settings screen, setting option summary text when going into silent mode. Media and alarms sounds WILL NOT be silenced in silent mode. --> - <string name="silent_mode_summary">All sounds except media & alarms are silenced</string> + <string name="silent_mode_summary">Silence all sounds except media & alarms</string> <!-- Sound settings screen, setting option summary text when going into silent mode. Media WILL NOT be silenced in silent mode, but alarms WILL be silenced. --> <string name="silent_mode_incl_alarm_summary">All sounds except media are silenced</string> <!-- Sound settings screen, setting option name to pick ringtone (a list dialog comes up)--> <string name="ringtone_title">Phone ringtone</string> <!-- Sound settings screen, setting option summary text --> - <string name="ringtone_summary">Set your default incoming call ringtone</string> + <string name="ringtone_summary">""</string> + <!-- Sound settings screen, volume title --> + <string name="all_volume_title">Volume</string> <!-- Sound settings screen, setting option name --> <string name="ring_volume_title">Ringer volume</string> <!-- Sound settings screen, setting option summary text --> - <string name="ring_volume_summary">Set volume for incoming calls and notifications</string> + <string name="ring_volume_summary">""</string> <!-- Sound settings screen, setting option name checkbox --> <string name="vibrate_title">Phone vibrate</string> <!-- Sound settings screen, setting option summary text --> @@ -981,7 +981,7 @@ <!-- Sound settings screen, setting option name --> <string name="notification_sound_title">Notification ringtone</string> <!-- Sound settings screen, setting option summary text --> - <string name="notification_sound_summary">Set your default notification ringtone</string> + <string name="notification_sound_summary">""</string> <!-- Sound settings screen, notification light repeat pulsing title --> <string name="notification_pulse_title">Pulse notification light</string> <!-- Sound settings screen, notification light repeat pulsing summary --> @@ -999,6 +999,8 @@ <string name="media_volume_title">Media volume</string> <!-- Sound settings screen, setting option summary text --> <string name="media_volume_summary">Set volume for music and videos</string> + <!-- Sound settings screen, alarm volume slider title --> + <string name="alarm_volume_title">Alarm volume</string> <!-- Sound settings screen, dock settings summary--> <string name="dock_settings_summary">Audio settings for the attached dock</string> <!-- Sound settings screen, setting check box label --> @@ -1069,7 +1071,7 @@ <!-- Sound & display settings screen, animations option summary text when check box is clear --> <string name="animations_summary_off">Show animation when opening & closing windows</string> <!-- Sound & display settings screen, accelerometer-based rotation check box label --> - <string name="accelerometer_title">Orientation</string> + <string name="accelerometer_title">Auto-rotate screen</string> <!-- Sound & display settings screen, accelerometer-based rotation summary text when check box is selected --> <string name="accelerometer_summary_on">Switch orientation automatically when rotating phone</string> <!-- Sound & display settings screen, accelerometer-based rotation summary text when check box is clear --> @@ -1133,7 +1135,7 @@ <!-- About phone screen, list item title. Takes the user to the screen for seeing and installing system updates. --> <string name="system_update_settings_list_item_title">System updates</string> <!-- About phone screen, list item summary. Takes the user to the screen for seeing and installing system updates. --> - <string name="system_update_settings_list_item_summary">Check for system updates</string> + <string name="system_update_settings_list_item_summary">""</string> <!-- About phone screen, status item label --> <string name="firmware_version">Firmware version</string> @@ -1570,6 +1572,10 @@ <string name="sort_order_size">Sort by size</string> <!-- Manage applications screen, individual app screen, button label when the user wants to manage the space taken up by an app. --> <string name="manage_space_text">Manage space</string> + <!-- Text for menu option in ManageApps screen to present various menu options --> + <string name="filter">Filter</string> + <!-- Title of dialog for presenting filter options --> + <string name="filter_dlg_title">Select filter options</string> <!-- Text for filter option in ManageApps screen to display all installed applications --> <string name="filter_apps_all">All</string> @@ -1656,9 +1662,9 @@ found in the list of installed applications.</string> <!-- On Text & language settings screen, heading. Inside the "Locale & text" screen, this is the header for settings that relate to text (autotext, autoreplace, autocapitalization). --> <string name="text_category">Text settings</string> <!-- On Text & language settings screen, setting option name. title of the setting to take the user to a screen to select the locale. --> - <string name="phone_language">Select locale</string> + <string name="phone_language">Select language</string> <!-- On Text & language settings screen, setting option name. summary of the setting to take the user to a screen to select the locale. --> - <string name="phone_language_summary">Select language and region</string> + <string name="phone_language_summary">""</string> <!-- On Text & language settings screen, setting option name. title of the setting to enable autoreplace of entered text. auto replace is a feature that will automatically correct mistyped words. --> <string name="auto_replace">Auto-replace</string> <!-- On Text & language settings screen, setting summary. This is the summary for the "Auto-replace" setting. --> @@ -1691,7 +1697,7 @@ found in the list of installed applications.</string> <!-- User dictionary settings, The title of the list item to go into the User dictionary settings screen. --> <string name="user_dict_settings_title">User dictionary</string> <!-- User dictionary settings. The summary of the listem item to go into the User dictionary settings screen. --> - <string name="user_dict_settings_summary">Add & remove words from user dictionary</string> + <string name="user_dict_settings_summary">""</string> <!-- User dictionary settings. The title of the menu item to add a new word to the user dictionary. --> <string name="user_dict_settings_add_menu_title">Add</string> <!-- User dictionary settings. The title of the dialog to add a new word to the user dictionary. --> @@ -2336,7 +2342,7 @@ found in the list of installed applications.</string> <string name="remove_device_admin">Remove</string> <!-- Label for screen showing to select device policy --> <string name="select_device_admin_msg">Select device administrator</string> - + <!-- Name to assign to a Network Access Point that was saved without a name --> <string name="untitled_apn">Untitled</string> </resources> diff --git a/res/xml/display_settings.xml b/res/xml/display_settings.xml new file mode 100644 index 000000000..5b7392483 --- /dev/null +++ b/res/xml/display_settings.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2010 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. +--> + +<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" + android:title="@string/display_settings" + xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"> + + <com.android.settings.BrightnessPreference + android:key="brightness" + android:title="@string/brightness" + android:dialogIcon="@drawable/ic_popup_brightness" + android:dialogTitle="@string/brightness" /> + + <CheckBoxPreference + android:key="accelerometer" + android:title="@string/accelerometer_title"/> + + <ListPreference + android:key="animations" + android:title="@string/animations_title" + android:persistent="false" + android:entries="@array/animations_entries" + android:entryValues="@array/animations_values" /> + + <ListPreference + android:key="screen_timeout" + android:title="@string/screen_timeout" + android:summary="@string/screen_timeout_summary" + android:persistent="false" + android:entries="@array/screen_timeout_entries" + android:entryValues="@array/screen_timeout_values" /> +</PreferenceScreen> diff --git a/res/xml/settings.xml b/res/xml/settings.xml index 22f252345..00e4205d8 100644 --- a/res/xml/settings.xml +++ b/res/xml/settings.xml @@ -39,15 +39,26 @@ android:targetClass="com.android.phone.CallFeaturesSetting" /> </com.android.settings.IconPreferenceScreen> - <!-- Sound and Display --> + <!-- Sound --> <com.android.settings.IconPreferenceScreen - settings:icon="@drawable/ic_settings_sound_display" - android:title="@string/sound_and_display_settings"> + settings:icon="@drawable/ic_settings_sound" + android:title="@string/sound_settings_title"> <intent android:action="android.intent.action.MAIN" android:targetPackage="com.android.settings" - android:targetClass="com.android.settings.SoundAndDisplaySettings" /> + android:targetClass="com.android.settings.SoundSettings" /> + </com.android.settings.IconPreferenceScreen> + + <!-- Display --> + + <com.android.settings.IconPreferenceScreen + settings:icon="@drawable/ic_settings_display" + android:title="@string/display_settings_title"> + <intent + android:action="android.intent.action.MAIN" + android:targetPackage="com.android.settings" + android:targetClass="com.android.settings.DisplaySettings" /> </com.android.settings.IconPreferenceScreen> <!-- Security & Location --> diff --git a/res/xml/sound_and_display_settings.xml b/res/xml/sound_settings.xml index 9ac3692e3..c8a8d9765 100644 --- a/res/xml/sound_and_display_settings.xml +++ b/res/xml/sound_settings.xml @@ -15,11 +15,10 @@ --> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" + android:title="@string/sound_settings" + android:key="sound_settings" xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"> - <PreferenceCategory android:key="sound_settings" - android:title="@string/sound_settings"> - <CheckBoxPreference android:key="silent" android:title="@string/silent_mode_title" @@ -30,23 +29,14 @@ <com.android.settings.RingerVolumePreference android:key="ring_volume" - android:title="@string/ring_volume_title" + android:title="@string/all_volume_title" android:summary="@string/ring_volume_summary" - android:dialogTitle="@string/ring_volume_title" + android:dialogTitle="@string/all_volume_title" android:persistent="false" android:dependency="silent" android:order="2" android:streamType="ring" /> - <VolumePreference - android:key="media_volume" - android:title="@string/media_volume_title" - android:summary="@string/media_volume_summary" - android:dialogTitle="@string/media_volume_title" - android:persistent="false" - android:order="3" - android:streamType="music" /> - <com.android.settings.DefaultRingtonePreference android:key="ringtone" android:title="@string/ringtone_title" @@ -116,45 +106,11 @@ android:order="12" android:defaultValue="true" /> - </PreferenceCategory> - - <ListPreference - android:key="emergency_tone" - android:title="@string/emergency_tone_title" - android:summary="@string/emergency_tone_summary" - android:entries="@array/emergency_tone_entries" - android:entryValues="@array/emergency_tone_values" /> - - <PreferenceCategory - android:title="@string/display_settings"> - - <CheckBoxPreference - android:key="accelerometer" - android:title="@string/accelerometer_title" - android:summaryOn="@string/accelerometer_summary_on" - android:summaryOff="@string/accelerometer_summary_off"/> - <ListPreference - android:key="animations" - android:title="@string/animations_title" - android:persistent="false" - android:entries="@array/animations_entries" - android:entryValues="@array/animations_values" /> - - <com.android.settings.BrightnessPreference - android:key="brightness" - android:title="@string/brightness" - android:summary="@string/brightness_summary" - android:dialogIcon="@drawable/ic_popup_brightness" - android:dialogTitle="@string/brightness" /> - - <ListPreference - android:key="screen_timeout" - android:title="@string/screen_timeout" - android:summary="@string/screen_timeout_summary" - android:persistent="false" - android:entries="@array/screen_timeout_entries" - android:entryValues="@array/screen_timeout_values" /> - </PreferenceCategory> + android:key="emergency_tone" + android:title="@string/emergency_tone_title" + android:summary="@string/emergency_tone_summary" + android:entries="@array/emergency_tone_entries" + android:entryValues="@array/emergency_tone_values" /> </PreferenceScreen> diff --git a/src/com/android/settings/DisplaySettings.java b/src/com/android/settings/DisplaySettings.java new file mode 100644 index 000000000..28a5829f2 --- /dev/null +++ b/src/com/android/settings/DisplaySettings.java @@ -0,0 +1,177 @@ +/* + * Copyright (C) 2010 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.settings; + +import static android.provider.Settings.System.SCREEN_OFF_TIMEOUT; + +import com.android.settings.bluetooth.DockEventReceiver; + +import android.content.BroadcastReceiver; +import android.content.ContentResolver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.media.AudioManager; +import android.os.Bundle; +import android.os.IMountService; +import android.os.RemoteException; +import android.os.ServiceManager; +import android.preference.CheckBoxPreference; +import android.preference.ListPreference; +import android.preference.Preference; +import android.preference.PreferenceActivity; +import android.preference.PreferenceGroup; +import android.preference.PreferenceScreen; +import android.provider.Settings; +import android.provider.Settings.SettingNotFoundException; +import android.telephony.TelephonyManager; +import android.util.Log; +import android.view.IWindowManager; + +public class DisplaySettings extends PreferenceActivity implements + Preference.OnPreferenceChangeListener { + private static final String TAG = "DisplaySettings"; + + /** If there is no setting in the provider, use this. */ + private static final int FALLBACK_SCREEN_TIMEOUT_VALUE = 30000; + + private static final String KEY_SCREEN_TIMEOUT = "screen_timeout"; + private static final String KEY_ANIMATIONS = "animations"; + private static final String KEY_ACCELEROMETER = "accelerometer"; + + private ListPreference mAnimations; + private CheckBoxPreference mAccelerometer; + private float[] mAnimationScales; + + private IWindowManager mWindowManager; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + ContentResolver resolver = getContentResolver(); + mWindowManager = IWindowManager.Stub.asInterface(ServiceManager.getService("window")); + + addPreferencesFromResource(R.xml.display_settings); + + mAnimations = (ListPreference) findPreference(KEY_ANIMATIONS); + mAnimations.setOnPreferenceChangeListener(this); + mAccelerometer = (CheckBoxPreference) findPreference(KEY_ACCELEROMETER); + mAccelerometer.setPersistent(false); + + ListPreference screenTimeoutPreference = + (ListPreference) findPreference(KEY_SCREEN_TIMEOUT); + screenTimeoutPreference.setValue(String.valueOf(Settings.System.getInt( + resolver, SCREEN_OFF_TIMEOUT, FALLBACK_SCREEN_TIMEOUT_VALUE))); + screenTimeoutPreference.setOnPreferenceChangeListener(this); + + } + + @Override + protected void onResume() { + super.onResume(); + + updateState(true); + } + + private void updateState(boolean force) { + int animations = 0; + try { + mAnimationScales = mWindowManager.getAnimationScales(); + } catch (RemoteException e) { + } + if (mAnimationScales != null) { + if (mAnimationScales.length >= 1) { + animations = ((int)(mAnimationScales[0]+.5f)) % 10; + } + if (mAnimationScales.length >= 2) { + animations += (((int)(mAnimationScales[1]+.5f)) & 0x7) * 10; + } + } + int idx = 0; + int best = 0; + CharSequence[] aents = mAnimations.getEntryValues(); + for (int i=0; i<aents.length; i++) { + int val = Integer.parseInt(aents[i].toString()); + if (val <= animations && val > best) { + best = val; + idx = i; + } + } + mAnimations.setValueIndex(idx); + updateAnimationsSummary(mAnimations.getValue()); + mAccelerometer.setChecked(Settings.System.getInt( + getContentResolver(), + Settings.System.ACCELEROMETER_ROTATION, 0) != 0); + } + + private void updateAnimationsSummary(Object value) { + CharSequence[] summaries = getResources().getTextArray(R.array.animations_summaries); + CharSequence[] values = mAnimations.getEntryValues(); + for (int i=0; i<values.length; i++) { + //Log.i("foo", "Comparing entry "+ values[i] + " to current " + // + mAnimations.getValue()); + if (values[i].equals(value)) { + mAnimations.setSummary(summaries[i]); + break; + } + } + } + + @Override + public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) { + if (preference == mAccelerometer) { + Settings.System.putInt(getContentResolver(), + Settings.System.ACCELEROMETER_ROTATION, + mAccelerometer.isChecked() ? 1 : 0); + } + return true; + } + + public boolean onPreferenceChange(Preference preference, Object objValue) { + final String key = preference.getKey(); + if (KEY_ANIMATIONS.equals(key)) { + try { + int value = Integer.parseInt((String) objValue); + if (mAnimationScales.length >= 1) { + mAnimationScales[0] = value%10; + } + if (mAnimationScales.length >= 2) { + mAnimationScales[1] = (value/10)%10; + } + try { + mWindowManager.setAnimationScales(mAnimationScales); + } catch (RemoteException e) { + } + updateAnimationsSummary(objValue); + } catch (NumberFormatException e) { + Log.e(TAG, "could not persist animation setting", e); + } + + } + if (KEY_SCREEN_TIMEOUT.equals(key)) { + int value = Integer.parseInt((String) objValue); + try { + Settings.System.putInt(getContentResolver(), + SCREEN_OFF_TIMEOUT, value); + } catch (NumberFormatException e) { + Log.e(TAG, "could not persist screen timeout setting", e); + } + } + + return true; + } +} diff --git a/src/com/android/settings/RingerVolumePreference.java b/src/com/android/settings/RingerVolumePreference.java index 0d0196573..a546818c0 100644 --- a/src/com/android/settings/RingerVolumePreference.java +++ b/src/com/android/settings/RingerVolumePreference.java @@ -39,16 +39,28 @@ public class RingerVolumePreference extends VolumePreference implements private static final String TAG = "RingerVolumePreference"; private CheckBox mNotificationsUseRingVolumeCheckbox; - private SeekBarVolumizer mNotificationSeekBarVolumizer; + private SeekBarVolumizer [] mSeekBarVolumizer; + private static final int[] SEEKBAR_ID = new int[] { + R.id.notification_volume_seekbar, + R.id.media_volume_seekbar, + R.id.alarm_volume_seekbar + }; + private static final int[] SEEKBAR_TYPE = new int[] { + AudioManager.STREAM_NOTIFICATION, + AudioManager.STREAM_MUSIC, + AudioManager.STREAM_ALARM + }; + //private SeekBarVolumizer mNotificationSeekBarVolumizer; private TextView mNotificationVolumeTitle; - + public RingerVolumePreference(Context context, AttributeSet attrs) { super(context, attrs); // The always visible seekbar is for ring volume setStreamType(AudioManager.STREAM_RING); - + setDialogLayoutResource(R.layout.preference_dialog_ringervolume); + mSeekBarVolumizer = new SeekBarVolumizer[SEEKBAR_ID.length]; } @Override @@ -61,13 +73,14 @@ public class RingerVolumePreference extends VolumePreference implements mNotificationsUseRingVolumeCheckbox.setChecked(Settings.System.getInt( getContext().getContentResolver(), Settings.System.NOTIFICATIONS_USE_RING_VOLUME, 1) == 1); - - final SeekBar seekBar = (SeekBar) view.findViewById(R.id.notification_volume_seekbar); - mNotificationSeekBarVolumizer = new SeekBarVolumizer(getContext(), seekBar, - AudioManager.STREAM_NOTIFICATION); - + + for (int i = 0; i < SEEKBAR_ID.length; i++) { + SeekBar seekBar = (SeekBar) view.findViewById(SEEKBAR_ID[i]); + mSeekBarVolumizer[i] = new SeekBarVolumizer(getContext(), seekBar, + SEEKBAR_TYPE[i]); + } + mNotificationVolumeTitle = (TextView) view.findViewById(R.id.notification_volume_title); - setNotificationVolumeVisibility(!mNotificationsUseRingVolumeCheckbox.isChecked()); } @@ -75,10 +88,11 @@ public class RingerVolumePreference extends VolumePreference implements protected void onDialogClosed(boolean positiveResult) { super.onDialogClosed(positiveResult); - if (!positiveResult && mNotificationSeekBarVolumizer != null) { - mNotificationSeekBarVolumizer.revertVolume(); - } - + if (!positiveResult) { + for (SeekBarVolumizer vol : mSeekBarVolumizer) { + if (vol != null) vol.revertVolume(); + } + } cleanup(); } @@ -107,29 +121,28 @@ public class RingerVolumePreference extends VolumePreference implements @Override protected void onSampleStarting(SeekBarVolumizer volumizer) { super.onSampleStarting(volumizer); - - if (mNotificationSeekBarVolumizer != null && volumizer != mNotificationSeekBarVolumizer) { - mNotificationSeekBarVolumizer.stopSample(); + for (SeekBarVolumizer vol : mSeekBarVolumizer) { + if (vol != volumizer) vol.stopSample(); } } private void setNotificationVolumeVisibility(boolean visible) { - if (mNotificationSeekBarVolumizer != null) { - mNotificationSeekBarVolumizer.getSeekBar().setVisibility( - visible ? View.VISIBLE : View.GONE); - mNotificationVolumeTitle.setVisibility(visible ? View.VISIBLE : View.GONE); - } + mSeekBarVolumizer[0].getSeekBar().setVisibility( + visible ? View.VISIBLE : View.GONE); + mNotificationVolumeTitle.setVisibility(visible ? View.VISIBLE : View.GONE); } - + private void cleanup() { - if (mNotificationSeekBarVolumizer != null) { - Dialog dialog = getDialog(); - if (dialog != null && dialog.isShowing()) { - // Stopped while dialog was showing, revert changes - mNotificationSeekBarVolumizer.revertVolume(); + for (int i = 0; i < SEEKBAR_ID.length; i++) { + if (mSeekBarVolumizer[i] != null) { + Dialog dialog = getDialog(); + if (dialog != null && dialog.isShowing()) { + // Stopped while dialog was showing, revert changes + mSeekBarVolumizer[i].revertVolume(); + } + mSeekBarVolumizer[i].stop(); + mSeekBarVolumizer[i] = null; } - mNotificationSeekBarVolumizer.stop(); - mNotificationSeekBarVolumizer = null; } } @@ -142,8 +155,12 @@ public class RingerVolumePreference extends VolumePreference implements } final SavedState myState = new SavedState(superState); - if (mNotificationSeekBarVolumizer != null) { - mNotificationSeekBarVolumizer.onSaveInstanceState(myState.getVolumeStore()); + VolumeStore[] volumeStore = myState.getVolumeStore(SEEKBAR_ID.length); + for (int i = 0; i < SEEKBAR_ID.length; i++) { + SeekBarVolumizer vol = mSeekBarVolumizer[i]; + if (vol != null) { + vol.onSaveInstanceState(volumeStore[i]); + } } return myState; } @@ -158,28 +175,44 @@ public class RingerVolumePreference extends VolumePreference implements SavedState myState = (SavedState) state; super.onRestoreInstanceState(myState.getSuperState()); - if (mNotificationSeekBarVolumizer != null) { - mNotificationSeekBarVolumizer.onRestoreInstanceState(myState.getVolumeStore()); + VolumeStore[] volumeStore = myState.getVolumeStore(SEEKBAR_ID.length); + for (int i = 0; i < SEEKBAR_ID.length; i++) { + SeekBarVolumizer vol = mSeekBarVolumizer[i]; + if (vol != null) { + vol.onRestoreInstanceState(volumeStore[i]); + } } } private static class SavedState extends BaseSavedState { - VolumeStore mVolumeStore = new VolumeStore(); + VolumeStore [] mVolumeStore; public SavedState(Parcel source) { super(source); - mVolumeStore.volume = source.readInt(); - mVolumeStore.originalVolume = source.readInt(); + mVolumeStore = new VolumeStore[SEEKBAR_ID.length]; + for (int i = 0; i < SEEKBAR_ID.length; i++) { + mVolumeStore[i] = new VolumeStore(); + mVolumeStore[i].volume = source.readInt(); + mVolumeStore[i].originalVolume = source.readInt(); + } } @Override public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); - dest.writeInt(mVolumeStore.volume); - dest.writeInt(mVolumeStore.originalVolume); + for (int i = 0; i < SEEKBAR_ID.length; i++) { + dest.writeInt(mVolumeStore[i].volume); + dest.writeInt(mVolumeStore[i].originalVolume); + } } - VolumeStore getVolumeStore() { + VolumeStore[] getVolumeStore(int count) { + if (mVolumeStore == null || mVolumeStore.length != count) { + mVolumeStore = new VolumeStore[count]; + for (int i = 0; i < count; i++) { + mVolumeStore[i] = new VolumeStore(); + } + } return mVolumeStore; } diff --git a/src/com/android/settings/SoundAndDisplaySettings.java b/src/com/android/settings/SoundSettings.java index 29eb8783b..9ac2fe1f1 100644 --- a/src/com/android/settings/SoundAndDisplaySettings.java +++ b/src/com/android/settings/SoundSettings.java @@ -40,7 +40,7 @@ import android.telephony.TelephonyManager; import android.util.Log; import android.view.IWindowManager; -public class SoundAndDisplaySettings extends PreferenceActivity implements +public class SoundSettings extends PreferenceActivity implements Preference.OnPreferenceChangeListener { private static final String TAG = "SoundAndDisplaysSettings"; @@ -50,12 +50,9 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements private static final String KEY_SILENT = "silent"; private static final String KEY_VIBRATE = "vibrate"; - private static final String KEY_SCREEN_TIMEOUT = "screen_timeout"; private static final String KEY_DTMF_TONE = "dtmf_tone"; private static final String KEY_SOUND_EFFECTS = "sound_effects"; private static final String KEY_HAPTIC_FEEDBACK = "haptic_feedback"; - private static final String KEY_ANIMATIONS = "animations"; - private static final String KEY_ACCELEROMETER = "accelerometer"; private static final String KEY_PLAY_MEDIA_NOTIFICATION_SOUNDS = "play_media_notification_sounds"; private static final String KEY_EMERGENCY_TONE = "emergency_tone"; @@ -79,15 +76,10 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements private CheckBoxPreference mDtmfTone; private CheckBoxPreference mSoundEffects; private CheckBoxPreference mHapticFeedback; - private ListPreference mAnimations; - private CheckBoxPreference mAccelerometer; private CheckBoxPreference mNotificationPulse; - private float[] mAnimationScales; private AudioManager mAudioManager; - private IWindowManager mWindowManager; - private BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { @@ -106,11 +98,10 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements int activePhoneType = TelephonyManager.getDefault().getPhoneType(); mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); - mWindowManager = IWindowManager.Stub.asInterface(ServiceManager.getService("window")); mMountService = IMountService.Stub.asInterface(ServiceManager.getService("mount")); - addPreferencesFromResource(R.xml.sound_and_display_settings); + addPreferencesFromResource(R.xml.sound_settings); if (TelephonyManager.PHONE_TYPE_CDMA != activePhoneType) { // device is not CDMA, do not display CDMA emergency_tone @@ -133,16 +124,6 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements mHapticFeedback.setPersistent(false); mHapticFeedback.setChecked(Settings.System.getInt(resolver, Settings.System.HAPTIC_FEEDBACK_ENABLED, 0) != 0); - mAnimations = (ListPreference) findPreference(KEY_ANIMATIONS); - mAnimations.setOnPreferenceChangeListener(this); - mAccelerometer = (CheckBoxPreference) findPreference(KEY_ACCELEROMETER); - mAccelerometer.setPersistent(false); - - ListPreference screenTimeoutPreference = - (ListPreference) findPreference(KEY_SCREEN_TIMEOUT); - screenTimeoutPreference.setValue(String.valueOf(Settings.System.getInt( - resolver, SCREEN_OFF_TIMEOUT, FALLBACK_SCREEN_TIMEOUT_VALUE))); - screenTimeoutPreference.setOnPreferenceChangeListener(this); if (TelephonyManager.PHONE_TYPE_CDMA == activePhoneType) { ListPreference emergencyTonePreference = @@ -219,47 +200,6 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements R.string.silent_mode_incl_alarm_summary : R.string.silent_mode_summary); - int animations = 0; - try { - mAnimationScales = mWindowManager.getAnimationScales(); - } catch (RemoteException e) { - } - if (mAnimationScales != null) { - if (mAnimationScales.length >= 1) { - animations = ((int)(mAnimationScales[0]+.5f)) % 10; - } - if (mAnimationScales.length >= 2) { - animations += (((int)(mAnimationScales[1]+.5f)) & 0x7) * 10; - } - } - int idx = 0; - int best = 0; - CharSequence[] aents = mAnimations.getEntryValues(); - for (int i=0; i<aents.length; i++) { - int val = Integer.parseInt(aents[i].toString()); - if (val <= animations && val > best) { - best = val; - idx = i; - } - } - mAnimations.setValueIndex(idx); - updateAnimationsSummary(mAnimations.getValue()); - mAccelerometer.setChecked(Settings.System.getInt( - getContentResolver(), - Settings.System.ACCELEROMETER_ROTATION, 0) != 0); - } - - private void updateAnimationsSummary(Object value) { - CharSequence[] summaries = getResources().getTextArray(R.array.animations_summaries); - CharSequence[] values = mAnimations.getEntryValues(); - for (int i=0; i<values.length; i++) { - //Log.i("foo", "Comparing entry "+ values[i] + " to current " - // + mAnimations.getValue()); - if (values[i].equals(value)) { - mAnimations.setSummary(summaries[i]); - break; - } - } } private void setRingerMode(boolean silent, boolean vibrate) { @@ -301,10 +241,6 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements Settings.System.putInt(getContentResolver(), Settings.System.HAPTIC_FEEDBACK_ENABLED, mHapticFeedback.isChecked() ? 1 : 0); - } else if (preference == mAccelerometer) { - Settings.System.putInt(getContentResolver(), - Settings.System.ACCELEROMETER_ROTATION, - mAccelerometer.isChecked() ? 1 : 0); } else if (preference == mNotificationPulse) { boolean value = mNotificationPulse.isChecked(); Settings.System.putInt(getContentResolver(), @@ -316,34 +252,7 @@ public class SoundAndDisplaySettings extends PreferenceActivity implements public boolean onPreferenceChange(Preference preference, Object objValue) { final String key = preference.getKey(); - if (KEY_ANIMATIONS.equals(key)) { - try { - int value = Integer.parseInt((String) objValue); - if (mAnimationScales.length >= 1) { - mAnimationScales[0] = value%10; - } - if (mAnimationScales.length >= 2) { - mAnimationScales[1] = (value/10)%10; - } - try { - mWindowManager.setAnimationScales(mAnimationScales); - } catch (RemoteException e) { - } - updateAnimationsSummary(objValue); - } catch (NumberFormatException e) { - Log.e(TAG, "could not persist animation setting", e); - } - - } - if (KEY_SCREEN_TIMEOUT.equals(key)) { - int value = Integer.parseInt((String) objValue); - try { - Settings.System.putInt(getContentResolver(), - SCREEN_OFF_TIMEOUT, value); - } catch (NumberFormatException e) { - Log.e(TAG, "could not persist screen timeout setting", e); - } - } else if (KEY_EMERGENCY_TONE.equals(key)) { + if (KEY_EMERGENCY_TONE.equals(key)) { int value = Integer.parseInt((String) objValue); try { Settings.System.putInt(getContentResolver(), diff --git a/src/com/android/settings/fuelgauge/PowerUsageDetail.java b/src/com/android/settings/fuelgauge/PowerUsageDetail.java index 0c44c40b7..a98bfed67 100644 --- a/src/com/android/settings/fuelgauge/PowerUsageDetail.java +++ b/src/com/android/settings/fuelgauge/PowerUsageDetail.java @@ -271,7 +271,7 @@ public class PowerUsageDetail extends Activity implements Button.OnClickListener } break; case SCREEN: - addControl(R.string.sound_and_display_settings, + addControl(R.string.display_settings, R.string.battery_sugg_display, ACTION_DISPLAY_SETTINGS); removeHeader = false; |