Loading packages/SystemUI/res-keyguard/layout/keyguard_presentation.xml +1 −8 Original line number Diff line number Diff line Loading @@ -42,18 +42,11 @@ android:id="@+id/clock_view" android:layout_width="match_parent" android:layout_height="wrap_content" /> <View android:id="@+id/clock_separator" android:layout_width="@dimen/widget_separator_width" android:layout_height="@dimen/widget_separator_thickness" android:layout_below="@id/clock_view" android:background="#f00" android:layout_centerHorizontal="true" /> <include layout="@layout/keyguard_status_area" android:id="@+id/keyguard_status_area" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/clock_separator" /> android:layout_below="@id/clock_view" /> </RelativeLayout> <ImageView android:layout_width="wrap_content" Loading packages/SystemUI/res-keyguard/layout/keyguard_status_area.xml +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ android:id="@+id/row" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/subtitle_clock_padding" android:orientation="horizontal" android:gravity="center" /> Loading packages/SystemUI/res-keyguard/layout/keyguard_status_view.xml +1 −9 Original line number Diff line number Diff line Loading @@ -59,19 +59,11 @@ android:id="@+id/clock_view" android:layout_width="match_parent" android:layout_height="wrap_content" /> <View android:id="@+id/clock_separator" android:layout_width="@dimen/widget_separator_width" android:layout_height="@dimen/widget_separator_thickness" android:layout_below="@id/clock_view" android:background="#f00" android:layout_centerHorizontal="true" /> <include layout="@layout/keyguard_status_area" android:id="@+id/keyguard_status_area" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/clock_separator" /> android:layout_below="@id/clock_view" /> </RelativeLayout> <TextView Loading packages/SystemUI/res-keyguard/values/dimens.xml +6 −8 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ <!-- Slice header --> <dimen name="widget_title_font_size">24dp</dimen> <dimen name="widget_title_bottom_margin">7dp</dimen> <dimen name="widget_title_bottom_margin">14dp</dimen> <dimen name="bottom_text_spacing_digital">0dp</dimen> <!-- Slice subtitle --> <dimen name="widget_label_font_size">16dp</dimen> Loading @@ -52,19 +52,17 @@ <!-- Clock without header --> <dimen name="widget_big_font_size">64dp</dimen> <!-- Clock with header --> <dimen name="widget_small_clock_padding">-25dp</dimen> <dimen name="widget_small_font_size">24dp</dimen> <dimen name="widget_small_font_stroke">0.6dp</dimen> <!-- Dash between clock and header --> <dimen name="widget_separator_width">12dp</dimen> <dimen name="widget_separator_thickness">1dp</dimen> <dimen name="widget_vertical_padding">26dp</dimen> <dimen name="widget_icon_bottom_padding">14dp</dimen> <dimen name="widget_vertical_padding">32dp</dimen> <!-- Subtitle paddings --> <dimen name="widget_horizontal_padding">8dp</dimen> <dimen name="widget_icon_size">16dp</dimen> <dimen name="widget_icon_padding">8dp</dimen> <!-- Space between notification shelf and dash above it --> <dimen name="widget_bottom_separator_padding">28dp</dimen> <dimen name="subtitle_clock_padding">15dp</dimen> <!-- Notification shelf padding when dark --> <dimen name="widget_bottom_separator_padding">-6dp</dimen> <!-- The y translation to apply at the start in appear animations. --> <dimen name="appear_y_translation_start">32dp</dimen> Loading packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java +6 −36 Original line number Diff line number Diff line Loading @@ -65,7 +65,6 @@ public class KeyguardStatusView extends GridLayout implements private TextView mLogoutView; private KeyguardClockSwitch mClockView; private View mClockSeparator; private TextView mOwnerInfo; private KeyguardSliceView mKeyguardSlice; private Runnable mPendingMarqueeStart; Loading @@ -76,8 +75,8 @@ public class KeyguardStatusView extends GridLayout implements private boolean mWasPulsing; private float mDarkAmount = 0; private int mTextColor; private float mWidgetPadding; private int mLastLayoutHeight; private int mSmallClockPadding; private KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() { Loading Loading @@ -176,14 +175,12 @@ public class KeyguardStatusView extends GridLayout implements } mOwnerInfo = findViewById(R.id.owner_info); mKeyguardSlice = findViewById(R.id.keyguard_status_area); mClockSeparator = findViewById(R.id.clock_separator); mVisibleInDoze = Sets.newArraySet(mClockView, mKeyguardSlice); mTextColor = mClockView.getCurrentTextColor(); int clockStroke = getResources().getDimensionPixelSize(R.dimen.widget_small_font_stroke); mClockView.getPaint().setStrokeWidth(clockStroke); mClockView.addOnLayoutChangeListener(this); mClockSeparator.addOnLayoutChangeListener(this); mKeyguardSlice.setContentChangeListener(this::onSliceContentChanged); onSliceContentChanged(); Loading @@ -200,26 +197,18 @@ public class KeyguardStatusView extends GridLayout implements } /** * Moves clock and separator, adjusting margins when slice content changes. * Moves clock, adjusting margins when slice content changes. */ private void onSliceContentChanged() { boolean smallClock = mKeyguardSlice.hasHeader() || mPulsing; float clockScale = smallClock ? mSmallClockScale : 1; RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) mClockView.getLayoutParams(); int height = mClockView.getHeight(); layoutParams.bottomMargin = (int) -(height - (clockScale * height)); layoutParams.bottomMargin = smallClock ? mSmallClockPadding : 0; mClockView.setLayoutParams(layoutParams); layoutParams = (RelativeLayout.LayoutParams) mClockSeparator.getLayoutParams(); layoutParams.topMargin = smallClock ? (int) mWidgetPadding : 0; layoutParams.bottomMargin = layoutParams.topMargin; mClockSeparator.setLayoutParams(layoutParams); } /** * Animate clock and its separator when necessary. * Animate clock when necessary. */ @Override public void onLayoutChange(View view, int left, int top, int right, int bottom, Loading Loading @@ -259,25 +248,6 @@ public class KeyguardStatusView extends GridLayout implements mClockView.setStyle(style); mClockView.invalidate(); } } else if (view == mClockSeparator) { boolean hasSeparator = hasHeader && !mPulsing; float alpha = hasSeparator ? 1 : 0; mClockSeparator.animate().cancel(); if (shouldAnimate) { boolean isAwake = mDarkAmount != 0; mClockSeparator.setY(oldTop + heightOffset); mClockSeparator.animate() .setInterpolator(Interpolators.FAST_OUT_SLOW_IN) .setDuration(duration) .setListener(isAwake ? null : new KeepAwakeAnimationListener(getContext())) .setStartDelay(delay) .y(top) .alpha(alpha) .start(); } else { mClockSeparator.setY(top); mClockSeparator.setAlpha(alpha); } } } Loading @@ -292,7 +262,8 @@ public class KeyguardStatusView extends GridLayout implements @Override public void onDensityOrFontScaleChanged() { mWidgetPadding = getResources().getDimension(R.dimen.widget_vertical_padding); mSmallClockPadding = getResources() .getDimensionPixelSize(R.dimen.widget_small_clock_padding); if (mClockView != null) { mClockView.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize(R.dimen.widget_big_font_size)); Loading Loading @@ -436,7 +407,6 @@ public class KeyguardStatusView extends GridLayout implements updateDozeVisibleViews(); mKeyguardSlice.setDarkAmount(mDarkAmount); mClockView.setTextColor(blendedTextColor); mClockSeparator.setBackgroundColor(blendedTextColor); } private void layoutOwnerInfo() { Loading Loading
packages/SystemUI/res-keyguard/layout/keyguard_presentation.xml +1 −8 Original line number Diff line number Diff line Loading @@ -42,18 +42,11 @@ android:id="@+id/clock_view" android:layout_width="match_parent" android:layout_height="wrap_content" /> <View android:id="@+id/clock_separator" android:layout_width="@dimen/widget_separator_width" android:layout_height="@dimen/widget_separator_thickness" android:layout_below="@id/clock_view" android:background="#f00" android:layout_centerHorizontal="true" /> <include layout="@layout/keyguard_status_area" android:id="@+id/keyguard_status_area" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/clock_separator" /> android:layout_below="@id/clock_view" /> </RelativeLayout> <ImageView android:layout_width="wrap_content" Loading
packages/SystemUI/res-keyguard/layout/keyguard_status_area.xml +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ android:id="@+id/row" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/subtitle_clock_padding" android:orientation="horizontal" android:gravity="center" /> Loading
packages/SystemUI/res-keyguard/layout/keyguard_status_view.xml +1 −9 Original line number Diff line number Diff line Loading @@ -59,19 +59,11 @@ android:id="@+id/clock_view" android:layout_width="match_parent" android:layout_height="wrap_content" /> <View android:id="@+id/clock_separator" android:layout_width="@dimen/widget_separator_width" android:layout_height="@dimen/widget_separator_thickness" android:layout_below="@id/clock_view" android:background="#f00" android:layout_centerHorizontal="true" /> <include layout="@layout/keyguard_status_area" android:id="@+id/keyguard_status_area" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/clock_separator" /> android:layout_below="@id/clock_view" /> </RelativeLayout> <TextView Loading
packages/SystemUI/res-keyguard/values/dimens.xml +6 −8 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ <!-- Slice header --> <dimen name="widget_title_font_size">24dp</dimen> <dimen name="widget_title_bottom_margin">7dp</dimen> <dimen name="widget_title_bottom_margin">14dp</dimen> <dimen name="bottom_text_spacing_digital">0dp</dimen> <!-- Slice subtitle --> <dimen name="widget_label_font_size">16dp</dimen> Loading @@ -52,19 +52,17 @@ <!-- Clock without header --> <dimen name="widget_big_font_size">64dp</dimen> <!-- Clock with header --> <dimen name="widget_small_clock_padding">-25dp</dimen> <dimen name="widget_small_font_size">24dp</dimen> <dimen name="widget_small_font_stroke">0.6dp</dimen> <!-- Dash between clock and header --> <dimen name="widget_separator_width">12dp</dimen> <dimen name="widget_separator_thickness">1dp</dimen> <dimen name="widget_vertical_padding">26dp</dimen> <dimen name="widget_icon_bottom_padding">14dp</dimen> <dimen name="widget_vertical_padding">32dp</dimen> <!-- Subtitle paddings --> <dimen name="widget_horizontal_padding">8dp</dimen> <dimen name="widget_icon_size">16dp</dimen> <dimen name="widget_icon_padding">8dp</dimen> <!-- Space between notification shelf and dash above it --> <dimen name="widget_bottom_separator_padding">28dp</dimen> <dimen name="subtitle_clock_padding">15dp</dimen> <!-- Notification shelf padding when dark --> <dimen name="widget_bottom_separator_padding">-6dp</dimen> <!-- The y translation to apply at the start in appear animations. --> <dimen name="appear_y_translation_start">32dp</dimen> Loading
packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java +6 −36 Original line number Diff line number Diff line Loading @@ -65,7 +65,6 @@ public class KeyguardStatusView extends GridLayout implements private TextView mLogoutView; private KeyguardClockSwitch mClockView; private View mClockSeparator; private TextView mOwnerInfo; private KeyguardSliceView mKeyguardSlice; private Runnable mPendingMarqueeStart; Loading @@ -76,8 +75,8 @@ public class KeyguardStatusView extends GridLayout implements private boolean mWasPulsing; private float mDarkAmount = 0; private int mTextColor; private float mWidgetPadding; private int mLastLayoutHeight; private int mSmallClockPadding; private KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() { Loading Loading @@ -176,14 +175,12 @@ public class KeyguardStatusView extends GridLayout implements } mOwnerInfo = findViewById(R.id.owner_info); mKeyguardSlice = findViewById(R.id.keyguard_status_area); mClockSeparator = findViewById(R.id.clock_separator); mVisibleInDoze = Sets.newArraySet(mClockView, mKeyguardSlice); mTextColor = mClockView.getCurrentTextColor(); int clockStroke = getResources().getDimensionPixelSize(R.dimen.widget_small_font_stroke); mClockView.getPaint().setStrokeWidth(clockStroke); mClockView.addOnLayoutChangeListener(this); mClockSeparator.addOnLayoutChangeListener(this); mKeyguardSlice.setContentChangeListener(this::onSliceContentChanged); onSliceContentChanged(); Loading @@ -200,26 +197,18 @@ public class KeyguardStatusView extends GridLayout implements } /** * Moves clock and separator, adjusting margins when slice content changes. * Moves clock, adjusting margins when slice content changes. */ private void onSliceContentChanged() { boolean smallClock = mKeyguardSlice.hasHeader() || mPulsing; float clockScale = smallClock ? mSmallClockScale : 1; RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) mClockView.getLayoutParams(); int height = mClockView.getHeight(); layoutParams.bottomMargin = (int) -(height - (clockScale * height)); layoutParams.bottomMargin = smallClock ? mSmallClockPadding : 0; mClockView.setLayoutParams(layoutParams); layoutParams = (RelativeLayout.LayoutParams) mClockSeparator.getLayoutParams(); layoutParams.topMargin = smallClock ? (int) mWidgetPadding : 0; layoutParams.bottomMargin = layoutParams.topMargin; mClockSeparator.setLayoutParams(layoutParams); } /** * Animate clock and its separator when necessary. * Animate clock when necessary. */ @Override public void onLayoutChange(View view, int left, int top, int right, int bottom, Loading Loading @@ -259,25 +248,6 @@ public class KeyguardStatusView extends GridLayout implements mClockView.setStyle(style); mClockView.invalidate(); } } else if (view == mClockSeparator) { boolean hasSeparator = hasHeader && !mPulsing; float alpha = hasSeparator ? 1 : 0; mClockSeparator.animate().cancel(); if (shouldAnimate) { boolean isAwake = mDarkAmount != 0; mClockSeparator.setY(oldTop + heightOffset); mClockSeparator.animate() .setInterpolator(Interpolators.FAST_OUT_SLOW_IN) .setDuration(duration) .setListener(isAwake ? null : new KeepAwakeAnimationListener(getContext())) .setStartDelay(delay) .y(top) .alpha(alpha) .start(); } else { mClockSeparator.setY(top); mClockSeparator.setAlpha(alpha); } } } Loading @@ -292,7 +262,8 @@ public class KeyguardStatusView extends GridLayout implements @Override public void onDensityOrFontScaleChanged() { mWidgetPadding = getResources().getDimension(R.dimen.widget_vertical_padding); mSmallClockPadding = getResources() .getDimensionPixelSize(R.dimen.widget_small_clock_padding); if (mClockView != null) { mClockView.setTextSize(TypedValue.COMPLEX_UNIT_PX, getResources().getDimensionPixelSize(R.dimen.widget_big_font_size)); Loading Loading @@ -436,7 +407,6 @@ public class KeyguardStatusView extends GridLayout implements updateDozeVisibleViews(); mKeyguardSlice.setDarkAmount(mDarkAmount); mClockView.setTextColor(blendedTextColor); mClockSeparator.setBackgroundColor(blendedTextColor); } private void layoutOwnerInfo() { Loading