* commit 'cce71837337e91e03c1519b26fd8aaa3e77e3ffb': Quickening.
|
Before Width: | Height: | Size: 331 B |
|
Before Width: | Height: | Size: 578 B |
BIN
packages/SystemUI/res/drawable-hdpi/ic_notifications_normal.png
Normal file
|
After Width: | Height: | Size: 367 B |
|
Before Width: | Height: | Size: 577 B After Width: | Height: | Size: 762 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
packages/SystemUI/res/drawable-hdpi/ic_notify_open_normal.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
packages/SystemUI/res/drawable-hdpi/ic_notify_open_pressed.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 331 B |
|
Before Width: | Height: | Size: 403 B |
BIN
packages/SystemUI/res/drawable-mdpi/ic_notifications_normal.png
Normal file
|
After Width: | Height: | Size: 367 B |
|
Before Width: | Height: | Size: 546 B After Width: | Height: | Size: 687 B |
|
Before Width: | Height: | Size: 791 B After Width: | Height: | Size: 883 B |
BIN
packages/SystemUI/res/drawable-mdpi/ic_notify_open_normal.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
packages/SystemUI/res/drawable-mdpi/ic_notify_open_pressed.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 582 B |
|
Before Width: | Height: | Size: 694 B |
BIN
packages/SystemUI/res/drawable-xhdpi/ic_notifications_normal.png
Normal file
|
After Width: | Height: | Size: 683 B |
|
Before Width: | Height: | Size: 582 B After Width: | Height: | Size: 861 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.6 KiB |
BIN
packages/SystemUI/res/drawable-xhdpi/ic_notify_open_normal.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
packages/SystemUI/res/drawable-xhdpi/ic_notify_open_pressed.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.9 KiB |
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
/>
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||