diff options
38 files changed, 108 insertions, 60 deletions
diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notifications.png b/packages/SystemUI/res/drawable-hdpi/ic_notifications.png Binary files differdeleted file mode 100644 index 612ab72..0000000 --- a/packages/SystemUI/res/drawable-hdpi/ic_notifications.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notifications2.png b/packages/SystemUI/res/drawable-hdpi/ic_notifications2.png Binary files differdeleted file mode 100644 index 315c488..0000000 --- a/packages/SystemUI/res/drawable-hdpi/ic_notifications2.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notifications_normal.png b/packages/SystemUI/res/drawable-hdpi/ic_notifications_normal.png Binary files differnew file mode 100644 index 0000000..62afe76 --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_notifications_normal.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_normal.png b/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_normal.png Binary files differindex a54761f..ead184d 100644 --- a/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_normal.png +++ b/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_normal.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_pressed.png b/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_pressed.png Binary files differindex f3f336c..203e232 100644 --- a/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_pressed.png +++ b/packages/SystemUI/res/drawable-hdpi/ic_notify_clear_pressed.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notify_open_normal.png b/packages/SystemUI/res/drawable-hdpi/ic_notify_open_normal.png Binary files differnew file mode 100644 index 0000000..2adafea --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_notify_open_normal.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notify_open_pressed.png b/packages/SystemUI/res/drawable-hdpi/ic_notify_open_pressed.png Binary files differnew file mode 100644 index 0000000..8521ffc --- /dev/null +++ b/packages/SystemUI/res/drawable-hdpi/ic_notify_open_pressed.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notify_quicksettings_normal.png b/packages/SystemUI/res/drawable-hdpi/ic_notify_quicksettings_normal.png Binary files differindex 172fd55..4436359 100644 --- a/packages/SystemUI/res/drawable-hdpi/ic_notify_quicksettings_normal.png +++ b/packages/SystemUI/res/drawable-hdpi/ic_notify_quicksettings_normal.png diff --git a/packages/SystemUI/res/drawable-hdpi/ic_notify_quicksettings_pressed.png b/packages/SystemUI/res/drawable-hdpi/ic_notify_quicksettings_pressed.png Binary files differindex 5318a6e..c86710d 100644 --- a/packages/SystemUI/res/drawable-hdpi/ic_notify_quicksettings_pressed.png +++ b/packages/SystemUI/res/drawable-hdpi/ic_notify_quicksettings_pressed.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notifications.png b/packages/SystemUI/res/drawable-mdpi/ic_notifications.png Binary files differdeleted file mode 100644 index 612ab72..0000000 --- a/packages/SystemUI/res/drawable-mdpi/ic_notifications.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notifications2.png b/packages/SystemUI/res/drawable-mdpi/ic_notifications2.png Binary files differdeleted file mode 100644 index 1d07cbf..0000000 --- a/packages/SystemUI/res/drawable-mdpi/ic_notifications2.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notifications_normal.png b/packages/SystemUI/res/drawable-mdpi/ic_notifications_normal.png Binary files differnew file mode 100644 index 0000000..62afe76 --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/ic_notifications_normal.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_normal.png b/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_normal.png Binary files differindex b44b527..5dacccb 100644 --- a/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_normal.png +++ b/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_normal.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_pressed.png b/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_pressed.png Binary files differindex 94c8165..f1f6b00 100644 --- a/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_pressed.png +++ b/packages/SystemUI/res/drawable-mdpi/ic_notify_clear_pressed.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notify_open_normal.png b/packages/SystemUI/res/drawable-mdpi/ic_notify_open_normal.png Binary files differnew file mode 100644 index 0000000..2ab0cd7 --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/ic_notify_open_normal.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notify_open_pressed.png b/packages/SystemUI/res/drawable-mdpi/ic_notify_open_pressed.png Binary files differnew file mode 100644 index 0000000..49ac94b --- /dev/null +++ b/packages/SystemUI/res/drawable-mdpi/ic_notify_open_pressed.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notify_quicksettings_normal.png b/packages/SystemUI/res/drawable-mdpi/ic_notify_quicksettings_normal.png Binary files differindex 6104424..09d2c55 100644 --- a/packages/SystemUI/res/drawable-mdpi/ic_notify_quicksettings_normal.png +++ b/packages/SystemUI/res/drawable-mdpi/ic_notify_quicksettings_normal.png diff --git a/packages/SystemUI/res/drawable-mdpi/ic_notify_quicksettings_pressed.png b/packages/SystemUI/res/drawable-mdpi/ic_notify_quicksettings_pressed.png Binary files differindex 625da59..322d1a7 100644 --- a/packages/SystemUI/res/drawable-mdpi/ic_notify_quicksettings_pressed.png +++ b/packages/SystemUI/res/drawable-mdpi/ic_notify_quicksettings_pressed.png diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notifications.png b/packages/SystemUI/res/drawable-xhdpi/ic_notifications.png Binary files differdeleted file mode 100644 index 28a902c..0000000 --- a/packages/SystemUI/res/drawable-xhdpi/ic_notifications.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notifications2.png b/packages/SystemUI/res/drawable-xhdpi/ic_notifications2.png Binary files differdeleted file mode 100644 index b02e7a1..0000000 --- a/packages/SystemUI/res/drawable-xhdpi/ic_notifications2.png +++ /dev/null diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notifications_normal.png b/packages/SystemUI/res/drawable-xhdpi/ic_notifications_normal.png Binary files differnew file mode 100644 index 0000000..983302c --- /dev/null +++ b/packages/SystemUI/res/drawable-xhdpi/ic_notifications_normal.png diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_normal.png b/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_normal.png Binary files differindex 870beb4..c882e9a 100644 --- a/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_normal.png +++ b/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_normal.png diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_pressed.png b/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_pressed.png Binary files differindex 94a4646..992b50d 100644 --- a/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_pressed.png +++ b/packages/SystemUI/res/drawable-xhdpi/ic_notify_clear_pressed.png diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notify_open_normal.png b/packages/SystemUI/res/drawable-xhdpi/ic_notify_open_normal.png Binary files differnew file mode 100644 index 0000000..b0e35a1 --- /dev/null +++ b/packages/SystemUI/res/drawable-xhdpi/ic_notify_open_normal.png diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notify_open_pressed.png b/packages/SystemUI/res/drawable-xhdpi/ic_notify_open_pressed.png Binary files differnew file mode 100644 index 0000000..42bbbbc --- /dev/null +++ b/packages/SystemUI/res/drawable-xhdpi/ic_notify_open_pressed.png diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notify_quicksettings_normal.png b/packages/SystemUI/res/drawable-xhdpi/ic_notify_quicksettings_normal.png Binary files differindex 477c067..2d445279 100644 --- a/packages/SystemUI/res/drawable-xhdpi/ic_notify_quicksettings_normal.png +++ b/packages/SystemUI/res/drawable-xhdpi/ic_notify_quicksettings_normal.png diff --git a/packages/SystemUI/res/drawable-xhdpi/ic_notify_quicksettings_pressed.png b/packages/SystemUI/res/drawable-xhdpi/ic_notify_quicksettings_pressed.png Binary files differindex 6e5c4af..ddf2c7a 100644 --- a/packages/SystemUI/res/drawable-xhdpi/ic_notify_quicksettings_pressed.png +++ b/packages/SystemUI/res/drawable-xhdpi/ic_notify_quicksettings_pressed.png diff --git a/packages/SystemUI/res/drawable/ic_notifications.xml b/packages/SystemUI/res/drawable/ic_notifications.xml index 2c8012e..68c4774 100644 --- a/packages/SystemUI/res/drawable/ic_notifications.xml +++ b/packages/SystemUI/res/drawable/ic_notifications.xml @@ -16,8 +16,8 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" - android:drawable="@drawable/ic_notifications" /> + android:drawable="@drawable/ic_notifications_normal" /> <item - android:drawable="@drawable/ic_notifications" /> + android:drawable="@drawable/ic_notifications_normal" /> </selector> diff --git a/packages/SystemUI/res/drawable/ic_notify_quicksettings.xml b/packages/SystemUI/res/drawable/ic_notify_quicksettings.xml index d8ea524..7cf3175 100644 --- a/packages/SystemUI/res/drawable/ic_notify_quicksettings.xml +++ b/packages/SystemUI/res/drawable/ic_notify_quicksettings.xml @@ -16,7 +16,7 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" - android:drawable="@drawable/ic_notify_quicksettings_pressed" /> + android:drawable="@drawable/ic_notify_quicksettings_normal" /> <item android:drawable="@drawable/ic_notify_quicksettings_normal" /> </selector> diff --git a/packages/SystemUI/res/layout/status_bar_expanded.xml b/packages/SystemUI/res/layout/status_bar_expanded.xml index 5408f76..b71025e 100644 --- a/packages/SystemUI/res/layout/status_bar_expanded.xml +++ b/packages/SystemUI/res/layout/status_bar_expanded.xml @@ -63,7 +63,7 @@ android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network.EmergencyOnly" android:layout_height="wrap_content" android:layout_width="match_parent" - android:paddingBottom="4dp" + android:padding="4dp" android:gravity="center" android:visibility="gone" /> diff --git a/packages/SystemUI/res/layout/status_bar_expanded_header.xml b/packages/SystemUI/res/layout/status_bar_expanded_header.xml index c13405a..03f03e2 100644 --- a/packages/SystemUI/res/layout/status_bar_expanded_header.xml +++ b/packages/SystemUI/res/layout/status_bar_expanded_header.xml @@ -20,37 +20,40 @@ xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui" android:id="@+id/header" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="@dimen/notification_panel_header_height" android:background="@drawable/notification_header_bg" android:orientation="horizontal" android:gravity="center_vertical" android:baselineAligned="false" > - <LinearLayout + <RelativeLayout + android:id="@+id/datetime" android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:orientation="horizontal" + android:layout_height="match_parent" + android:paddingLeft="8dp" + android:paddingRight="8dp" + android:background="@drawable/ic_notify_button_bg" + android:enabled="false" > <com.android.systemui.statusbar.policy.Clock android:id="@+id/clock" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginLeft="8dp" + android:layout_marginRight="8dp" android:singleLine="true" android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock" - android:gravity="bottom" + android:layout_centerVertical="true" /> <com.android.systemui.statusbar.policy.DateView android:id="@+id/date" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" android:singleLine="true" android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date" - android:gravity="bottom" + android:layout_toRightOf="@id/clock" + android:layout_alignBaseline="@id/clock" /> - </LinearLayout> + </RelativeLayout> <Space android:layout_width="0dp" diff --git a/packages/SystemUI/res/layout/super_status_bar.xml b/packages/SystemUI/res/layout/super_status_bar.xml index 07aca6c..2b56618 100644 --- a/packages/SystemUI/res/layout/super_status_bar.xml +++ b/packages/SystemUI/res/layout/super_status_bar.xml @@ -36,7 +36,6 @@ android:id="@+id/panel_holder" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_marginTop="@*android:dimen/status_bar_height" > <include layout="@layout/status_bar_expanded" android:layout_width="match_parent" diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml index df6ed19..fc80f5c 100644 --- a/packages/SystemUI/res/values-sw600dp/dimens.xml +++ b/packages/SystemUI/res/values-sw600dp/dimens.xml @@ -47,4 +47,8 @@ <!-- Minimum fraction of the screen that should be taken up by the notification panel. --> <item type="dimen" name="notification_panel_min_height_frac">40%</item> + + <!-- How far to slide the panel out when you touch it --> + <!-- On tablets this is just the close_handle_height --> + <dimen name="peek_height">@dimen/close_handle_height</dimen> </resources> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 4de0891..ed08115 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -201,4 +201,8 @@ <!-- The size of the gesture span needed to activate the "pull" notification expansion --> <dimen name="pull_span_min">25dp</dimen> + + <!-- How far to slide the panel out when you touch it --> + <!-- For phones, this is close_handle_height + header_height --> + <dimen name="peek_height">84dp</dimen> </resources> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java index 7eb84e1..b2bca56 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelView.java @@ -98,7 +98,7 @@ public class PanelView extends FrameLayout { if (mPeekAnimator == null) { mPeekAnimator = ObjectAnimator.ofFloat(this, "expandedHeight", mPeekHeight) - .setDuration(300); + .setDuration(250); } mPeekAnimator.start(); } @@ -206,7 +206,7 @@ public class PanelView extends FrameLayout { mFlingGestureMaxOutputVelocityPx = res.getDimension(R.dimen.fling_gesture_max_output_velocity); - mPeekHeight = res.getDimension(R.dimen.close_handle_height) + mPeekHeight = res.getDimension(R.dimen.peek_height) + getPaddingBottom() // our window might have a dropshadow - (mHandleView == null ? 0 : mHandleView.getPaddingTop()); // the handle might have a topshadow } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index d4ccf96..1dae726 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -198,6 +198,8 @@ public class PhoneStatusBar extends BaseStatusBar { int mSettingsPanelGravity; // top bar + View mNotificationPanelHeader; + View mDateTimeView; View mClearButton; ImageView mSettingsButton, mNotificationButton; @@ -420,6 +422,8 @@ public class PhoneStatusBar extends BaseStatusBar { mPile.setLongPressListener(getNotificationLongClicker()); mExpandedContents = mPile; // was: expanded.findViewById(R.id.notificationLinearLayout); + mNotificationPanelHeader = mStatusBarWindow.findViewById(R.id.header); + mClearButton = mStatusBarWindow.findViewById(R.id.clear_all_button); mClearButton.setOnClickListener(mClearButtonListener); mClearButton.setAlpha(0f); @@ -430,6 +434,12 @@ public class PhoneStatusBar extends BaseStatusBar { mHasSettingsPanel = res.getBoolean(R.bool.config_hasSettingsPanel); mHasFlipSettings = res.getBoolean(R.bool.config_hasFlipSettingsPanel); + mDateTimeView = mNotificationPanelHeader.findViewById(R.id.datetime); + if (mHasFlipSettings) { + mDateTimeView.setOnClickListener(mClockClickListener); + mDateTimeView.setEnabled(true); + } + mSettingsButton = (ImageView) mStatusBarWindow.findViewById(R.id.settings_button); if (mSettingsButton != null) { mSettingsButton.setOnClickListener(mSettingsButtonListener); @@ -457,10 +467,12 @@ public class PhoneStatusBar extends BaseStatusBar { mScrollView = (ScrollView)mStatusBarWindow.findViewById(R.id.scroll); mScrollView.setVerticalScrollBarEnabled(false); // less drawing during pulldowns - mScrollView.setSystemUiVisibility( - View.STATUS_BAR_DISABLE_NOTIFICATION_TICKER | - View.STATUS_BAR_DISABLE_NOTIFICATION_ICONS | - View.STATUS_BAR_DISABLE_CLOCK); + if (!mNotificationPanelIsFullScreenWidth) { + mScrollView.setSystemUiVisibility( + View.STATUS_BAR_DISABLE_NOTIFICATION_TICKER | + View.STATUS_BAR_DISABLE_NOTIFICATION_ICONS | + View.STATUS_BAR_DISABLE_CLOCK); + } mTicker = new MyTicker(context, mStatusBarView); @@ -488,6 +500,8 @@ public class PhoneStatusBar extends BaseStatusBar { mEmergencyCallLabel = (TextView)mStatusBarWindow.findViewById(R.id.emergency_calls_only); if (mEmergencyCallLabel != null) { mNetworkController.addEmergencyLabelView(mEmergencyCallLabel); + mEmergencyCallLabel.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { }}); mEmergencyCallLabel.addOnLayoutChangeListener(new View.OnLayoutChangeListener() { @Override public void onLayoutChange(View v, int left, int top, int right, int bottom, @@ -553,10 +567,11 @@ public class PhoneStatusBar extends BaseStatusBar { mStatusBarWindow.findViewById(R.id.quick_settings_container); if (mSettingsContainer != null) { mQS = new QuickSettings(mContext, mSettingsContainer); - mSettingsContainer.setSystemUiVisibility( - View.STATUS_BAR_DISABLE_NOTIFICATION_TICKER - | View.STATUS_BAR_DISABLE_SYSTEM_INFO); - + if (!mNotificationPanelIsFullScreenWidth) { + mSettingsContainer.setSystemUiVisibility( + View.STATUS_BAR_DISABLE_NOTIFICATION_TICKER + | View.STATUS_BAR_DISABLE_SYSTEM_INFO); + } if (mSettingsPanel != null) { mSettingsPanel.setQuickSettings(mQS); } @@ -1288,6 +1303,7 @@ public class PhoneStatusBar extends BaseStatusBar { mNotificationPanel.setVisibility(View.GONE); mFlipSettingsView.setVisibility(View.GONE); mNotificationButton.setVisibility(View.GONE); + setAreThereNotifications(); // show the clear button } mExpandedVisible = true; @@ -2127,24 +2143,36 @@ public class PhoneStatusBar extends BaseStatusBar { } }; + public void startActivityDismissingKeyguard(Intent intent, boolean onlyProvisioned) { + if (onlyProvisioned && !isDeviceProvisioned()) return; + try { + // Dismiss the lock screen when Settings starts. + ActivityManagerNative.getDefault().dismissKeyguardOnNextActivity(); + } catch (RemoteException e) { + } + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); + mContext.startActivityAsUser(intent, new UserHandle(UserHandle.USER_CURRENT)); + animateCollapsePanels(); + } + private View.OnClickListener mSettingsButtonListener = new View.OnClickListener() { public void onClick(View v) { if (mHasSettingsPanel) { animateExpandSettingsPanel(); } else { - try { - // Dismiss the lock screen when Settings starts. - ActivityManagerNative.getDefault().dismissKeyguardOnNextActivity(); - } catch (RemoteException e) { - } - Intent intent = new Intent(android.provider.Settings.ACTION_SETTINGS); - intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); - mContext.startActivityAsUser(intent, new UserHandle(UserHandle.USER_CURRENT)); - animateCollapsePanels(); + startActivityDismissingKeyguard( + new Intent(android.provider.Settings.ACTION_SETTINGS), true); } } }; + private View.OnClickListener mClockClickListener = new View.OnClickListener() { + public void onClick(View v) { + startActivityDismissingKeyguard( + new Intent(Intent.ACTION_QUICK_CLOCK), true); // have fun, everyone + } + }; + private View.OnClickListener mNotificationButtonListener = new View.OnClickListener() { public void onClick(View v) { animateExpandNotificationsPanel(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java index 3c2f0e6..a27df94 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java @@ -191,11 +191,17 @@ public class PhoneStatusBarView extends PanelBar { if (panel == mFadingPanel && mScrimColor != 0 && ActivityManager.isHighEndGfx()) { if (mShouldFade) { frac = mPanelExpandedFractionSum; // don't judge me - // woo, special effects - final float k = (float)(1f-0.5f*(1f-Math.cos(3.14159f * Math.pow(1f-frac, 2.2f)))); - // attenuate background color alpha by k - final int color = (int) ((mScrimColor >>> 24) * k) << 24 | (mScrimColor & 0xFFFFFF); - mBar.mStatusBarWindow.setBackgroundColor(color); + // let's start this 20% of the way down the screen + frac = frac * 1.2f - 0.2f; + if (frac <= 0) { + mBar.mStatusBarWindow.setBackgroundColor(0); + } else { + // woo, special effects + final float k = (float)(1f-0.5f*(1f-Math.cos(3.14159f * Math.pow(1f-frac, 2f)))); + // attenuate background color alpha by k + final int color = (int) ((mScrimColor >>> 24) * k) << 24 | (mScrimColor & 0xFFFFFF); + mBar.mStatusBarWindow.setBackgroundColor(color); + } } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java index 5b550c2..56b9c3a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java @@ -321,7 +321,31 @@ class QuickSettings { parent.addView(userTile); mDynamicSpannedTiles.add(userTile); + // Brightness + QuickSettingsTileView brightnessTile = (QuickSettingsTileView) + inflater.inflate(R.layout.quick_settings_tile, parent, false); + brightnessTile.setContent(R.layout.quick_settings_tile_brightness, inflater); + brightnessTile.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + mBar.collapseAllPanels(true); + showBrightnessDialog(); + } + }); + mModel.addBrightnessTile(brightnessTile, new QuickSettingsModel.RefreshCallback() { + @Override + public void refreshView(QuickSettingsTileView view, State state) { + TextView tv = (TextView) view.findViewById(R.id.brightness_textview); + tv.setCompoundDrawablesWithIntrinsicBounds(0, state.iconId, 0, 0); + tv.setText(state.label); + dismissBrightnessDialog(mBrightnessDialogShortTimeout); + } + }); + parent.addView(brightnessTile); + mDynamicSpannedTiles.add(brightnessTile); + // Time tile + /* QuickSettingsTileView timeTile = (QuickSettingsTileView) inflater.inflate(R.layout.quick_settings_tile, parent, false); timeTile.setContent(R.layout.quick_settings_tile_time, inflater); @@ -338,6 +362,7 @@ class QuickSettings { }); parent.addView(timeTile); mDynamicSpannedTiles.add(timeTile); + */ // Settings tile QuickSettingsTileView settingsTile = (QuickSettingsTileView) @@ -549,27 +574,6 @@ class QuickSettings { parent.addView(bluetoothTile); } - // Brightness - QuickSettingsTileView brightnessTile = (QuickSettingsTileView) - inflater.inflate(R.layout.quick_settings_tile, parent, false); - brightnessTile.setContent(R.layout.quick_settings_tile_brightness, inflater); - brightnessTile.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - mBar.collapseAllPanels(true); - showBrightnessDialog(); - } - }); - mModel.addBrightnessTile(brightnessTile, new QuickSettingsModel.RefreshCallback() { - @Override - public void refreshView(QuickSettingsTileView view, State state) { - TextView tv = (TextView) view.findViewById(R.id.brightness_textview); - tv.setCompoundDrawablesWithIntrinsicBounds(0, state.iconId, 0, 0); - tv.setText(state.label); - dismissBrightnessDialog(mBrightnessDialogShortTimeout); - } - }); - parent.addView(brightnessTile); } private void addTemporaryTiles(final ViewGroup parent, final LayoutInflater inflater) { |