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

Commit 95a4ad98 authored by Darrell Shi's avatar Darrell Shi Committed by Automerger Merge Worker
Browse files

Merge changes I7350981a,Ie5a12788,Icfcc3653 into tm-qpr-dev am: f49d45d6 am: 716916e9

parents f1ac26fa 716916e9
Loading
Loading
Loading
Loading
+26 −19
Original line number Diff line number Diff line
@@ -14,9 +14,13 @@
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
-->
<com.android.systemui.shared.shadow.DoubleShadowTextClock
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <com.android.systemui.shared.shadow.DoubleShadowTextClock
        android:id="@+id/time_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
@@ -27,6 +31,7 @@
        android:fontFeatureSettings="pnum, lnum"
        android:letterSpacing="0.02"
        android:textSize="@dimen/dream_overlay_complication_clock_time_text_size"
        android:translationY="@dimen/dream_overlay_complication_clock_time_translation_y"
        app:keyShadowBlur="@dimen/dream_overlay_clock_key_text_shadow_radius"
        app:keyShadowOffsetX="@dimen/dream_overlay_clock_key_text_shadow_dx"
        app:keyShadowOffsetY="@dimen/dream_overlay_clock_key_text_shadow_dy"
@@ -36,3 +41,5 @@
        app:ambientShadowOffsetY="@dimen/dream_overlay_clock_ambient_text_shadow_dy"
        app:ambientShadowAlpha="0.3"
        />

</FrameLayout>
+17 −12
Original line number Diff line number Diff line
@@ -14,8 +14,13 @@
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
-->
<ImageView
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:paddingVertical="@dimen/dream_overlay_complication_home_controls_padding">

    <ImageView
        android:id="@+id/home_controls_chip"
        android:layout_height="@dimen/keyguard_affordance_fixed_height"
        android:layout_width="@dimen/keyguard_affordance_fixed_width"
@@ -24,6 +29,6 @@
        android:tint="?android:attr/textColorPrimary"
        android:src="@drawable/controls_icon"
        android:background="@drawable/keyguard_bottom_affordance_bg"
    android:layout_marginStart="@dimen/keyguard_affordance_horizontal_offset"
    android:layout_marginBottom="@dimen/keyguard_affordance_vertical_offset"
        android:contentDescription="@string/quick_controls_title" />

</FrameLayout>
+3 −1
Original line number Diff line number Diff line
@@ -1523,13 +1523,15 @@
    <dimen name="dream_overlay_status_bar_extra_margin">8dp</dimen>

    <!-- Dream overlay complications related dimensions -->
    <dimen name="dream_overlay_complication_clock_time_text_size">86sp</dimen>
    <dimen name="dream_overlay_complication_clock_time_text_size">86dp</dimen>
    <dimen name="dream_overlay_complication_clock_time_translation_y">28dp</dimen>
    <dimen name="dream_overlay_complication_home_controls_padding">28dp</dimen>
    <dimen name="dream_overlay_complication_clock_subtitle_text_size">24sp</dimen>
    <dimen name="dream_overlay_complication_preview_text_size">36sp</dimen>
    <dimen name="dream_overlay_complication_preview_icon_padding">28dp</dimen>
    <dimen name="dream_overlay_complication_shadow_padding">2dp</dimen>
    <dimen name="dream_overlay_complication_smartspace_padding">24dp</dimen>
    <dimen name="dream_overlay_complication_smartspace_max_width">408dp</dimen>

    <!-- The position of the end guide, which dream overlay complications can align their start with
         if their end is aligned with the parent end. Represented as the percentage over from the
+14 −3
Original line number Diff line number Diff line
@@ -192,9 +192,7 @@ public class ComplicationLayoutEngine implements Complication.VisibilityControll
                        break;
                }

                // Add margin if specified by the complication. Otherwise add default margin
                // between complications.
                if (mLayoutParams.isMarginSpecified() || !isRoot) {
                if (!isRoot) {
                    final int margin = mLayoutParams.getMargin(mDefaultMargin);
                    switch(direction) {
                        case ComplicationLayoutParams.DIRECTION_DOWN:
@@ -213,6 +211,19 @@ public class ComplicationLayoutEngine implements Complication.VisibilityControll
                }
            });

            if (mLayoutParams.constraintSpecified()) {
                switch (direction) {
                    case ComplicationLayoutParams.DIRECTION_START:
                    case ComplicationLayoutParams.DIRECTION_END:
                        params.matchConstraintMaxWidth = mLayoutParams.getConstraint();
                        break;
                    case ComplicationLayoutParams.DIRECTION_UP:
                    case ComplicationLayoutParams.DIRECTION_DOWN:
                        params.matchConstraintMaxHeight = mLayoutParams.getConstraint();
                        break;
                }
            }

            mView.setLayoutParams(params);
        }

