Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c9d28b74 authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Remove dashes between clock and notifications

Bug: 111405682
Test: visual - smart space, ambient notification, clock
Change-Id: I68e0d9099e0d4eaa1a6c10838d584aded523c332
parent d845abba
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -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"
+1 −0
Original line number Diff line number Diff line
@@ -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"
    />
+1 −9
Original line number Diff line number Diff line
@@ -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
+6 −8
Original line number Diff line number Diff line
@@ -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>
@@ -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>
+6 −36
Original line number Diff line number Diff line
@@ -64,7 +64,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;
@@ -75,8 +74,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() {

@@ -175,14 +174,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();

@@ -199,26 +196,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,
@@ -258,25 +247,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);
            }
        }
    }

@@ -291,7 +261,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));
@@ -434,7 +405,6 @@ public class KeyguardStatusView extends GridLayout implements
        updateDozeVisibleViews();
        mKeyguardSlice.setDarkAmount(mDarkAmount);
        mClockView.setTextColor(blendedTextColor);
        mClockSeparator.setBackgroundColor(blendedTextColor);
    }

    private void layoutOwnerInfo() {
Loading