diff options
9 files changed, 77 insertions, 18 deletions
diff --git a/packages/SystemUI/res/drawable/zen_alarm_hard_background.xml b/packages/SystemUI/res/drawable/zen_alarm_hard_background.xml new file mode 100644 index 000000000000..36202127d6c2 --- /dev/null +++ b/packages/SystemUI/res/drawable/zen_alarm_hard_background.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2014 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. +--> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + <solid android:color="@color/system_warning_color" /> + <corners + android:topLeftRadius="0dp" + android:topRightRadius="0dp" + android:bottomLeftRadius="@dimen/notification_material_rounded_rect_radius" + android:bottomRightRadius="@dimen/notification_material_rounded_rect_radius"/> +</shape> diff --git a/packages/SystemUI/res/drawable/zen_alarm_soft_background.xml b/packages/SystemUI/res/drawable/zen_alarm_soft_background.xml new file mode 100644 index 000000000000..a99c79c371d7 --- /dev/null +++ b/packages/SystemUI/res/drawable/zen_alarm_soft_background.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2014 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. +--> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + <solid android:color="@color/zen_alarm_soft_warning_background" /> + <corners + android:topLeftRadius="0dp" + android:topRightRadius="0dp" + android:bottomLeftRadius="@dimen/notification_material_rounded_rect_radius" + android:bottomRightRadius="@dimen/notification_material_rounded_rect_radius"/> +</shape> diff --git a/packages/SystemUI/res/layout/segmented_button.xml b/packages/SystemUI/res/layout/segmented_button.xml index ef782209fd8b..538e43416e3d 100644 --- a/packages/SystemUI/res/layout/segmented_button.xml +++ b/packages/SystemUI/res/layout/segmented_button.xml @@ -23,4 +23,4 @@ android:background="@drawable/segmented_button" android:textAppearance="@style/TextAppearance.QS.SegmentedButton" android:minHeight="0dp" - android:padding="12dp" /> + android:padding="10dp" /> diff --git a/packages/SystemUI/res/layout/volume_panel.xml b/packages/SystemUI/res/layout/volume_panel.xml index b377a066d2a3..641630809e34 100644 --- a/packages/SystemUI/res/layout/volume_panel.xml +++ b/packages/SystemUI/res/layout/volume_panel.xml @@ -18,6 +18,7 @@ android:id="@+id/visible_panel" android:layout_width="match_parent" android:layout_height="wrap_content" + android:paddingTop="8dp" android:orientation="vertical" > <FrameLayout diff --git a/packages/SystemUI/res/layout/volume_panel_item.xml b/packages/SystemUI/res/layout/volume_panel_item.xml index d91e2abe2b5e..b1dd237e8188 100644 --- a/packages/SystemUI/res/layout/volume_panel_item.xml +++ b/packages/SystemUI/res/layout/volume_panel_item.xml @@ -26,10 +26,10 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@null" - android:paddingBottom="12dip" + android:paddingBottom="10dip" android:paddingLeft="16dip" android:paddingRight="16dip" - android:paddingTop="12dip" /> + android:paddingTop="10dip" /> <SeekBar android:id="@+id/seekbar" diff --git a/packages/SystemUI/res/layout/zen_mode_panel.xml b/packages/SystemUI/res/layout/zen_mode_panel.xml index 8b1c2b7ef4fa..b0e43fcabcbe 100644 --- a/packages/SystemUI/res/layout/zen_mode_panel.xml +++ b/packages/SystemUI/res/layout/zen_mode_panel.xml @@ -30,7 +30,7 @@ android:layout_height="wrap_content" android:layout_marginLeft="@dimen/qs_panel_padding" android:layout_marginRight="@dimen/qs_panel_padding" - android:layout_marginTop="8dp" + android:layout_marginTop="12dp" android:background="@drawable/segmented_buttons" android:clipChildren="false" /> @@ -81,8 +81,10 @@ <TextView android:id="@+id/zen_alarm_warning" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingTop="@dimen/qs_panel_padding" - android:gravity="center" - android:textAppearance="@style/TextAppearance.QS.DetailItemPrimary" /> + android:layout_height="48dp" + android:layout_marginTop="@dimen/qs_panel_padding" + android:paddingLeft="@dimen/qs_panel_padding" + android:paddingRight="@dimen/qs_panel_padding" + android:gravity="center_vertical" + android:textAppearance="@style/TextAppearance.QS.DetailEmpty" /> </com.android.systemui.volume.ZenModePanel>
\ No newline at end of file diff --git a/packages/SystemUI/res/values/colors.xml b/packages/SystemUI/res/values/colors.xml index a1064fdb5647..f23486eb77ba 100644 --- a/packages/SystemUI/res/values/colors.xml +++ b/packages/SystemUI/res/values/colors.xml @@ -43,6 +43,8 @@ <color name="qs_tile_text">#B3FFFFFF</color><!-- 70% white --> <color name="qs_subhead">#66FFFFFF</color><!-- 40% white --> <color name="qs_detail_empty">#24B0BEC5</color><!-- 14% blue grey 200--> + <color name="zen_alarm_soft_warning_text">#99FFFFFF</color><!-- 60% white --> + <color name="zen_alarm_soft_warning_background">#15FFFFFF</color><!-- 8% white --> <color name="data_usage_secondary">#99FFFFFF</color><!-- 60% white --> <color name="data_usage_graph_track">#33FFFFFF</color><!-- 20% white --> <color name="data_usage_graph_warning">#FFFFFFFF</color> diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml index 5cc987a710e0..419ecc77e5a4 100644 --- a/packages/SystemUI/res/values/styles.xml +++ b/packages/SystemUI/res/values/styles.xml @@ -267,8 +267,8 @@ <!-- Window animations used for volume panel. --> <style name="VolumePanelAnimation"> - <item name="android:windowEnterAnimation">@*android:anim/dock_top_enter</item> - <item name="android:windowExitAnimation">@*android:anim/dock_top_exit</item> + <item name="android:windowEnterAnimation">@*android:anim/popup_enter_material</item> + <item name="android:windowExitAnimation">@*android:anim/popup_exit_material</item> </style> <style name="TextAppearance.StatusBar.Material.EventContent.Parenthetical" diff --git a/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java b/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java index 33cf3b62122a..7473c41584c1 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java +++ b/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java @@ -22,6 +22,7 @@ import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; +import android.content.res.Resources; import android.net.Uri; import android.os.Handler; import android.os.Looper; @@ -80,8 +81,8 @@ public class ZenModePanel extends LinearLayout { private final H mHandler = new H(); private final Favorites mFavorites; private final Interpolator mFastOutSlowInInterpolator; - private final int mTextColor; - private final int mAccentColor; + private final int mHardWarningColor; + private final int mSoftWarningColor; private char mLogTag = '?'; private String mTag; @@ -94,6 +95,7 @@ public class ZenModePanel extends LinearLayout { private LinearLayout mZenConditions; private TextView mAlarmWarning; + private int mBottomPadding; private Callback mCallback; private ZenModeController mController; private boolean mRequestingConditions; @@ -112,8 +114,9 @@ public class ZenModePanel extends LinearLayout { mInflater = LayoutInflater.from(mContext.getApplicationContext()); mFastOutSlowInInterpolator = AnimationUtils.loadInterpolator(mContext, android.R.interpolator.fast_out_slow_in); - mTextColor = mContext.getResources().getColor(R.color.qs_text); - mAccentColor = mContext.getResources().getColor(R.color.system_accent_color); + final Resources res = mContext.getResources(); + mHardWarningColor = res.getColor(R.color.qs_text); + mSoftWarningColor = res.getColor(R.color.zen_alarm_soft_warning_text); updateTag(); if (DEBUG) Log.d(mTag, "new ZenModePanel"); } @@ -126,6 +129,8 @@ public class ZenModePanel extends LinearLayout { protected void onFinishInflate() { super.onFinishInflate(); + mBottomPadding = getPaddingBottom(); + mZenButtons = (SegmentedButtons) findViewById(R.id.zen_buttons); mZenButtons.addButton(R.string.interruption_level_none, Global.ZEN_MODE_NO_INTERRUPTIONS); mZenButtons.addButton(R.string.interruption_level_priority, @@ -285,6 +290,7 @@ public class ZenModePanel extends LinearLayout { final boolean zenNone = zen == Global.ZEN_MODE_NO_INTERRUPTIONS; final boolean foreverSelected = mExitConditionId == null; final boolean hasNextAlarm = mNextAlarm != 0; + final boolean showAlarmWarning = zenNone && mExpanded && hasNextAlarm; mZenSubhead.setVisibility(!zenOff && (mExpanded || !foreverSelected) ? VISIBLE : GONE); mZenSubheadExpanded.setVisibility(mExpanded ? VISIBLE : GONE); @@ -292,8 +298,8 @@ public class ZenModePanel extends LinearLayout { mMoreSettings.setVisibility(zenImportant && mExpanded ? VISIBLE : GONE); mZenConditions.setVisibility(!zenOff && mExpanded ? VISIBLE : GONE); mAlarmWarning.setVisibility(zenNone && mExpanded && hasNextAlarm ? VISIBLE : GONE); - - if (zenNone && mExpanded && hasNextAlarm) { + setPadding(0, 0, 0, showAlarmWarning ? 0 : mBottomPadding); + if (showAlarmWarning) { final long exitTime = ZenModeConfig.tryParseCountdownConditionId(mExitConditionId); final long now = System.currentTimeMillis(); final boolean alarmToday = time(mNextAlarm).yearDay == time(now).yearDay; @@ -304,12 +310,14 @@ public class ZenModePanel extends LinearLayout { final boolean isWarning = exitTime > 0 && mNextAlarm > now && mNextAlarm < exitTime; if (isWarning) { mAlarmWarning.setText(mContext.getString(R.string.zen_alarm_warning, alarm)); - mAlarmWarning.setTextColor(mAccentColor); + mAlarmWarning.setTextColor(mHardWarningColor); + mAlarmWarning.setBackgroundResource(R.drawable.zen_alarm_hard_background); } else { mAlarmWarning.setText(mContext.getString(alarmToday ? R.string.zen_alarm_information_time : R.string.zen_alarm_information_day_time, alarm)); - mAlarmWarning.setTextColor(mTextColor); + mAlarmWarning.setTextColor(mSoftWarningColor); + mAlarmWarning.setBackgroundResource(R.drawable.zen_alarm_soft_background); } } |