Remove extra labels from Volume settings.

Bug: 3013561
This commit is contained in:
Amith Yamasani
2010-10-29 10:27:26 -07:00
parent 6257bf8675
commit 99d71d5718
2 changed files with 10 additions and 7 deletions

View File

@@ -31,6 +31,7 @@
android:paddingTop="20dip" /> android:paddingTop="20dip" />
<TextView <TextView
android:id="@+id/ringtone_label"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/incoming_call_volume_title" android:text="@string/incoming_call_volume_title"

View File

@@ -47,8 +47,9 @@ public class RingerVolumePreference extends VolumePreference implements
}; };
private static final int[] NEED_VOICE_CAPABILITY_ID = new int[] { private static final int[] NEED_VOICE_CAPABILITY_ID = new int[] {
com.android.internal.R.id.seekbar, R.id.notification_volume_title, R.id.ringtone_label,
R.id.notification_volume_seekbar com.android.internal.R.id.seekbar,
R.id.same_notification_volume
}; };
private static final int[] SEEKBAR_TYPE = new int[] { private static final int[] SEEKBAR_TYPE = new int[] {
@@ -85,16 +86,17 @@ public class RingerVolumePreference extends VolumePreference implements
mNotificationsUseRingVolumeCheckbox = mNotificationsUseRingVolumeCheckbox =
(CheckBox) view.findViewById(R.id.same_notification_volume); (CheckBox) view.findViewById(R.id.same_notification_volume);
mNotificationsUseRingVolumeCheckbox.setOnCheckedChangeListener(this); mNotificationsUseRingVolumeCheckbox.setOnCheckedChangeListener(this);
mNotificationsUseRingVolumeCheckbox.setChecked(Settings.System.getInt( mNotificationsUseRingVolumeCheckbox.setChecked(
getContext().getContentResolver(), Utils.isVoiceCapable(getContext())
Settings.System.NOTIFICATIONS_USE_RING_VOLUME, 1) == 1); && Settings.System.getInt(
getContext().getContentResolver(),
Settings.System.NOTIFICATIONS_USE_RING_VOLUME, 1) == 1);
setNotificationVolumeVisibility(!mNotificationsUseRingVolumeCheckbox.isChecked()); setNotificationVolumeVisibility(!mNotificationsUseRingVolumeCheckbox.isChecked());
disableSettingsThatNeedVoice(view); disableSettingsThatNeedVoice(view);
} }
private void disableSettingsThatNeedVoice(View parent) { private void disableSettingsThatNeedVoice(View parent) {
final boolean voiceCapable = getContext().getResources() final boolean voiceCapable = Utils.isVoiceCapable(getContext());
.getBoolean(com.android.internal.R.bool.config_voice_capable);
if (!voiceCapable) { if (!voiceCapable) {
for (int id : NEED_VOICE_CAPABILITY_ID) { for (int id : NEED_VOICE_CAPABILITY_ID) {
parent.findViewById(id).setVisibility(View.GONE); parent.findViewById(id).setVisibility(View.GONE);