diff options
author | Daniel Sandler <dsandler@android.com> | 2012-10-16 21:30:28 -0400 |
---|---|---|
committer | Daniel Sandler <dsandler@android.com> | 2012-10-16 23:21:26 -0400 |
commit | 3679bf58fb2f59745b416b26126b7e2a673c54d8 (patch) | |
tree | 18fc35f441310079418c15bfc0183bddcbb74f06 /packages/SystemUI/src/com | |
parent | fe3376b41aa48b6894afad9b977170bc658a6ac1 (diff) | |
download | frameworks_base-3679bf58fb2f59745b416b26126b7e2a673c54d8.zip frameworks_base-3679bf58fb2f59745b416b26126b7e2a673c54d8.tar.gz frameworks_base-3679bf58fb2f59745b416b26126b7e2a673c54d8.tar.bz2 |
Quickening.
+ Baseline align all header elements.
+ Make clock clickable.
+ Remove clock tile.
+ Reorder tiles.
+ Hide status bar behind panel on phones.
+ Make status bar peek animation show the whole header on phones.
+ Stop hiding status bar bits on phones.
Bug: 7350584 // baseline align header, make clock clickable,
Bug: 7351760 // hide status bar behind panel
Change-Id: I888752b64c56e80c3f5581fd8ee1cfd7c50eab7c
Diffstat (limited to 'packages/SystemUI/src/com')
4 files changed, 83 insertions, 45 deletions
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) { |