diff options
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/SystemUI/res/drawable-mdpi/scrubber_control_holo.png | bin | 0 -> 4766 bytes | |||
| -rw-r--r-- | packages/SystemUI/res/drawable/status_bar_toggle_button.xml | 23 | ||||
| -rw-r--r-- | packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml | 23 | ||||
| -rw-r--r-- | packages/SystemUI/res/layout/status_bar_toggle_slider.xml | 22 | ||||
| -rw-r--r-- | packages/SystemUI/res/values/attrs.xml | 3 | ||||
| -rw-r--r-- | packages/SystemUI/res/values/strings.xml | 6 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/policy/ToggleSlider.java | 36 |
7 files changed, 73 insertions, 40 deletions
diff --git a/packages/SystemUI/res/drawable-mdpi/scrubber_control_holo.png b/packages/SystemUI/res/drawable-mdpi/scrubber_control_holo.png Binary files differnew file mode 100644 index 0000000..621e980 --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/scrubber_control_holo.png diff --git a/packages/SystemUI/res/drawable/status_bar_toggle_button.xml b/packages/SystemUI/res/drawable/status_bar_toggle_button.xml new file mode 100644 index 0000000..e17c62f --- /dev/null +++ b/packages/SystemUI/res/drawable/status_bar_toggle_button.xml @@ -0,0 +1,23 @@ +<?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. +--> + +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_checked="true" + android:drawable="@*android:drawable/scrubber_primary_holo" /> + <item + android:drawable="@*android:drawable/scrubber_track_holo_dark" /> +</selector> + diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml b/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml index ed07b9f..5e867e5 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml @@ -17,11 +17,13 @@ <com.android.systemui.statusbar.tablet.SettingsView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:background="@drawable/status_bar_item_background" android:paddingLeft="16dp" + android:paddingRight="46dp" > <!-- Airplane mode --> @@ -39,11 +41,12 @@ style="@style/StatusBarPanelSettingsContents" android:text="@string/status_bar_settings_airplane" /> - <CheckBox + <Switch android:id="@+id/airplane_checkbox" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" + android:layout_marginRight="5dp" /> </LinearLayout> <View style="@style/StatusBarPanelSettingsPanelSeparator" /> @@ -67,7 +70,7 @@ android:layout_height="wrap_content" android:layout_gravity="top" android:layout_marginTop="16dp" - android:layout_marginRight="8dp" + android:layout_marginRight="2dp" android:src="@drawable/ic_notification_open" /> </LinearLayout> @@ -88,11 +91,12 @@ style="@style/StatusBarPanelSettingsContents" android:text="@string/status_bar_settings_rotation_lock" /> - <CheckBox + <Switch android:id="@+id/rotate_checkbox" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" + android:layout_marginRight="5dp" /> </LinearLayout> <View style="@style/StatusBarPanelSettingsPanelSeparator" /> @@ -107,8 +111,10 @@ <com.android.systemui.statusbar.policy.ToggleSlider android:id="@+id/brightness" android:layout_width="0dp" - android:layout_height="wrap_content" + android:layout_height="fill_parent" android:layout_weight="1" + android:layout_marginRight="2dp" + systemui:text="@string/status_bar_settings_auto_brightness_label" /> </LinearLayout> <View style="@style/StatusBarPanelSettingsPanelSeparator" /> @@ -123,8 +129,10 @@ <com.android.systemui.statusbar.policy.ToggleSlider android:id="@+id/volume" android:layout_width="0dp" - android:layout_height="wrap_content" + android:layout_height="fill_parent" android:layout_weight="1" + android:layout_marginRight="2dp" + systemui:text="@string/status_bar_settings_mute_label" /> </LinearLayout> <View style="@style/StatusBarPanelSettingsPanelSeparator" /> @@ -143,11 +151,12 @@ style="@style/StatusBarPanelSettingsContents" android:text="@string/status_bar_settings_notifications" /> - <CheckBox + <Switch android:id="@+id/do_not_disturb_checkbox" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_vertical" + android:layout_marginRight="5dp" /> </LinearLayout> <View style="@style/StatusBarPanelSettingsPanelSeparator" /> @@ -172,7 +181,7 @@ android:layout_height="wrap_content" android:layout_gravity="top" android:layout_marginTop="16dp" - android:layout_marginRight="8dp" + android:layout_marginRight="2dp" android:src="@drawable/ic_notification_open" /> </LinearLayout> diff --git a/packages/SystemUI/res/layout/status_bar_toggle_slider.xml b/packages/SystemUI/res/layout/status_bar_toggle_slider.xml index c5ad047..cdf56c5 100644 --- a/packages/SystemUI/res/layout/status_bar_toggle_slider.xml +++ b/packages/SystemUI/res/layout/status_bar_toggle_slider.xml @@ -20,33 +20,35 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" > - <ToggleButton + <CheckBox android:id="@+id/toggle" android:layout_width="48dp" - android:layout_height="wrap_content" + android:layout_height="0dp" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" + android:layout_alignParentBottom="true" + android:button="@drawable/status_bar_toggle_button" /> - <view - class="com.android.systemui.statusbar.policy.ToggleSlider$Slider" + <SeekBar android:id="@+id/slider" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_toRightOf="@id/toggle" - android:layout_alignParentTop="true" + android:layout_centerVertical="true" android:layout_alignParentRight="true" android:paddingLeft="20dp" + android:paddingRight="20dp" /> - <!-- <TextView android:id="@+id/label" android:layout_width="0dp" - android:layout_height="0dp" + android:layout_height="wrap_content" android:layout_alignLeft="@id/toggle" android:layout_alignRight="@id/toggle" - android:layout_alignParentBottom="true" - android:layout_below="@id/toggle" + android:layout_centerVertical="true" android:gravity="center" + android:paddingTop="26dp" + android:textColor="#666666" + android:textSize="12sp" /> - --> </merge> diff --git a/packages/SystemUI/res/values/attrs.xml b/packages/SystemUI/res/values/attrs.xml index 23bcf20..87395c1 100644 --- a/packages/SystemUI/res/values/attrs.xml +++ b/packages/SystemUI/res/values/attrs.xml @@ -18,5 +18,8 @@ <declare-styleable name="KeyButtonView"> <attr name="keyCode" format="integer" /> </declare-styleable> + <declare-styleable name="ToggleSlider"> + <attr name="text" format="string" /> + </declare-styleable> </resources> diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index f3ad9ff..644cca0 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -80,6 +80,12 @@ <!-- Label in system panel saying the device will use the orientation sensor to rotate [CHAR LIMIT=30] --> <string name="status_bar_settings_rotation_lock">Lock screen orientation</string> + <!-- Abbreviation / label for mute brightness mode button. Should be all caps. [CHAR LIMIT=6] --> + <string name="status_bar_settings_mute_label">MUTE</string> + + <!-- Abbreviation / label for automatic brightness mode button. Should be all caps. [CHAR LIMIT=6] --> + <string name="status_bar_settings_auto_brightness_label">AUTO</string> + <!-- Label in system panel saying the device will show notifications [CHAR LIMIT=30] --> <string name="status_bar_settings_notifications">Notifications</string> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/ToggleSlider.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/ToggleSlider.java index f4994d5..46207ee 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/ToggleSlider.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/ToggleSlider.java @@ -18,6 +18,7 @@ package com.android.systemui.statusbar.policy; import android.content.Context; import android.content.res.Resources; +import android.content.res.TypedArray; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.util.Slog; @@ -26,7 +27,7 @@ import android.widget.CompoundButton; import android.widget.RelativeLayout; import android.widget.SeekBar; import android.widget.TextView; -import android.widget.ToggleButton; +import android.widget.CompoundButton; import com.android.systemui.R; @@ -38,24 +39,10 @@ public class ToggleSlider extends RelativeLayout public void onChanged(ToggleSlider v, boolean tracking, boolean checked, int value); } - public static class Slider extends SeekBar { - public Slider(Context context) { - this(context, null); - } - - public Slider(Context context, AttributeSet attrs) { - super(context, attrs); - } - - public Slider(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - } - } - private Listener mListener; private boolean mTracking; - private ToggleButton mToggle; + private CompoundButton mToggle; private SeekBar mSlider; private TextView mLabel; @@ -71,18 +58,21 @@ public class ToggleSlider extends RelativeLayout super(context, attrs, defStyle); View.inflate(context, R.layout.status_bar_toggle_slider, this); - mToggle = (ToggleButton)findViewById(R.id.toggle); + final Resources res = context.getResources(); + TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ToggleSlider, + defStyle, 0); + + mToggle = (CompoundButton)findViewById(R.id.toggle); mToggle.setOnCheckedChangeListener(this); - mToggle.setTextOn("hi"); - mToggle.setTextOff("hi"); + mToggle.setBackgroundDrawable(res.getDrawable(R.drawable.status_bar_toggle_button)); mSlider = (SeekBar)findViewById(R.id.slider); mSlider.setOnSeekBarChangeListener(this); - /* mLabel = (TextView)findViewById(R.id.label); - mLabel.setText("yo"); - */ + mLabel.setText(a.getString(R.styleable.ToggleSlider_text)); + + a.recycle(); } public void onCheckedChanged(CompoundButton toggle, boolean checked) { @@ -91,7 +81,7 @@ public class ToggleSlider extends RelativeLayout if (checked) { thumb = res.getDrawable(R.drawable.scrubber_control_disabled_holo); } else { - thumb = res.getDrawable(com.android.internal.R.drawable.scrubber_control_holo); + thumb = res.getDrawable(R.drawable.scrubber_control_holo); } mSlider.setThumb(thumb); |
