Move clock to the left, carrier text to the bottom
This change moves the clock to the left of status bar and QS screen. Also removes the date/alarm clock group at the bottom of QS and replaces it with carrier text. Test: visual Bug: 63772836 Bug: 70799093 Change-Id: I7d0a30c126c52745237c647a4af5af46d8418f30
This commit is contained in:
@@ -29,14 +29,6 @@
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<include
|
||||
android:id="@+id/date_time_alarm_group"
|
||||
layout="@layout/status_bar_alarm_group"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -44,6 +36,18 @@
|
||||
android:layout_marginEnd="8dp"
|
||||
android:gravity="end">
|
||||
|
||||
<com.android.keyguard.CarrierText
|
||||
android:id="@+id/qs_carrier_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|start"
|
||||
android:ellipsize="marquee"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textDirection="locale"
|
||||
android:singleLine="true" />
|
||||
|
||||
<com.android.systemui.statusbar.phone.MultiUserSwitch
|
||||
android:id="@+id/multi_user_switch"
|
||||
android:layout_width="48dp"
|
||||
|
||||
@@ -28,32 +28,29 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
|
||||
<com.android.keyguard.CarrierText
|
||||
android:id="@+id/qs_carrier_text"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|start"
|
||||
android:ellipsize="marquee"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textDirection="locale"
|
||||
android:singleLine="true" />
|
||||
|
||||
<com.android.systemui.BatteryMeterView android:id="@+id/battery"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
/>
|
||||
|
||||
<com.android.systemui.statusbar.policy.Clock
|
||||
android:id="@+id/clock"
|
||||
android:textAppearance="@style/TextAppearance.StatusBar.Clock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:singleLine="true"
|
||||
android:paddingStart="@dimen/status_bar_clock_starting_padding"
|
||||
android:paddingEnd="@dimen/status_bar_clock_end_padding"
|
||||
android:paddingStart="@dimen/status_bar_left_clock_starting_padding"
|
||||
android:paddingEnd="@dimen/status_bar_left_clock_end_padding"
|
||||
android:gravity="center_vertical|start"
|
||||
systemui:showDark="false"
|
||||
/>
|
||||
|
||||
<android.widget.Space
|
||||
android:id="@+id/space"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
/>
|
||||
|
||||
<com.android.systemui.BatteryMeterView android:id="@+id/battery"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:gravity="center_vertical|end"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -54,6 +54,17 @@
|
||||
android:layout_height="match_parent"
|
||||
android:layout="@layout/operator_name" />
|
||||
|
||||
<com.android.systemui.statusbar.policy.Clock
|
||||
android:id="@+id/clock"
|
||||
android:textAppearance="@style/TextAppearance.StatusBar.Clock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:singleLine="true"
|
||||
android:paddingStart="@dimen/status_bar_left_clock_starting_padding"
|
||||
android:paddingEnd="@dimen/status_bar_left_clock_end_padding"
|
||||
android:gravity="center_vertical|start"
|
||||
/>
|
||||
|
||||
<!-- The alpha of this area is controlled from both PhoneStatusBarTransitions and
|
||||
PhoneStatusBar (DISABLE_NOTIFICATION_ICONS). -->
|
||||
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout
|
||||
@@ -70,17 +81,6 @@
|
||||
>
|
||||
|
||||
<include layout="@layout/system_icons" />
|
||||
|
||||
<com.android.systemui.statusbar.policy.Clock
|
||||
android:id="@+id/clock"
|
||||
android:textAppearance="@style/TextAppearance.StatusBar.Clock"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:singleLine="true"
|
||||
android:paddingStart="@dimen/status_bar_clock_starting_padding"
|
||||
android:paddingEnd="@dimen/status_bar_clock_end_padding"
|
||||
android:gravity="center_vertical|start"
|
||||
/>
|
||||
</com.android.keyguard.AlphaOptimizedLinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -48,6 +48,12 @@
|
||||
<!-- The end padding for the clock in the status bar. -->
|
||||
<dimen name="status_bar_clock_end_padding">0dp</dimen>
|
||||
|
||||
<!-- Starting padding for a left-aligned status bar clock -->
|
||||
<dimen name="status_bar_left_clock_starting_padding">0dp</dimen>
|
||||
|
||||
<!-- End padding for left-aligned status bar clock -->
|
||||
<dimen name="status_bar_left_clock_end_padding">7dp</dimen>
|
||||
|
||||
<!-- Spacing after the wifi signals that is present if there are any icons following it. -->
|
||||
<dimen name="status_bar_wifi_signal_spacer_width">4dp</dimen>
|
||||
|
||||
|
||||
@@ -72,30 +72,22 @@ import com.android.systemui.statusbar.policy.UserInfoController.OnUserInfoChange
|
||||
import com.android.systemui.tuner.TunerService;
|
||||
|
||||
public class QSFooterImpl extends FrameLayout implements QSFooter,
|
||||
NextAlarmChangeCallback, OnClickListener, OnUserInfoChangedListener, EmergencyListener,
|
||||
OnClickListener, OnUserInfoChangedListener, EmergencyListener,
|
||||
SignalCallback, CommandQueue.Callbacks {
|
||||
private static final float EXPAND_INDICATOR_THRESHOLD = .93f;
|
||||
|
||||
private ActivityStarter mActivityStarter;
|
||||
private NextAlarmController mNextAlarmController;
|
||||
private UserInfoController mUserInfoController;
|
||||
private SettingsButton mSettingsButton;
|
||||
protected View mSettingsContainer;
|
||||
|
||||
private TextView mAlarmStatus;
|
||||
private View mAlarmStatusCollapsed;
|
||||
private View mDate;
|
||||
|
||||
private boolean mQsDisabled;
|
||||
private QSPanel mQsPanel;
|
||||
|
||||
private boolean mExpanded;
|
||||
private boolean mAlarmShowing;
|
||||
|
||||
protected ExpandableIndicator mExpandIndicator;
|
||||
|
||||
private boolean mListening;
|
||||
private AlarmManager.AlarmClockInfo mNextAlarm;
|
||||
|
||||
private boolean mShowEmergencyCallsOnly;
|
||||
protected MultiUserSwitch mMultiUserSwitch;
|
||||
@@ -106,9 +98,6 @@ public class QSFooterImpl extends FrameLayout implements QSFooter,
|
||||
|
||||
protected View mEdit;
|
||||
private TouchAnimator mAnimator;
|
||||
private View mDateTimeGroup;
|
||||
private boolean mKeyguardShowing;
|
||||
private TouchAnimator mAlarmAnimator;
|
||||
|
||||
public QSFooterImpl(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
@@ -124,18 +113,11 @@ public class QSFooterImpl extends FrameLayout implements QSFooter,
|
||||
Dependency.get(ActivityStarter.class).postQSRunnableDismissingKeyguard(() ->
|
||||
mQsPanel.showEdit(view)));
|
||||
|
||||
mDateTimeGroup = findViewById(id.date_time_alarm_group);
|
||||
mDate = findViewById(R.id.date);
|
||||
|
||||
mExpandIndicator = findViewById(R.id.expand_indicator);
|
||||
mSettingsButton = findViewById(R.id.settings_button);
|
||||
mSettingsContainer = findViewById(R.id.settings_button_container);
|
||||
mSettingsButton.setOnClickListener(this);
|
||||
|
||||
mAlarmStatusCollapsed = findViewById(R.id.alarm_status_collapsed);
|
||||
mAlarmStatus = findViewById(R.id.alarm_status);
|
||||
mDateTimeGroup.setOnClickListener(this);
|
||||
|
||||
mMultiUserSwitch = findViewById(R.id.multi_user_switch);
|
||||
mMultiUserAvatar = mMultiUserSwitch.findViewById(R.id.multi_user_avatar);
|
||||
|
||||
@@ -146,7 +128,6 @@ public class QSFooterImpl extends FrameLayout implements QSFooter,
|
||||
|
||||
updateResources();
|
||||
|
||||
mNextAlarmController = Dependency.get(NextAlarmController.class);
|
||||
mUserInfoController = Dependency.get(UserInfoController.class);
|
||||
mActivityStarter = Dependency.get(ActivityStarter.class);
|
||||
addOnLayoutChangeListener((v, left, top, right, bottom, oldLeft, oldTop, oldRight,
|
||||
@@ -165,28 +146,7 @@ public class QSFooterImpl extends FrameLayout implements QSFooter,
|
||||
isLayoutRtl() ? (remaining - defSpace) : -(remaining - defSpace), 0)
|
||||
.addFloat(mSettingsButton, "rotation", -120, 0)
|
||||
.build();
|
||||
if (mAlarmShowing) {
|
||||
int translate = isLayoutRtl() ? mDate.getWidth() : -mDate.getWidth();
|
||||
mAlarmAnimator = new Builder().addFloat(mDate, "alpha", 1, 0)
|
||||
.addFloat(mDateTimeGroup, "translationX", 0, translate)
|
||||
.addFloat(mAlarmStatus, "alpha", 0, 1)
|
||||
.setListener(new ListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationAtStart() {
|
||||
mAlarmStatus.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationStarted() {
|
||||
mAlarmStatus.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}).build();
|
||||
} else {
|
||||
mAlarmAnimator = null;
|
||||
mAlarmStatus.setVisibility(View.GONE);
|
||||
mDate.setAlpha(1);
|
||||
mDateTimeGroup.setTranslationX(0);
|
||||
}
|
||||
setExpansion(mExpansionAmount);
|
||||
}
|
||||
|
||||
@@ -203,27 +163,11 @@ public class QSFooterImpl extends FrameLayout implements QSFooter,
|
||||
}
|
||||
|
||||
private void updateResources() {
|
||||
FontSizeUtils.updateFontSize(mAlarmStatus, R.dimen.qs_date_collapsed_size);
|
||||
|
||||
updateSettingsAnimator();
|
||||
}
|
||||
|
||||
private void updateSettingsAnimator() {
|
||||
mSettingsAlpha = createSettingsAlphaAnimator();
|
||||
|
||||
final boolean isRtl = isLayoutRtl();
|
||||
if (isRtl && mDate.getWidth() == 0) {
|
||||
mDate.addOnLayoutChangeListener(new OnLayoutChangeListener() {
|
||||
@Override
|
||||
public void onLayoutChange(View v, int left, int top, int right, int bottom,
|
||||
int oldLeft, int oldTop, int oldRight, int oldBottom) {
|
||||
mDate.setPivotX(getWidth());
|
||||
mDate.removeOnLayoutChangeListener(this);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
mDate.setPivotX(isRtl ? mDate.getWidth() : 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -236,7 +180,6 @@ public class QSFooterImpl extends FrameLayout implements QSFooter,
|
||||
|
||||
@Override
|
||||
public void setKeyguardShowing(boolean keyguardShowing) {
|
||||
mKeyguardShowing = keyguardShowing;
|
||||
setExpansion(mExpansionAmount);
|
||||
}
|
||||
|
||||
@@ -247,37 +190,15 @@ public class QSFooterImpl extends FrameLayout implements QSFooter,
|
||||
updateEverything();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNextAlarmChanged(AlarmManager.AlarmClockInfo nextAlarm) {
|
||||
mNextAlarm = nextAlarm;
|
||||
if (nextAlarm != null) {
|
||||
String alarmString = KeyguardStatusView.formatNextAlarm(getContext(), nextAlarm);
|
||||
mAlarmStatus.setText(alarmString);
|
||||
mAlarmStatus.setContentDescription(mContext.getString(
|
||||
R.string.accessibility_quick_settings_alarm, alarmString));
|
||||
mAlarmStatusCollapsed.setContentDescription(mContext.getString(
|
||||
R.string.accessibility_quick_settings_alarm, alarmString));
|
||||
}
|
||||
if (mAlarmShowing != (nextAlarm != null)) {
|
||||
mAlarmShowing = nextAlarm != null;
|
||||
updateAnimator(getWidth());
|
||||
updateEverything();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExpansion(float headerExpansionFraction) {
|
||||
mExpansionAmount = headerExpansionFraction;
|
||||
if (mAnimator != null) mAnimator.setPosition(headerExpansionFraction);
|
||||
if (mAlarmAnimator != null) mAlarmAnimator.setPosition(
|
||||
mKeyguardShowing ? 0 : headerExpansionFraction);
|
||||
|
||||
if (mSettingsAlpha != null) {
|
||||
mSettingsAlpha.setPosition(headerExpansionFraction);
|
||||
}
|
||||
|
||||
updateAlarmVisibilities();
|
||||
|
||||
mExpandIndicator.setExpanded(headerExpansionFraction > EXPAND_INDICATOR_THRESHOLD);
|
||||
}
|
||||
|
||||
@@ -295,10 +216,6 @@ public class QSFooterImpl extends FrameLayout implements QSFooter,
|
||||
super.onDetachedFromWindow();
|
||||
}
|
||||
|
||||
private void updateAlarmVisibilities() {
|
||||
mAlarmStatusCollapsed.setVisibility(mAlarmShowing ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setListening(boolean listening) {
|
||||
if (listening == mListening) {
|
||||
@@ -329,8 +246,6 @@ public class QSFooterImpl extends FrameLayout implements QSFooter,
|
||||
}
|
||||
|
||||
private void updateVisibilities() {
|
||||
updateAlarmVisibilities();
|
||||
|
||||
mSettingsContainer.setVisibility(mQsDisabled ? View.GONE : View.VISIBLE);
|
||||
mSettingsContainer.findViewById(R.id.tuner_icon).setVisibility(
|
||||
TunerService.isTunerEnabled(mContext) ? View.VISIBLE : View.INVISIBLE);
|
||||
@@ -349,14 +264,12 @@ public class QSFooterImpl extends FrameLayout implements QSFooter,
|
||||
|
||||
private void updateListeners() {
|
||||
if (mListening) {
|
||||
mNextAlarmController.addCallback(this);
|
||||
mUserInfoController.addCallback(this);
|
||||
if (Dependency.get(NetworkController.class).hasVoiceCallingFeature()) {
|
||||
Dependency.get(NetworkController.class).addEmergencyListener(this);
|
||||
Dependency.get(NetworkController.class).addCallback(this);
|
||||
}
|
||||
} else {
|
||||
mNextAlarmController.removeCallback(this);
|
||||
mUserInfoController.removeCallback(this);
|
||||
Dependency.get(NetworkController.class).removeEmergencyListener(this);
|
||||
Dependency.get(NetworkController.class).removeCallback(this);
|
||||
@@ -400,16 +313,6 @@ public class QSFooterImpl extends FrameLayout implements QSFooter,
|
||||
} else {
|
||||
startSettingsActivity();
|
||||
}
|
||||
} else if (v == mDateTimeGroup) {
|
||||
Dependency.get(MetricsLogger.class).action(ACTION_QS_DATE,
|
||||
mNextAlarm != null);
|
||||
if (mNextAlarm != null) {
|
||||
PendingIntent showIntent = mNextAlarm.getShowIntent();
|
||||
mActivityStarter.startPendingIntentDismissingKeyguard(showIntent);
|
||||
} else {
|
||||
mActivityStarter.postStartActivityDismissingKeyguard(new Intent(
|
||||
AlarmClock.ACTION_SHOW_ALARMS), 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
|
||||
private KeyguardMonitor mKeyguardMonitor;
|
||||
private NetworkController mNetworkController;
|
||||
private LinearLayout mSystemIconArea;
|
||||
private View mClockView;
|
||||
private View mNotificationIconAreaInner;
|
||||
private int mDisabled1;
|
||||
private StatusBar mStatusBarComponent;
|
||||
@@ -93,6 +94,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
|
||||
mDarkIconManager = new DarkIconManager(view.findViewById(R.id.statusIcons));
|
||||
Dependency.get(StatusBarIconController.class).addIconGroup(mDarkIconManager);
|
||||
mSystemIconArea = mStatusBar.findViewById(R.id.system_icon_area);
|
||||
mClockView = mStatusBar.findViewById(R.id.clock);
|
||||
mSignalClusterView = mStatusBar.findViewById(R.id.signal_cluster);
|
||||
Dependency.get(DarkIconDispatcher.class).addDarkReceiver(mSignalClusterView);
|
||||
// Default to showing until we know otherwise.
|
||||
@@ -197,10 +199,12 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
|
||||
|
||||
public void hideSystemIconArea(boolean animate) {
|
||||
animateHide(mSystemIconArea, animate);
|
||||
animateHide(mClockView, animate);
|
||||
}
|
||||
|
||||
public void showSystemIconArea(boolean animate) {
|
||||
animateShow(mSystemIconArea, animate);
|
||||
animateShow(mClockView, animate);
|
||||
}
|
||||
|
||||
public void hideNotificationIconArea(boolean animate) {
|
||||
|
||||
Reference in New Issue
Block a user