Merge changes I53d2205b,I2dc43001 into sc-dev am: 3a9c1fcf46
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13629033 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I1b95bae1f19df25d5ccfde1e687751d9c1631923
This commit is contained in:
@@ -64,7 +64,7 @@
|
|||||||
android:id="@+id/new_lockscreen_clock_view"
|
android:id="@+id/new_lockscreen_clock_view"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
<com.android.keyguard.AnimatableClockView
|
<com.android.keyguard.AnimatableClockView
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:textSize="100dp"
|
android:textSize="60dp"
|
||||||
android:fontFamily="@font/clock"
|
android:fontFamily="@font/clock"
|
||||||
android:typeface="monospace"
|
android:typeface="monospace"
|
||||||
android:elegantTextHeight="false"
|
android:elegantTextHeight="false"
|
||||||
|
|||||||
@@ -47,26 +47,25 @@
|
|||||||
<dimen name="eca_overlap">-10dip</dimen>
|
<dimen name="eca_overlap">-10dip</dimen>
|
||||||
|
|
||||||
<!-- Slice header -->
|
<!-- Slice header -->
|
||||||
<dimen name="widget_title_font_size">24dp</dimen>
|
<dimen name="widget_title_font_size">20dp</dimen>
|
||||||
<dimen name="header_subtitle_padding">12dp</dimen>
|
<dimen name="widget_title_line_height">24dp</dimen>
|
||||||
<dimen name="header_icon_size">16dp</dimen>
|
<dimen name="header_icon_size">16dp</dimen>
|
||||||
<!-- Slice subtitle -->
|
<!-- Slice subtitle -->
|
||||||
<dimen name="widget_label_font_size">18dp</dimen>
|
<dimen name="widget_label_font_size">16dp</dimen>
|
||||||
|
<dimen name="widget_label_line_height">20dp</dimen>
|
||||||
<!-- Clock without header -->
|
<!-- Clock without header -->
|
||||||
<dimen name="widget_big_font_size">54dp</dimen>
|
<dimen name="widget_big_font_size">54dp</dimen>
|
||||||
<dimen name="bottom_text_spacing_digital">0dp</dimen>
|
<dimen name="bottom_text_spacing_digital">0dp</dimen>
|
||||||
<dimen name="title_clock_padding">4dp</dimen>
|
<dimen name="title_clock_padding">4dp</dimen>
|
||||||
<!-- Clock with header -->
|
<!-- Clock with header -->
|
||||||
<dimen name="widget_small_font_size">@dimen/widget_title_font_size</dimen>
|
<dimen name="widget_small_font_size">@dimen/widget_title_font_size</dimen>
|
||||||
<dimen name="widget_vertical_padding">17dp</dimen>
|
<dimen name="widget_vertical_padding">5dp</dimen>
|
||||||
<dimen name="widget_vertical_padding_with_header">25dp</dimen>
|
<dimen name="widget_vertical_padding_with_header">25dp</dimen>
|
||||||
<dimen name="widget_vertical_padding_clock">12dp</dimen>
|
<dimen name="widget_vertical_padding_clock">12dp</dimen>
|
||||||
<!-- Subtitle paddings -->
|
<!-- Subtitle paddings -->
|
||||||
<dimen name="widget_horizontal_padding">8dp</dimen>
|
<dimen name="widget_horizontal_padding">8dp</dimen>
|
||||||
<dimen name="widget_icon_size">20dp</dimen>
|
<dimen name="widget_icon_size">18dp</dimen>
|
||||||
<dimen name="widget_icon_padding">8dp</dimen>
|
<dimen name="widget_icon_padding">8dp</dimen>
|
||||||
<dimen name="subtitle_clock_padding">0dp</dimen>
|
|
||||||
<dimen name="header_row_font_size">14dp</dimen>
|
|
||||||
<!-- Notification shelf padding when dark -->
|
<!-- Notification shelf padding when dark -->
|
||||||
<dimen name="widget_bottom_separator_padding">-6dp</dimen>
|
<dimen name="widget_bottom_separator_padding">-6dp</dimen>
|
||||||
|
|
||||||
|
|||||||
@@ -120,6 +120,7 @@
|
|||||||
|
|
||||||
<style name="TextAppearance.Keyguard">
|
<style name="TextAppearance.Keyguard">
|
||||||
<item name="android:textSize">@dimen/widget_title_font_size</item>
|
<item name="android:textSize">@dimen/widget_title_font_size</item>
|
||||||
|
<item name="android:lineHeight">@dimen/widget_title_line_height</item>
|
||||||
<item name="android:gravity">center</item>
|
<item name="android:gravity">center</item>
|
||||||
<item name="android:ellipsize">end</item>
|
<item name="android:ellipsize">end</item>
|
||||||
<item name="android:maxLines">2</item>
|
<item name="android:maxLines">2</item>
|
||||||
@@ -133,6 +134,7 @@
|
|||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
<item name="android:lines">1</item>
|
<item name="android:lines">1</item>
|
||||||
<item name="android:textSize">@dimen/widget_label_font_size</item>
|
<item name="android:textSize">@dimen/widget_label_font_size</item>
|
||||||
|
<item name="android:lineHeight">@dimen/widget_label_line_height</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="TextAppearance.Keyguard.BottomArea">
|
<style name="TextAppearance.Keyguard.BottomArea">
|
||||||
|
|||||||
@@ -21,9 +21,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.Paint;
|
|
||||||
import android.icu.text.NumberFormat;
|
import android.icu.text.NumberFormat;
|
||||||
import android.util.MathUtils;
|
|
||||||
|
|
||||||
import com.android.settingslib.Utils;
|
import com.android.settingslib.Utils;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
@@ -94,11 +92,6 @@ public class AnimatableClockController extends ViewController<AnimatableClockVie
|
|||||||
mStatusBarStateController.removeCallback(mStatusBarStateListener);
|
mStatusBarStateController.removeCallback(mStatusBarStateListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
float getClockTextTopPadding() {
|
|
||||||
Paint.FontMetrics fm = mView.getPaint().getFontMetrics();
|
|
||||||
return MathUtils.abs(fm.ascent - fm.top);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the time for the view.
|
* Updates the time for the view.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -179,20 +179,15 @@ public class KeyguardClockSwitch extends RelativeLayout {
|
|||||||
setPaddingRelative(startEndPadding, 0, startEndPadding, 0);
|
setPaddingRelative(startEndPadding, 0, startEndPadding, 0);
|
||||||
mSmallClockFrame.setVisibility(GONE);
|
mSmallClockFrame.setVisibility(GONE);
|
||||||
mNewLockscreenClockFrame.setVisibility(VISIBLE);
|
mNewLockscreenClockFrame.setVisibility(VISIBLE);
|
||||||
|
statusAreaLP.addRule(RelativeLayout.BELOW, R.id.new_lockscreen_clock_view);
|
||||||
statusAreaLP.removeRule(RelativeLayout.BELOW);
|
|
||||||
statusAreaLP.addRule(RelativeLayout.ALIGN_PARENT_START);
|
statusAreaLP.addRule(RelativeLayout.ALIGN_PARENT_START);
|
||||||
statusAreaLP.addRule(RelativeLayout.START_OF, R.id.new_lockscreen_clock_view);
|
|
||||||
statusAreaLP.width = 0;
|
|
||||||
} else {
|
} else {
|
||||||
setPaddingRelative(0, 0, 0, 0);
|
setPaddingRelative(0, 0, 0, 0);
|
||||||
mSmallClockFrame.setVisibility(VISIBLE);
|
mSmallClockFrame.setVisibility(VISIBLE);
|
||||||
mNewLockscreenClockFrame.setVisibility(GONE);
|
mNewLockscreenClockFrame.setVisibility(GONE);
|
||||||
|
|
||||||
statusAreaLP.removeRule(RelativeLayout.ALIGN_PARENT_START);
|
statusAreaLP.removeRule(RelativeLayout.ALIGN_PARENT_START);
|
||||||
statusAreaLP.removeRule(RelativeLayout.START_OF);
|
|
||||||
statusAreaLP.addRule(RelativeLayout.BELOW, R.id.clock_view);
|
statusAreaLP.addRule(RelativeLayout.BELOW, R.id.clock_view);
|
||||||
statusAreaLP.width = ViewGroup.LayoutParams.MATCH_PARENT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
requestLayout();
|
requestLayout();
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import android.app.WallpaperManager;
|
|||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.text.format.DateFormat;
|
import android.text.format.DateFormat;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@@ -212,10 +213,10 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
|
|||||||
* keep the clock centered.
|
* keep the clock centered.
|
||||||
*/
|
*/
|
||||||
void updatePosition(int x, float scale, AnimationProperties props, boolean animate) {
|
void updatePosition(int x, float scale, AnimationProperties props, boolean animate) {
|
||||||
x = Math.abs(x);
|
x = getCurrentLayoutDirection() == View.LAYOUT_DIRECTION_RTL ? -x : x;
|
||||||
if (mNewLockScreenClockFrame != null) {
|
if (mNewLockScreenClockFrame != null) {
|
||||||
PropertyAnimator.setProperty(mNewLockScreenClockFrame, AnimatableProperty.TRANSLATION_X,
|
PropertyAnimator.setProperty(mNewLockScreenClockFrame, AnimatableProperty.TRANSLATION_X,
|
||||||
-x, props, animate);
|
x, props, animate);
|
||||||
PropertyAnimator.setProperty(mNewLockScreenLargeClockFrame, AnimatableProperty.SCALE_X,
|
PropertyAnimator.setProperty(mNewLockScreenLargeClockFrame, AnimatableProperty.SCALE_X,
|
||||||
scale, props, animate);
|
scale, props, animate);
|
||||||
PropertyAnimator.setProperty(mNewLockScreenLargeClockFrame, AnimatableProperty.SCALE_Y,
|
PropertyAnimator.setProperty(mNewLockScreenLargeClockFrame, AnimatableProperty.SCALE_Y,
|
||||||
@@ -277,15 +278,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
|
|||||||
refreshFormat(mTimeFormat);
|
refreshFormat(mTimeFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
float getClockTextTopPadding() {
|
|
||||||
if (mLockScreenMode == KeyguardUpdateMonitor.LOCK_SCREEN_MODE_LAYOUT_1
|
|
||||||
&& mNewLockScreenClockViewController != null) {
|
|
||||||
return mNewLockScreenClockViewController.getClockTextTopPadding();
|
|
||||||
}
|
|
||||||
|
|
||||||
return mView.getClockTextTopPadding();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateAodIcons() {
|
private void updateAodIcons() {
|
||||||
NotificationIconContainer nic = (NotificationIconContainer)
|
NotificationIconContainer nic = (NotificationIconContainer)
|
||||||
mView.findViewById(
|
mView.findViewById(
|
||||||
@@ -337,4 +329,8 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
|
|||||||
sCacheKey = key;
|
sCacheKey = key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getCurrentLayoutDirection() {
|
||||||
|
return TextUtils.getLayoutDirectionFromLocale(Locale.getDefault());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,10 +85,6 @@ public class KeyguardSliceView extends LinearLayout {
|
|||||||
*/
|
*/
|
||||||
private Runnable mContentChangeListener;
|
private Runnable mContentChangeListener;
|
||||||
private boolean mHasHeader;
|
private boolean mHasHeader;
|
||||||
private final int mRowWithHeaderPadding;
|
|
||||||
private final int mRowPadding;
|
|
||||||
private float mRowTextSize;
|
|
||||||
private float mRowWithHeaderTextSize;
|
|
||||||
private View.OnClickListener mOnClickListener;
|
private View.OnClickListener mOnClickListener;
|
||||||
|
|
||||||
private int mLockScreenMode = KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL;
|
private int mLockScreenMode = KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL;
|
||||||
@@ -97,9 +93,6 @@ public class KeyguardSliceView extends LinearLayout {
|
|||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
|
|
||||||
Resources resources = context.getResources();
|
Resources resources = context.getResources();
|
||||||
mRowPadding = resources.getDimensionPixelSize(R.dimen.subtitle_clock_padding);
|
|
||||||
mRowWithHeaderPadding = resources.getDimensionPixelSize(R.dimen.header_subtitle_padding);
|
|
||||||
|
|
||||||
mLayoutTransition = new LayoutTransition();
|
mLayoutTransition = new LayoutTransition();
|
||||||
mLayoutTransition.setStagger(LayoutTransition.CHANGE_APPEARING, DEFAULT_ANIM_DURATION / 2);
|
mLayoutTransition.setStagger(LayoutTransition.CHANGE_APPEARING, DEFAULT_ANIM_DURATION / 2);
|
||||||
mLayoutTransition.setDuration(LayoutTransition.APPEARING, DEFAULT_ANIM_DURATION);
|
mLayoutTransition.setDuration(LayoutTransition.APPEARING, DEFAULT_ANIM_DURATION);
|
||||||
@@ -120,10 +113,6 @@ public class KeyguardSliceView extends LinearLayout {
|
|||||||
mTextColor = Utils.getColorAttrDefaultColor(mContext, R.attr.wallpaperTextColor);
|
mTextColor = Utils.getColorAttrDefaultColor(mContext, R.attr.wallpaperTextColor);
|
||||||
mIconSize = (int) mContext.getResources().getDimension(R.dimen.widget_icon_size);
|
mIconSize = (int) mContext.getResources().getDimension(R.dimen.widget_icon_size);
|
||||||
mIconSizeWithHeader = (int) mContext.getResources().getDimension(R.dimen.header_icon_size);
|
mIconSizeWithHeader = (int) mContext.getResources().getDimension(R.dimen.header_icon_size);
|
||||||
mRowTextSize = mContext.getResources().getDimensionPixelSize(
|
|
||||||
R.dimen.widget_label_font_size);
|
|
||||||
mRowWithHeaderTextSize = mContext.getResources().getDimensionPixelSize(
|
|
||||||
R.dimen.header_row_font_size);
|
|
||||||
mTitle.setBreakStrategy(LineBreaker.BREAK_STRATEGY_BALANCED);
|
mTitle.setBreakStrategy(LineBreaker.BREAK_STRATEGY_BALANCED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -204,7 +193,6 @@ public class KeyguardSliceView extends LinearLayout {
|
|||||||
LinearLayout.LayoutParams layoutParams = (LayoutParams) mRow.getLayoutParams();
|
LinearLayout.LayoutParams layoutParams = (LayoutParams) mRow.getLayoutParams();
|
||||||
layoutParams.gravity = mLockScreenMode != KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL
|
layoutParams.gravity = mLockScreenMode != KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL
|
||||||
? Gravity.START : Gravity.CENTER;
|
? Gravity.START : Gravity.CENTER;
|
||||||
layoutParams.topMargin = mHasHeader ? mRowWithHeaderPadding : mRowPadding;
|
|
||||||
mRow.setLayoutParams(layoutParams);
|
mRow.setLayoutParams(layoutParams);
|
||||||
|
|
||||||
for (int i = startIndex; i < subItemsCount; i++) {
|
for (int i = startIndex; i < subItemsCount; i++) {
|
||||||
@@ -230,8 +218,6 @@ public class KeyguardSliceView extends LinearLayout {
|
|||||||
final SliceItem titleItem = rc.getTitleItem();
|
final SliceItem titleItem = rc.getTitleItem();
|
||||||
button.setText(titleItem == null ? null : titleItem.getText());
|
button.setText(titleItem == null ? null : titleItem.getText());
|
||||||
button.setContentDescription(rc.getContentDescription());
|
button.setContentDescription(rc.getContentDescription());
|
||||||
button.setTextSize(TypedValue.COMPLEX_UNIT_PX,
|
|
||||||
mHasHeader ? mRowWithHeaderTextSize : mRowTextSize);
|
|
||||||
|
|
||||||
Drawable iconDrawable = null;
|
Drawable iconDrawable = null;
|
||||||
SliceItem icon = SliceQuery.find(item.getSlice(),
|
SliceItem icon = SliceQuery.find(item.getSlice(),
|
||||||
@@ -313,10 +299,6 @@ public class KeyguardSliceView extends LinearLayout {
|
|||||||
void onDensityOrFontScaleChanged() {
|
void onDensityOrFontScaleChanged() {
|
||||||
mIconSize = mContext.getResources().getDimensionPixelSize(R.dimen.widget_icon_size);
|
mIconSize = mContext.getResources().getDimensionPixelSize(R.dimen.widget_icon_size);
|
||||||
mIconSizeWithHeader = (int) mContext.getResources().getDimension(R.dimen.header_icon_size);
|
mIconSizeWithHeader = (int) mContext.getResources().getDimension(R.dimen.header_icon_size);
|
||||||
mRowTextSize = mContext.getResources().getDimensionPixelSize(
|
|
||||||
R.dimen.widget_label_font_size);
|
|
||||||
mRowWithHeaderTextSize = mContext.getResources().getDimensionPixelSize(
|
|
||||||
R.dimen.header_row_font_size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
|
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
|
||||||
|
|||||||
@@ -266,15 +266,9 @@ public class KeyguardStatusViewController extends ViewController<KeyguardStatusV
|
|||||||
mKeyguardClockSwitchController.updateLockScreenMode(mode);
|
mKeyguardClockSwitchController.updateLockScreenMode(mode);
|
||||||
mKeyguardSliceViewController.updateLockScreenMode(mode);
|
mKeyguardSliceViewController.updateLockScreenMode(mode);
|
||||||
if (mLockScreenMode == KeyguardUpdateMonitor.LOCK_SCREEN_MODE_LAYOUT_1) {
|
if (mLockScreenMode == KeyguardUpdateMonitor.LOCK_SCREEN_MODE_LAYOUT_1) {
|
||||||
// align the top of keyguard_status_area with the top of the clock text instead
|
|
||||||
// of the top of the view
|
|
||||||
mKeyguardSliceViewController.updateTopMargin(
|
|
||||||
mKeyguardClockSwitchController.getClockTextTopPadding());
|
|
||||||
mView.setCanShowOwnerInfo(false);
|
mView.setCanShowOwnerInfo(false);
|
||||||
mView.setCanShowLogout(false);
|
mView.setCanShowLogout(false);
|
||||||
} else {
|
} else {
|
||||||
// reset margin
|
|
||||||
mKeyguardSliceViewController.updateTopMargin(0);
|
|
||||||
mView.setCanShowOwnerInfo(true);
|
mView.setCanShowOwnerInfo(true);
|
||||||
mView.setCanShowLogout(false);
|
mView.setCanShowLogout(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -344,8 +344,11 @@ public class KeyguardClockPositionAlgorithm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private float burnInPreventionOffsetX() {
|
private float burnInPreventionOffsetX() {
|
||||||
return getBurnInOffset(mBurnInPreventionOffsetX * 2, true /* xAxis */)
|
if (mLockScreenMode == KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL) {
|
||||||
- mBurnInPreventionOffsetX;
|
return getBurnInOffset(mBurnInPreventionOffsetX * 2, true /* xAxis */)
|
||||||
|
- mBurnInPreventionOffsetX;
|
||||||
|
}
|
||||||
|
return getBurnInOffset(mBurnInPreventionOffsetX, true /* xAxis */);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Result {
|
public static class Result {
|
||||||
|
|||||||
Reference in New Issue
Block a user