am b6454adb: Merge "Quickening." into jb-mr1-dev
* commit 'b6454adb6c36290550105dd7e085c0d97e07c46f': 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">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:state_pressed="true"
|
<item android:state_pressed="true"
|
||||||
android:drawable="@drawable/ic_notifications" />
|
android:drawable="@drawable/ic_notifications_normal" />
|
||||||
<item
|
<item
|
||||||
android:drawable="@drawable/ic_notifications" />
|
android:drawable="@drawable/ic_notifications_normal" />
|
||||||
</selector>
|
</selector>
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:state_pressed="true"
|
<item android:state_pressed="true"
|
||||||
android:drawable="@drawable/ic_notify_quicksettings_pressed" />
|
android:drawable="@drawable/ic_notify_quicksettings_normal" />
|
||||||
<item
|
<item
|
||||||
android:drawable="@drawable/ic_notify_quicksettings_normal" />
|
android:drawable="@drawable/ic_notify_quicksettings_normal" />
|
||||||
</selector>
|
</selector>
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network.EmergencyOnly"
|
android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Network.EmergencyOnly"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:paddingBottom="4dp"
|
android:padding="4dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -20,37 +20,40 @@
|
|||||||
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
|
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui"
|
||||||
android:id="@+id/header"
|
android:id="@+id/header"
|
||||||
android:layout_width="match_parent"
|
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:background="@drawable/notification_header_bg"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:baselineAligned="false"
|
android:baselineAligned="false"
|
||||||
>
|
>
|
||||||
<LinearLayout
|
<RelativeLayout
|
||||||
|
android:id="@+id/datetime"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:orientation="horizontal"
|
android:paddingLeft="8dp"
|
||||||
|
android:paddingRight="8dp"
|
||||||
|
android:background="@drawable/ic_notify_button_bg"
|
||||||
|
android:enabled="false"
|
||||||
>
|
>
|
||||||
<com.android.systemui.statusbar.policy.Clock
|
<com.android.systemui.statusbar.policy.Clock
|
||||||
android:id="@+id/clock"
|
android:id="@+id/clock"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="8dp"
|
android:layout_marginRight="8dp"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock"
|
android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Clock"
|
||||||
android:gravity="bottom"
|
android:layout_centerVertical="true"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<com.android.systemui.statusbar.policy.DateView android:id="@+id/date"
|
<com.android.systemui.statusbar.policy.DateView android:id="@+id/date"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="8dp"
|
|
||||||
android:layout_marginRight="8dp"
|
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date"
|
android:textAppearance="@style/TextAppearance.StatusBar.Expanded.Date"
|
||||||
android:gravity="bottom"
|
android:layout_toRightOf="@id/clock"
|
||||||
|
android:layout_alignBaseline="@id/clock"
|
||||||
/>
|
/>
|
||||||
</LinearLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<Space
|
<Space
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
android:id="@+id/panel_holder"
|
android:id="@+id/panel_holder"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="@*android:dimen/status_bar_height"
|
|
||||||
>
|
>
|
||||||
<include layout="@layout/status_bar_expanded"
|
<include layout="@layout/status_bar_expanded"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|||||||
@@ -47,4 +47,8 @@
|
|||||||
|
|
||||||
<!-- Minimum fraction of the screen that should be taken up by the notification panel. -->
|
<!-- 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>
|
<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>
|
</resources>
|
||||||
|
|||||||
@@ -201,4 +201,8 @@
|
|||||||
|
|
||||||
<!-- The size of the gesture span needed to activate the "pull" notification expansion -->
|
<!-- The size of the gesture span needed to activate the "pull" notification expansion -->
|
||||||
<dimen name="pull_span_min">25dp</dimen>
|
<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>
|
</resources>
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public class PanelView extends FrameLayout {
|
|||||||
if (mPeekAnimator == null) {
|
if (mPeekAnimator == null) {
|
||||||
mPeekAnimator = ObjectAnimator.ofFloat(this,
|
mPeekAnimator = ObjectAnimator.ofFloat(this,
|
||||||
"expandedHeight", mPeekHeight)
|
"expandedHeight", mPeekHeight)
|
||||||
.setDuration(300);
|
.setDuration(250);
|
||||||
}
|
}
|
||||||
mPeekAnimator.start();
|
mPeekAnimator.start();
|
||||||
}
|
}
|
||||||
@@ -206,7 +206,7 @@ public class PanelView extends FrameLayout {
|
|||||||
|
|
||||||
mFlingGestureMaxOutputVelocityPx = res.getDimension(R.dimen.fling_gesture_max_output_velocity);
|
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
|
+ getPaddingBottom() // our window might have a dropshadow
|
||||||
- (mHandleView == null ? 0 : mHandleView.getPaddingTop()); // the handle might have a topshadow
|
- (mHandleView == null ? 0 : mHandleView.getPaddingTop()); // the handle might have a topshadow
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,6 +198,8 @@ public class PhoneStatusBar extends BaseStatusBar {
|
|||||||
int mSettingsPanelGravity;
|
int mSettingsPanelGravity;
|
||||||
|
|
||||||
// top bar
|
// top bar
|
||||||
|
View mNotificationPanelHeader;
|
||||||
|
View mDateTimeView;
|
||||||
View mClearButton;
|
View mClearButton;
|
||||||
ImageView mSettingsButton, mNotificationButton;
|
ImageView mSettingsButton, mNotificationButton;
|
||||||
|
|
||||||
@@ -420,6 +422,8 @@ public class PhoneStatusBar extends BaseStatusBar {
|
|||||||
mPile.setLongPressListener(getNotificationLongClicker());
|
mPile.setLongPressListener(getNotificationLongClicker());
|
||||||
mExpandedContents = mPile; // was: expanded.findViewById(R.id.notificationLinearLayout);
|
mExpandedContents = mPile; // was: expanded.findViewById(R.id.notificationLinearLayout);
|
||||||
|
|
||||||
|
mNotificationPanelHeader = mStatusBarWindow.findViewById(R.id.header);
|
||||||
|
|
||||||
mClearButton = mStatusBarWindow.findViewById(R.id.clear_all_button);
|
mClearButton = mStatusBarWindow.findViewById(R.id.clear_all_button);
|
||||||
mClearButton.setOnClickListener(mClearButtonListener);
|
mClearButton.setOnClickListener(mClearButtonListener);
|
||||||
mClearButton.setAlpha(0f);
|
mClearButton.setAlpha(0f);
|
||||||
@@ -430,6 +434,12 @@ public class PhoneStatusBar extends BaseStatusBar {
|
|||||||
mHasSettingsPanel = res.getBoolean(R.bool.config_hasSettingsPanel);
|
mHasSettingsPanel = res.getBoolean(R.bool.config_hasSettingsPanel);
|
||||||
mHasFlipSettings = res.getBoolean(R.bool.config_hasFlipSettingsPanel);
|
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);
|
mSettingsButton = (ImageView) mStatusBarWindow.findViewById(R.id.settings_button);
|
||||||
if (mSettingsButton != null) {
|
if (mSettingsButton != null) {
|
||||||
mSettingsButton.setOnClickListener(mSettingsButtonListener);
|
mSettingsButton.setOnClickListener(mSettingsButtonListener);
|
||||||
@@ -457,10 +467,12 @@ public class PhoneStatusBar extends BaseStatusBar {
|
|||||||
|
|
||||||
mScrollView = (ScrollView)mStatusBarWindow.findViewById(R.id.scroll);
|
mScrollView = (ScrollView)mStatusBarWindow.findViewById(R.id.scroll);
|
||||||
mScrollView.setVerticalScrollBarEnabled(false); // less drawing during pulldowns
|
mScrollView.setVerticalScrollBarEnabled(false); // less drawing during pulldowns
|
||||||
mScrollView.setSystemUiVisibility(
|
if (!mNotificationPanelIsFullScreenWidth) {
|
||||||
View.STATUS_BAR_DISABLE_NOTIFICATION_TICKER |
|
mScrollView.setSystemUiVisibility(
|
||||||
View.STATUS_BAR_DISABLE_NOTIFICATION_ICONS |
|
View.STATUS_BAR_DISABLE_NOTIFICATION_TICKER |
|
||||||
View.STATUS_BAR_DISABLE_CLOCK);
|
View.STATUS_BAR_DISABLE_NOTIFICATION_ICONS |
|
||||||
|
View.STATUS_BAR_DISABLE_CLOCK);
|
||||||
|
}
|
||||||
|
|
||||||
mTicker = new MyTicker(context, mStatusBarView);
|
mTicker = new MyTicker(context, mStatusBarView);
|
||||||
|
|
||||||
@@ -488,6 +500,8 @@ public class PhoneStatusBar extends BaseStatusBar {
|
|||||||
mEmergencyCallLabel = (TextView)mStatusBarWindow.findViewById(R.id.emergency_calls_only);
|
mEmergencyCallLabel = (TextView)mStatusBarWindow.findViewById(R.id.emergency_calls_only);
|
||||||
if (mEmergencyCallLabel != null) {
|
if (mEmergencyCallLabel != null) {
|
||||||
mNetworkController.addEmergencyLabelView(mEmergencyCallLabel);
|
mNetworkController.addEmergencyLabelView(mEmergencyCallLabel);
|
||||||
|
mEmergencyCallLabel.setOnClickListener(new View.OnClickListener() {
|
||||||
|
public void onClick(View v) { }});
|
||||||
mEmergencyCallLabel.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
|
mEmergencyCallLabel.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onLayoutChange(View v, int left, int top, int right, int bottom,
|
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);
|
mStatusBarWindow.findViewById(R.id.quick_settings_container);
|
||||||
if (mSettingsContainer != null) {
|
if (mSettingsContainer != null) {
|
||||||
mQS = new QuickSettings(mContext, mSettingsContainer);
|
mQS = new QuickSettings(mContext, mSettingsContainer);
|
||||||
mSettingsContainer.setSystemUiVisibility(
|
if (!mNotificationPanelIsFullScreenWidth) {
|
||||||
View.STATUS_BAR_DISABLE_NOTIFICATION_TICKER
|
mSettingsContainer.setSystemUiVisibility(
|
||||||
| View.STATUS_BAR_DISABLE_SYSTEM_INFO);
|
View.STATUS_BAR_DISABLE_NOTIFICATION_TICKER
|
||||||
|
| View.STATUS_BAR_DISABLE_SYSTEM_INFO);
|
||||||
|
}
|
||||||
if (mSettingsPanel != null) {
|
if (mSettingsPanel != null) {
|
||||||
mSettingsPanel.setQuickSettings(mQS);
|
mSettingsPanel.setQuickSettings(mQS);
|
||||||
}
|
}
|
||||||
@@ -1288,6 +1303,7 @@ public class PhoneStatusBar extends BaseStatusBar {
|
|||||||
mNotificationPanel.setVisibility(View.GONE);
|
mNotificationPanel.setVisibility(View.GONE);
|
||||||
mFlipSettingsView.setVisibility(View.GONE);
|
mFlipSettingsView.setVisibility(View.GONE);
|
||||||
mNotificationButton.setVisibility(View.GONE);
|
mNotificationButton.setVisibility(View.GONE);
|
||||||
|
setAreThereNotifications(); // show the clear button
|
||||||
}
|
}
|
||||||
|
|
||||||
mExpandedVisible = true;
|
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() {
|
private View.OnClickListener mSettingsButtonListener = new View.OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (mHasSettingsPanel) {
|
if (mHasSettingsPanel) {
|
||||||
animateExpandSettingsPanel();
|
animateExpandSettingsPanel();
|
||||||
} else {
|
} else {
|
||||||
try {
|
startActivityDismissingKeyguard(
|
||||||
// Dismiss the lock screen when Settings starts.
|
new Intent(android.provider.Settings.ACTION_SETTINGS), true);
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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() {
|
private View.OnClickListener mNotificationButtonListener = new View.OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
animateExpandNotificationsPanel();
|
animateExpandNotificationsPanel();
|
||||||
|
|||||||
@@ -191,11 +191,17 @@ public class PhoneStatusBarView extends PanelBar {
|
|||||||
if (panel == mFadingPanel && mScrimColor != 0 && ActivityManager.isHighEndGfx()) {
|
if (panel == mFadingPanel && mScrimColor != 0 && ActivityManager.isHighEndGfx()) {
|
||||||
if (mShouldFade) {
|
if (mShouldFade) {
|
||||||
frac = mPanelExpandedFractionSum; // don't judge me
|
frac = mPanelExpandedFractionSum; // don't judge me
|
||||||
// woo, special effects
|
// let's start this 20% of the way down the screen
|
||||||
final float k = (float)(1f-0.5f*(1f-Math.cos(3.14159f * Math.pow(1f-frac, 2.2f))));
|
frac = frac * 1.2f - 0.2f;
|
||||||
// attenuate background color alpha by k
|
if (frac <= 0) {
|
||||||
final int color = (int) ((mScrimColor >>> 24) * k) << 24 | (mScrimColor & 0xFFFFFF);
|
mBar.mStatusBarWindow.setBackgroundColor(0);
|
||||||
mBar.mStatusBarWindow.setBackgroundColor(color);
|
} 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);
|
parent.addView(userTile);
|
||||||
mDynamicSpannedTiles.add(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
|
// Time tile
|
||||||
|
/*
|
||||||
QuickSettingsTileView timeTile = (QuickSettingsTileView)
|
QuickSettingsTileView timeTile = (QuickSettingsTileView)
|
||||||
inflater.inflate(R.layout.quick_settings_tile, parent, false);
|
inflater.inflate(R.layout.quick_settings_tile, parent, false);
|
||||||
timeTile.setContent(R.layout.quick_settings_tile_time, inflater);
|
timeTile.setContent(R.layout.quick_settings_tile_time, inflater);
|
||||||
@@ -338,6 +362,7 @@ class QuickSettings {
|
|||||||
});
|
});
|
||||||
parent.addView(timeTile);
|
parent.addView(timeTile);
|
||||||
mDynamicSpannedTiles.add(timeTile);
|
mDynamicSpannedTiles.add(timeTile);
|
||||||
|
*/
|
||||||
|
|
||||||
// Settings tile
|
// Settings tile
|
||||||
QuickSettingsTileView settingsTile = (QuickSettingsTileView)
|
QuickSettingsTileView settingsTile = (QuickSettingsTileView)
|
||||||
@@ -549,27 +574,6 @@ class QuickSettings {
|
|||||||
parent.addView(bluetoothTile);
|
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) {
|
private void addTemporaryTiles(final ViewGroup parent, final LayoutInflater inflater) {
|
||||||
|
|||||||