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

Commit f77ede1d authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

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

parents f9ece9d4 95a4ad98
Loading
Loading
Loading
Loading
+26 −19
Original line number Original line Diff line number Diff line
@@ -14,9 +14,13 @@
  ~ See the License for the specific language governing permissions and
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~ limitations under the License.
-->
-->
<com.android.systemui.shared.shadow.DoubleShadowTextClock
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    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:id="@+id/time_view"
        android:layout_width="wrap_content"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_height="wrap_content"
@@ -27,6 +31,7 @@
        android:fontFeatureSettings="pnum, lnum"
        android:fontFeatureSettings="pnum, lnum"
        android:letterSpacing="0.02"
        android:letterSpacing="0.02"
        android:textSize="@dimen/dream_overlay_complication_clock_time_text_size"
        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:keyShadowBlur="@dimen/dream_overlay_clock_key_text_shadow_radius"
        app:keyShadowOffsetX="@dimen/dream_overlay_clock_key_text_shadow_dx"
        app:keyShadowOffsetX="@dimen/dream_overlay_clock_key_text_shadow_dx"
        app:keyShadowOffsetY="@dimen/dream_overlay_clock_key_text_shadow_dy"
        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:ambientShadowOffsetY="@dimen/dream_overlay_clock_ambient_text_shadow_dy"
        app:ambientShadowAlpha="0.3"
        app:ambientShadowAlpha="0.3"
        />
        />

</FrameLayout>
+17 −12
Original line number Original line Diff line number Diff line
@@ -14,8 +14,13 @@
  ~ See the License for the specific language governing permissions and
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~ limitations under the License.
-->
-->
<ImageView
<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    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:id="@+id/home_controls_chip"
        android:layout_height="@dimen/keyguard_affordance_fixed_height"
        android:layout_height="@dimen/keyguard_affordance_fixed_height"
        android:layout_width="@dimen/keyguard_affordance_fixed_width"
        android:layout_width="@dimen/keyguard_affordance_fixed_width"
@@ -24,6 +29,6 @@
        android:tint="?android:attr/textColorPrimary"
        android:tint="?android:attr/textColorPrimary"
        android:src="@drawable/controls_icon"
        android:src="@drawable/controls_icon"
        android:background="@drawable/keyguard_bottom_affordance_bg"
        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" />
        android:contentDescription="@string/quick_controls_title" />

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


    <!-- Dream overlay complications related dimensions -->
    <!-- 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_home_controls_padding">28dp</dimen>
    <dimen name="dream_overlay_complication_clock_subtitle_text_size">24sp</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_text_size">36sp</dimen>
    <dimen name="dream_overlay_complication_preview_icon_padding">28dp</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_shadow_padding">2dp</dimen>
    <dimen name="dream_overlay_complication_smartspace_padding">24dp</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
    <!-- 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
         if their end is aligned with the parent end. Represented as the percentage over from the
+14 −3
Original line number Original line Diff line number Diff line
@@ -192,9 +192,7 @@ public class ComplicationLayoutEngine implements Complication.VisibilityControll
                        break;
                        break;
                }
                }


                // Add margin if specified by the complication. Otherwise add default margin
                if (!isRoot) {
                // between complications.
                if (mLayoutParams.isMarginSpecified() || !isRoot) {
                    final int margin = mLayoutParams.getMargin(mDefaultMargin);
                    final int margin = mLayoutParams.getMargin(mDefaultMargin);
                    switch(direction) {
                    switch(direction) {
                        case ComplicationLayoutParams.DIRECTION_DOWN:
                        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);
            mView.setLayoutParams(params);
        }
        }


+50 −11
Original line number Original line 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 LAST_POSITION = POSITION_END;


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


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


    private final int mMargin;
    private final int mMargin;


    private final int mConstraint;

    private final boolean mSnapToGuide;
    private final boolean mSnapToGuide;


    // Do not allow specifying opposite positions
    // 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,
    public ComplicationLayoutParams(int width, int height, @Position int position,
            @Direction int direction, int weight) {
            @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,
    public ComplicationLayoutParams(int width, int height, @Position int position,
            @Direction int direction, int weight, int margin) {
            @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,
    public ComplicationLayoutParams(int width, int height, @Position int position,
            @Direction int direction, int weight, boolean snapToGuide) {
            @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
     *               views. This has an impact on the placement of the view but not the rendering of
     *               the view.
     *               the view.
     * @param margin The margin to apply between complications.
     * @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
     * @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
     *                    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
     *                    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.
     *                    from the end of the parent to the guide.
     */
     */
    public ComplicationLayoutParams(int width, int height, @Position int position,
    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);
        super(width, height);


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


        mMargin = margin;
        mMargin = margin;


        mConstraint = constraint;

        mSnapToGuide = snapToGuide;
        mSnapToGuide = snapToGuide;
    }
    }


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


@@ -260,13 +291,6 @@ public class ComplicationLayoutParams extends ViewGroup.LayoutParams {
        return mWeight;
        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
     * Returns the margin to apply between complications, or the given default if no margin is
     * specified.
     * specified.
@@ -275,6 +299,21 @@ public class ComplicationLayoutParams extends ViewGroup.LayoutParams {
        return mMargin == MARGIN_UNSPECIFIED ? defaultMargin : mMargin;
        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
     * Returns whether the complication's dimension perpendicular to direction should be
     * automatically set.
     * automatically set.
Loading