am 5690da98: Merge "Volume: Rocker animation + style updates." into lmp-dev

* commit '5690da980040eb4b1a89ea903733f0cc8d247c5e':
  Volume: Rocker animation + style updates.
This commit is contained in:
John Spurlock
2014-07-18 03:30:28 +00:00
committed by Android Git Automerger
9 changed files with 77 additions and 18 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -23,4 +23,4 @@
android:background="@drawable/segmented_button"
android:textAppearance="@style/TextAppearance.QS.SegmentedButton"
android:minHeight="0dp"
android:padding="12dp" />
android:padding="10dp" />

View File

@@ -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

View File

@@ -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"

View File

@@ -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>

View File

@@ -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>

View File

@@ -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"

View File

@@ -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);
}
}