+50 −11
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ public class ComplicationLayoutParams extends ViewGroup.LayoutParams {
    private static final int LAST_POSITION = POSITION_END;

    private static final int MARGIN_UNSPECIFIED = 0xFFFFFFFF;
    private static final int CONSTRAINT_UNSPECIFIED = 0xFFFFFFFF;

    @Retention(RetentionPolicy.SOURCE)
    @IntDef(flag = true, prefix = { "DIRECTION_" }, value = {
@@ -81,6 +82,8 @@ public class ComplicationLayoutParams extends ViewGroup.LayoutParams {

    private final int mMargin;

    private final int mConstraint;

    private final boolean mSnapToGuide;

    // Do not allow specifying opposite positions
@@ -110,7 +113,8 @@ public class ComplicationLayoutParams extends ViewGroup.LayoutParams {
     */
    public ComplicationLayoutParams(int width, int height, @Position int position,
            @Direction int direction, int weight) {
        this(width, height, position, direction, weight, MARGIN_UNSPECIFIED, false);
        this(width, height, position, direction, weight, MARGIN_UNSPECIFIED, CONSTRAINT_UNSPECIFIED,
                false);
    }

    /**
@@ -127,7 +131,27 @@ public class ComplicationLayoutParams extends ViewGroup.LayoutParams {
     */
    public ComplicationLayoutParams(int width, int height, @Position int position,
            @Direction int direction, int weight, int margin) {
        this(width, height, position, direction, weight, margin, false);
        this(width, height, position, direction, weight, margin, CONSTRAINT_UNSPECIFIED, false);
    }

    /**
     * Constructs a {@link ComplicationLayoutParams}.
     * @param width The width {@link android.view.View.MeasureSpec} for the view.
     * @param height The height {@link android.view.View.MeasureSpec} for the view.
     * @param position The place within the parent container where the view should be positioned.
     * @param direction The direction the view should be laid out from either the parent container
     *                  or preceding view.
     * @param weight The weight that should be considered for this view when compared to other
     *               views. This has an impact on the placement of the view but not the rendering of
     *               the view.
     * @param margin The margin to apply between complications.
     * @param constraint The max width or height the complication is allowed to spread, depending on
     *                   its direction. For horizontal directions, this would be applied on width,
     *                   and for vertical directions, height.
     */
    public ComplicationLayoutParams(int width, int height, @Position int position,
            @Direction int direction, int weight, int margin, int constraint) {
        this(width, height, position, direction, weight, margin, constraint, false);
    }

    /**
@@ -148,7 +172,8 @@ public class ComplicationLayoutParams extends ViewGroup.LayoutParams {
     */
    public ComplicationLayoutParams(int width, int height, @Position int position,
            @Direction int direction, int weight, boolean snapToGuide) {
        this(width, height, position, direction, weight, MARGIN_UNSPECIFIED, snapToGuide);
        this(width, height, position, direction, weight, MARGIN_UNSPECIFIED, CONSTRAINT_UNSPECIFIED,
                snapToGuide);
    }

    /**
@@ -162,6 +187,9 @@ public class ComplicationLayoutParams extends ViewGroup.LayoutParams {
     *               views. This has an impact on the placement of the view but not the rendering of
     *               the view.
     * @param margin The margin to apply between complications.
     * @param constraint The max width or height the complication is allowed to spread, depending on
     *                   its direction. For horizontal directions, this would be applied on width,
     *                   and for vertical directions, height.
     * @param snapToGuide When set to {@code true}, the dimension perpendicular to the direction
     *                    will be automatically set to align with a predetermined guide for that
     *                    side. For example, if the complication is aligned to the top end and
@@ -169,7 +197,7 @@ public class ComplicationLayoutParams extends ViewGroup.LayoutParams {
     *                    from the end of the parent to the guide.
     */
    public ComplicationLayoutParams(int width, int height, @Position int position,
            @Direction int direction, int weight, int margin, boolean snapToGuide) {
            @Direction int direction, int weight, int margin, int constraint, boolean snapToGuide) {
        super(width, height);

        if (!validatePosition(position)) {
@@ -187,6 +215,8 @@ public class ComplicationLayoutParams extends ViewGroup.LayoutParams {

        mMargin = margin;

        mConstraint = constraint;

        mSnapToGuide = snapToGuide;
    }

@@ -199,6 +229,7 @@ public class ComplicationLayoutParams extends ViewGroup.LayoutParams {
        mDirection = source.mDirection;
        mWeight = source.mWeight;
        mMargin = source.mMargin;
        mConstraint = source.mConstraint;
        mSnapToGuide = source.mSnapToGuide;
    }

@@ -260,13 +291,6 @@ public class ComplicationLayoutParams extends ViewGroup.LayoutParams {
        return mWeight;
    }

    /**
     * Returns whether margin has been specified by the complication.
     */
    public boolean isMarginSpecified() {
        return mMargin != MARGIN_UNSPECIFIED;
    }

    /**
     * Returns the margin to apply between complications, or the given default if no margin is
     * specified.
@@ -275,6 +299,21 @@ public class ComplicationLayoutParams extends ViewGroup.LayoutParams {
        return mMargin == MARGIN_UNSPECIFIED ? defaultMargin : mMargin;
    }

    /**
     * Returns whether the horizontal or vertical constraint has been specified.
     */
    public boolean constraintSpecified() {
        return mConstraint != CONSTRAINT_UNSPECIFIED;
    }

    /**
     * Returns the horizontal or vertical constraint of the complication, depending its direction.
     * For horizontal directions, this is the max width, and for vertical directions, max height.
     */
    public int getConstraint() {
        return mConstraint;
    }

    /**
     * Returns whether the complication's dimension perpendicular to direction should be
     * automatically set.
Loading