diff options
author | John Spurlock <jspurlock@google.com> | 2014-07-17 23:09:40 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2014-07-17 23:23:11 -0400 |
commit | b71e68f9aa44b220cabaace70493751538d94dc0 (patch) | |
tree | 4e2c2b97af8331cbf28aa232a1ba6e2e579ec874 /packages | |
parent | 54a463498316594ba7e0567db5d4f541a7a1e827 (diff) | |
download | frameworks_base-b71e68f9aa44b220cabaace70493751538d94dc0.zip frameworks_base-b71e68f9aa44b220cabaace70493751538d94dc0.tar.gz frameworks_base-b71e68f9aa44b220cabaace70493751538d94dc0.tar.bz2 |
Volume: Rocker animation + style updates.
- Add more spacing at the top
- Update window animations to fades
- Improve style for alarm warnings
Bug:16200897
Change-Id: I7a64e235eff1f9a77fc697a98a4440bc69043386
Diffstat (limited to 'packages')
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 0000000..3620212 --- /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 0000000..a99c79c --- /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 ef78220..538e434 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 b377a06..6416308 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 d91e2ab..b1dd237 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 8b1c2b7..b0e43fc 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 a1064fd..f23486e 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 5cc987a..419ecc7 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 33cf3b6..7473c41 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); } } |