summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2014-07-08 16:53:29 +0200
committerJorim Jaggi <jjaggi@google.com>2014-07-09 16:37:32 +0200
commit3f48f46d7e9073edbc4d8613a6dd4d68a37a11b6 (patch)
tree206ed0fd2a903bf66bf9af8de1e5e2db6dcef01a /packages/SystemUI/src
parent6752cba4642ea9103f3013336c005f06968fd442 (diff)
downloadframeworks_base-3f48f46d7e9073edbc4d8613a6dd4d68a37a11b6.zip
frameworks_base-3f48f46d7e9073edbc4d8613a6dd4d68a37a11b6.tar.gz
frameworks_base-3f48f46d7e9073edbc4d8613a6dd4d68a37a11b6.tar.bz2
Update QS header to spec
- Move brightness slider down. - Make clock bigger when expanded. - Show date in collapsed state. - Change size of avatar depending on collapsed/expanded. Bug: 15865202 Bug: 15381387 Change-Id: I7894edae495b5a2d12b4fe4637a9aa3fd2e58963
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSPanel.java27
-rw-r--r--packages/SystemUI/src/com/android/systemui/settings/BrightnessController.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java15
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/ObservableScrollView.java20
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java122
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java18
8 files changed, 154 insertions, 61 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index 9c1dc8e..36cd388 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -28,9 +28,12 @@ import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.ImageView;
import com.android.systemui.R;
import com.android.systemui.qs.QSTile.DetailAdapter;
+import com.android.systemui.settings.BrightnessController;
+import com.android.systemui.settings.ToggleSlider;
import java.util.ArrayList;
@@ -44,6 +47,7 @@ public class QSPanel extends ViewGroup {
private final ViewGroup mDetailContent;
private final View mDetailSettingsButton;
private final View mDetailDoneButton;
+ private final View mBrightnessView;
private final CircularClipper mClipper;
private final H mHandler = new H();
@@ -59,6 +63,7 @@ public class QSPanel extends ViewGroup {
private TileRecord mDetailRecord;
private Callback mCallback;
+ private BrightnessController mBrightnessController;
public QSPanel(Context context) {
this(context, null);
@@ -74,9 +79,16 @@ public class QSPanel extends ViewGroup {
mDetailDoneButton = mDetail.findViewById(android.R.id.button1);
mDetail.setVisibility(GONE);
mDetail.setClickable(true);
+ mBrightnessView = LayoutInflater.from(context).inflate(
+ R.layout.quick_settings_brightness_dialog, this, false);
addView(mDetail);
+ addView(mBrightnessView);
mClipper = new CircularClipper(mDetail);
updateResources();
+
+ mBrightnessController = new BrightnessController(getContext(),
+ (ImageView) findViewById(R.id.brightness_icon),
+ (ToggleSlider) findViewById(R.id.brightness_slider));
}
public void setCallback(Callback callback) {
@@ -115,6 +127,11 @@ public class QSPanel extends ViewGroup {
r.tile.refreshState();
}
}
+ if (listening) {
+ mBrightnessController.registerCallbacks();
+ } else {
+ mBrightnessController.unregisterCallbacks();
+ }
}
private void showDetail(boolean show, TileRecord r) {
@@ -211,6 +228,7 @@ public class QSPanel extends ViewGroup {
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
final int width = MeasureSpec.getSize(widthMeasureSpec);
+ mBrightnessView.measure(exactly(width), MeasureSpec.UNSPECIFIED);
int r = -1;
int c = -1;
int rows = 0;
@@ -238,7 +256,7 @@ public class QSPanel extends ViewGroup {
final int ch = record.row == 0 ? mLargeCellHeight : mCellHeight;
record.tileView.measure(exactly(cw), exactly(ch));
}
- int h = rows == 0 ? 0 : (getRowTop(rows) + mPanelPaddingBottom);
+ int h = rows == 0 ? mBrightnessView.getHeight() : (getRowTop(rows) + mPanelPaddingBottom);
mDetail.measure(exactly(width), exactly(h));
setMeasuredDimension(width, h);
}
@@ -250,6 +268,8 @@ public class QSPanel extends ViewGroup {
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
final int w = getWidth();
+ mBrightnessView.layout(0, 0,
+ mBrightnessView.getMeasuredWidth(), mBrightnessView.getMeasuredHeight());
for (TileRecord record : mRecords) {
if (record.tileView.getVisibility() == GONE) continue;
final int cols = getColumnCount(record.row);
@@ -266,8 +286,9 @@ public class QSPanel extends ViewGroup {
}
private int getRowTop(int row) {
- if (row <= 0) return 0;
- return mLargeCellHeight - mDualTileUnderlap + (row - 1) * mCellHeight;
+ if (row <= 0) return mBrightnessView.getHeight();
+ return mBrightnessView.getHeight()
+ + mLargeCellHeight - mDualTileUnderlap + (row - 1) * mCellHeight;
}
private int getColumnCount(int row) {
diff --git a/packages/SystemUI/src/com/android/systemui/settings/BrightnessController.java b/packages/SystemUI/src/com/android/systemui/settings/BrightnessController.java
index 80e85f9..6d5bb9d 100644
--- a/packages/SystemUI/src/com/android/systemui/settings/BrightnessController.java
+++ b/packages/SystemUI/src/com/android/systemui/settings/BrightnessController.java
@@ -58,6 +58,7 @@ public class BrightnessController implements ToggleSlider.Listener {
new ArrayList<BrightnessStateChangeCallback>();
private boolean mAutomatic;
+ private boolean mListening;
public interface BrightnessStateChangeCallback {
public void onBrightnessLevelChanged();
@@ -159,6 +160,9 @@ public class BrightnessController implements ToggleSlider.Listener {
}
public void registerCallbacks() {
+ if (mListening) {
+ return;
+ }
mBrightnessObserver.startObserving();
mUserTracker.startTracking();
@@ -172,6 +176,9 @@ public class BrightnessController implements ToggleSlider.Listener {
/** Unregister all call backs, both to and from the controller */
public void unregisterCallbacks() {
+ if (!mListening) {
+ return;
+ }
mBrightnessObserver.stopObserving();
mChangeCallbacks.clear();
mUserTracker.stopTracking();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java
index c26f15e..0f12274 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java
@@ -28,6 +28,7 @@ import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.FrameLayout;
import android.widget.ImageButton;
import com.android.systemui.R;
@@ -35,10 +36,9 @@ import com.android.systemui.settings.UserSwitcherHostView;
import com.android.systemui.statusbar.policy.UserInfoController;
/**
- * Image button for the multi user switcher.
+ * Container for image of the multi user switcher (tappable).
*/
-public class MultiUserSwitch extends ImageButton implements View.OnClickListener,
- UserInfoController.OnUserInfoChangedListener {
+public class MultiUserSwitch extends FrameLayout implements View.OnClickListener {
private ViewGroup mOverlayParent;
@@ -78,13 +78,4 @@ public class MultiUserSwitch extends ImageButton implements View.OnClickListener
getContext().startActivityAsUser(intent, new UserHandle(UserHandle.USER_CURRENT));
}
}
-
- public void setUserInfoController(UserInfoController userInfoController) {
- userInfoController.addListener(this);
- }
-
- @Override
- public void onUserInfoChanged(String name, Drawable picture) {
- setImageDrawable(picture);
- }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index bea5d49..e0a1ef1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -434,7 +434,7 @@ public class NotificationPanelView extends PanelView implements
// Block request when interacting with the scroll view so we can still intercept the
// scrolling when QS is expanded.
- if (mScrollView.isDispatchingTouchEvent()) {
+ if (mScrollView.isHandlingTouchEvent()) {
return;
}
super.requestDisallowInterceptTouchEvent(disallowIntercept);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ObservableScrollView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ObservableScrollView.java
index 45f3632..5920580 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ObservableScrollView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ObservableScrollView.java
@@ -29,9 +29,8 @@ public class ObservableScrollView extends ScrollView {
private Listener mListener;
private int mLastOverscrollAmount;
- private boolean mDispatchingTouchEvent;
private boolean mTouchEnabled = true;
- private boolean mInTouchEvent;
+ private boolean mHandlingTouchEvent;
public ObservableScrollView(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -49,8 +48,8 @@ public class ObservableScrollView extends ScrollView {
return getScrollY() == getMaxScrollY();
}
- public boolean isDispatchingTouchEvent() {
- return mDispatchingTouchEvent || mInTouchEvent;
+ public boolean isHandlingTouchEvent() {
+ return mHandlingTouchEvent;
}
private int getMaxScrollY() {
@@ -65,17 +64,17 @@ public class ObservableScrollView extends ScrollView {
@Override
public boolean onTouchEvent(MotionEvent ev) {
- mInTouchEvent = true;
+ mHandlingTouchEvent = true;
boolean result = super.onTouchEvent(ev);
- mInTouchEvent = false;
+ mHandlingTouchEvent = false;
return result;
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
- mInTouchEvent = true;
+ mHandlingTouchEvent = true;
boolean result = super.onInterceptTouchEvent(ev);
- mInTouchEvent = false;
+ mHandlingTouchEvent = false;
return result;
}
@@ -84,10 +83,7 @@ public class ObservableScrollView extends ScrollView {
if (!mTouchEnabled) {
return false;
}
- mDispatchingTouchEvent = true;
- boolean result = super.dispatchTouchEvent(ev);
- mDispatchingTouchEvent = false;
- return result;
+ return super.dispatchTouchEvent(ev);
}
@Override
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 6532b71..f9aadf3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -264,9 +264,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
int[] mPositionTmp = new int[2];
boolean mExpandedVisible;
- // the date view
- DateView mDateView;
-
// on-screen navigation buttons
private NavigationBarView mNavigationBarView = null;
private int mNavigationBarWindowState = WINDOW_STATE_SHOWING;
@@ -618,7 +615,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
mKeyguardIndicationController = new KeyguardIndicationController(mContext,
(KeyguardIndicationTextView) mStatusBarWindow.findViewById(
R.id.keyguard_indication_text));
- mDateView = (DateView)mStatusBarWindow.findViewById(R.id.date);
mDateTimeView = mHeader.findViewById(R.id.datetime);
if (mDateTimeView != null) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
index 70a664f..b95b88f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarHeaderView.java
@@ -16,13 +16,11 @@
package com.android.systemui.statusbar.phone;
-import android.animation.Animator;
-import android.animation.AnimatorListenerAdapter;
import android.content.Context;
import android.content.Intent;
import android.graphics.Outline;
import android.graphics.Rect;
-import android.provider.Settings;
+import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
@@ -35,8 +33,6 @@ import android.widget.TextView;
import com.android.systemui.R;
import com.android.systemui.qs.QSPanel;
import com.android.systemui.qs.QSTile;
-import com.android.systemui.settings.BrightnessController;
-import com.android.systemui.settings.ToggleSlider;
import com.android.systemui.statusbar.policy.BatteryController;
import com.android.systemui.statusbar.policy.UserInfoController;
@@ -54,13 +50,15 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL
private ViewGroup mSystemIconsContainer;
private View mSystemIconsSuperContainer;
private View mDateTime;
+ private TextView mClock;
private View mKeyguardCarrierText;
private MultiUserSwitch mMultiUserSwitch;
- private View mDate;
+ private ImageView mMultiUserAvatar;
+ private View mDateCollapsed;
+ private View mDateExpanded;
private View mStatusIcons;
private View mSignalCluster;
private View mSettingsButton;
- private View mBrightnessContainer;
private View mQsDetailHeader;
private View mEmergencyCallsOnly;
private TextView mBatteryLevel;
@@ -76,10 +74,21 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL
private int mNormalWidth;
private int mPadding;
private int mMultiUserExpandedMargin;
+ private int mMultiUserCollapsedMargin;
+ private int mMultiUserKeyguardMargin;
private int mSystemIconsSwitcherHiddenExpandedMargin;
+ private int mClockMarginBottomExpanded;
+ private int mMultiUserSwitchWidthCollapsed;
+ private int mMultiUserSwitchWidthExpanded;
+
+ /**
+ * In collapsed QS, the clock and avatar are scaled down a bit post-layout to allow for a nice
+ * transition. These values determine that factor.
+ */
+ private float mClockCollapsedScaleFactor;
+ private float mAvatarCollapsedScaleFactor;
private ActivityStarter mActivityStarter;
- private BrightnessController mBrightnessController;
private BatteryController mBatteryController;
private QSPanel mQSPanel;
@@ -97,21 +106,22 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL
mSystemIconsContainer = (ViewGroup) findViewById(R.id.system_icons_container);
mSystemIconsSuperContainer.setOnClickListener(this);
mDateTime = findViewById(R.id.datetime);
+ mClock = (TextView) findViewById(R.id.clock);
mKeyguardCarrierText = findViewById(R.id.keyguard_carrier_text);
mMultiUserSwitch = (MultiUserSwitch) findViewById(R.id.multi_user_switch);
- mDate = findViewById(R.id.date);
+ mMultiUserAvatar = (ImageView) findViewById(R.id.multi_user_avatar);
+ mDateCollapsed = findViewById(R.id.date_collapsed);
+ mDateExpanded = findViewById(R.id.date_expanded);
mSettingsButton = findViewById(R.id.settings_button);
mSettingsButton.setOnClickListener(this);
- mBrightnessContainer = findViewById(R.id.brightness_container);
- mBrightnessController = new BrightnessController(getContext(),
- (ImageView) findViewById(R.id.brightness_icon),
- (ToggleSlider) findViewById(R.id.brightness_slider));
mQsDetailHeader = findViewById(R.id.qs_detail_header);
mQsDetailHeader.setAlpha(0);
mEmergencyCallsOnly = findViewById(R.id.header_emergency_calls_only);
mBatteryLevel = (TextView) findViewById(R.id.battery_level);
loadDimens();
updateVisibilities();
+ updateClockScale();
+ updateAvatarScale();
addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
@Override
public void onLayoutChange(View v, int left, int top, int right,
@@ -120,6 +130,8 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL
// width changed, update clipping
setClipping(getHeight());
}
+ mClock.setPivotX(0);
+ mClock.setPivotY(mClock.getBaseline());
}
});
}
@@ -134,8 +146,24 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL
mPadding = getResources().getDimensionPixelSize(R.dimen.notification_side_padding);
mMultiUserExpandedMargin =
getResources().getDimensionPixelSize(R.dimen.multi_user_switch_expanded_margin);
+ mMultiUserCollapsedMargin =
+ getResources().getDimensionPixelSize(R.dimen.multi_user_switch_collapsed_margin);
+ mMultiUserKeyguardMargin =
+ getResources().getDimensionPixelSize(R.dimen.multi_user_switch_keyguard_margin);
mSystemIconsSwitcherHiddenExpandedMargin = getResources().getDimensionPixelSize(
R.dimen.system_icons_switcher_hidden_expanded_margin);
+ mClockMarginBottomExpanded =
+ getResources().getDimensionPixelSize(R.dimen.clock_expanded_bottom_margin);
+ mMultiUserSwitchWidthCollapsed =
+ getResources().getDimensionPixelSize(R.dimen.multi_user_switch_width_collapsed);
+ mMultiUserSwitchWidthExpanded =
+ getResources().getDimensionPixelSize(R.dimen.multi_user_switch_width_expanded);
+ mAvatarCollapsedScaleFactor =
+ getResources().getDimensionPixelSize(R.dimen.multi_user_avatar_collapsed_size)
+ / (float) mMultiUserAvatar.getLayoutParams().width;
+ mClockCollapsedScaleFactor =
+ getResources().getDimensionPixelSize(R.dimen.qs_time_collapsed_size)
+ / mClock.getTextSize();
}
public void setActivityStarter(ActivityStarter activityStarter) {
@@ -159,7 +187,6 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL
return;
}
mListening = listening;
- updateBrightnessControllerState();
updateBatteryListening();
}
@@ -180,6 +207,9 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL
if (mQSPanel != null) {
mQSPanel.setExpanded(expanded && !overscrolled);
}
+ updateClockScale();
+ updateAvatarScale();
+ updateClockLp();
}
}
@@ -229,9 +259,9 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL
}
mDateTime.setVisibility(onKeyguardAndCollapsed ? View.INVISIBLE : View.VISIBLE);
mKeyguardCarrierText.setVisibility(onKeyguardAndCollapsed ? View.VISIBLE : View.GONE);
- mDate.setVisibility(mExpanded ? View.VISIBLE : View.GONE);
+ mDateCollapsed.setVisibility(mExpanded && !mOverscrolled ? View.GONE : View.VISIBLE);
+ mDateExpanded.setVisibility(mExpanded && !mOverscrolled ? View.VISIBLE : View.GONE);
mSettingsButton.setVisibility(mExpanded && !mOverscrolled ? View.VISIBLE : View.GONE);
- mBrightnessContainer.setVisibility(mExpanded ? View.VISIBLE : View.GONE);
mQsDetailHeader.setVisibility(mExpanded ? View.VISIBLE : View.GONE);
if (mStatusIcons != null) {
mStatusIcons.setVisibility(!mExpanded || mOverscrolled ? View.VISIBLE : View.GONE);
@@ -260,19 +290,31 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL
mSystemIconsSuperContainer.setLayoutParams(lp);
}
- private void updateBrightnessControllerState() {
+ private void updateBatteryListening() {
if (mListening) {
- mBrightnessController.registerCallbacks();
+ mBatteryController.addStateChangedCallback(this);
} else {
- mBrightnessController.unregisterCallbacks();
+ mBatteryController.removeStateChangedCallback(this);
}
}
- private void updateBatteryListening() {
- if (mListening) {
- mBatteryController.addStateChangedCallback(this);
+ private void updateAvatarScale() {
+ if (!mExpanded || mOverscrolled) {
+ mMultiUserSwitch.setScaleX(mAvatarCollapsedScaleFactor);
+ mMultiUserSwitch.setScaleY(mAvatarCollapsedScaleFactor);
} else {
- mBatteryController.removeStateChangedCallback(this);
+ mMultiUserSwitch.setScaleX(1f);
+ mMultiUserSwitch.setScaleY(1f);
+ }
+ }
+
+ private void updateClockScale() {
+ if (!mExpanded || mOverscrolled) {
+ mClock.setScaleX(mClockCollapsedScaleFactor);
+ mClock.setScaleY(mClockCollapsedScaleFactor);
+ } else {
+ mClock.setScaleX(1f);
+ mClock.setScaleY(1f);
}
}
@@ -305,11 +347,32 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL
setPaddingRelative(padding, 0, padding, 0);
}
+ private void updateClockLp() {
+ int marginBottom = mExpanded && !mOverscrolled ? mClockMarginBottomExpanded : 0;
+ LayoutParams lp = (LayoutParams) mDateTime.getLayoutParams();
+ int rule = mExpanded && !mOverscrolled ? TRUE : 0;
+ if (marginBottom != lp.bottomMargin
+ || lp.getRules()[RelativeLayout.ALIGN_PARENT_BOTTOM] != rule) {
+ lp.bottomMargin = marginBottom;
+ lp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, rule);
+ mDateTime.setLayoutParams(lp);
+ }
+ }
+
private void updateMultiUserSwitch() {
- int marginEnd = !mKeyguardShowing || mExpanded ? mMultiUserExpandedMargin : 0;
+ int marginEnd;
+ if (mExpanded) {
+ marginEnd = mMultiUserExpandedMargin;
+ } else if (mKeyguardShowing) {
+ marginEnd = mMultiUserKeyguardMargin;
+ } else {
+ marginEnd = mMultiUserCollapsedMargin;
+ }
+ int width = mExpanded ? mMultiUserSwitchWidthExpanded : mMultiUserSwitchWidthCollapsed;
MarginLayoutParams lp = (MarginLayoutParams) mMultiUserSwitch.getLayoutParams();
- if (marginEnd != lp.getMarginEnd()) {
+ if (marginEnd != lp.getMarginEnd() || lp.width != width) {
lp.setMarginEnd(marginEnd);
+ lp.width = width;
mMultiUserSwitch.setLayoutParams(lp);
}
}
@@ -361,7 +424,12 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL
}
public void setUserInfoController(UserInfoController userInfoController) {
- mMultiUserSwitch.setUserInfoController(userInfoController);
+ userInfoController.addListener(new UserInfoController.OnUserInfoChangedListener() {
+ @Override
+ public void onUserInfoChanged(String name, Drawable picture) {
+ mMultiUserAvatar.setImageDrawable(picture);
+ }
+ });
}
public void setOverlayParent(ViewGroup parent) {
@@ -445,7 +513,7 @@ public class StatusBarHeaderView extends RelativeLayout implements View.OnClickL
private void handleShowingDetail(final QSTile.DetailAdapter detail) {
final boolean showingDetail = detail != null;
- transition(mBrightnessContainer, !showingDetail);
+ transition(mDateTime, !showingDetail);
transition(mQsDetailHeader, showingDetail);
if (showingDetail) {
final TextView headerTitle = (TextView)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java
index f978833..186005c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java
@@ -20,6 +20,7 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.content.res.TypedArray;
import android.text.format.DateFormat;
import android.util.AttributeSet;
import android.widget.TextView;
@@ -37,6 +38,7 @@ public class DateView extends TextView {
private SimpleDateFormat mDateFormat;
private String mLastText;
+ private String mDatePattern;
private BroadcastReceiver mIntentReceiver = new BroadcastReceiver() {
@Override
@@ -58,6 +60,19 @@ public class DateView extends TextView {
public DateView(Context context, AttributeSet attrs) {
super(context, attrs);
+ TypedArray a = context.getTheme().obtainStyledAttributes(
+ attrs,
+ R.styleable.DateView,
+ 0, 0);
+
+ try {
+ mDatePattern = a.getString(R.styleable.DateView_datePattern);
+ } finally {
+ a.recycle();
+ }
+ if (mDatePattern == null) {
+ mDatePattern = getContext().getString(R.string.system_ui_date_pattern);
+ }
}
@Override
@@ -84,9 +99,8 @@ public class DateView extends TextView {
protected void updateClock() {
if (mDateFormat == null) {
- final String dateFormat = getContext().getString(R.string.system_ui_date_pattern);
final Locale l = Locale.getDefault();
- final String fmt = DateFormat.getBestDateTimePattern(l, dateFormat);
+ final String fmt = DateFormat.getBestDateTimePattern(l, mDatePattern);
mDateFormat = new SimpleDateFormat(fmt, l);
}