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

Commit 6fe7b133 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12687986 from 7f1946d5 to 25Q1-release

Change-Id: I33b2f9dbe89d2189bdb0d2f83bf4eb2a825b4ad6
parents c961d92b 7f1946d5
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -50,19 +50,4 @@
            style="@style/Switch.SettingsLib"/>

    </LinearLayout>

    <Space
        android:layout_width="0dp"
        android:layout_height="8dp" />

    <TextView
        android:id="@+id/beta_tag"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:paddingHorizontal="8dp"
        android:paddingVertical="4dp"
        android:text="@string/beta_title"
        android:textColor="@color/text_color_on_accent"
        style="@style/BetaTagTextStyle" />

</com.android.customization.picker.themedicon.ThemedIconSectionView>
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@
    <string name="clock_size_large" msgid="3143248715744138979">"גדול"</string>
    <string name="clock_size_small" msgid="2280449912094164133">"קטן"</string>
    <string name="clock_size_small_description" msgid="4089511196955732480">"שעון קטן מופיע בפינת המסך"</string>
    <string name="clock_font_editor_apply" msgid="5965611025879105293">"החלה של שינויי הגופן בשעון"</string>
    <string name="clock_font_editor_apply" msgid="5965611025879105293">"אישור של שינויי הגופן בשעון"</string>
    <string name="clock_font_editor_revert" msgid="5307491447405753061">"ביטול של שינויי הגופן בשעון"</string>
    <string name="grid_title" msgid="1688173478777254123">"תצוגת האפליקציות"</string>
    <string name="shape_and_grid_title" msgid="9092477491363761054">"הצורה והפריסה של האפליקציה"</string>
+1 −0
Original line number Diff line number Diff line
@@ -23,4 +23,5 @@
    <dimen name="clock_carousel_item_card_width">114dp</dimen>
    <dimen name="clock_carousel_item_card_height">124dp</dimen>
    <dimen name="clock_carousel_guideline_margin">320dp</dimen>
    <item name="clock_carousel_scale" format="float" type="dimen">0.35</item>
</resources>
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@
    <dimen name="clock_carousel_item_card_width">100dp</dimen>
    <dimen name="clock_carousel_item_card_height">108dp</dimen>
    <dimen name="clock_carousel_guideline_margin_for_2_pane_small_width">122dp</dimen>
    <item name="clock_carousel_scale" format="float" type="dimen">0.5</item>

    <!-- Clock color and size button -->
    <dimen name="clock_color_size_button_min_height">32dp</dimen>
+24 −9
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ import android.content.Context
import android.content.res.ColorStateList
import android.content.res.Resources
import android.util.AttributeSet
import android.util.TypedValue
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@@ -40,6 +41,7 @@ class ClockCarouselView(context: Context, attrs: AttributeSet) : FrameLayout(con

    val carousel: Carousel
    private val motionLayout: MotionLayout
    private val clockViewScale: Float
    private lateinit var adapter: ClockCarouselAdapter
    private lateinit var clockViewFactory: ClockViewFactory
    private var toCenterClockController: ClockController? = null
@@ -56,6 +58,11 @@ class ClockCarouselView(context: Context, attrs: AttributeSet) : FrameLayout(con
        carousel = clockCarousel.requireViewById(R.id.carousel)
        motionLayout = clockCarousel.requireViewById(R.id.motion_container)
        motionLayout.contentDescription = context.getString(R.string.custom_clocks_label)
        clockViewScale =
            TypedValue().let {
                resources.getValue(R.dimen.clock_carousel_scale, it, true)
                it.float
            }
    }

    /**
@@ -130,7 +137,14 @@ class ClockCarouselView(context: Context, attrs: AttributeSet) : FrameLayout(con
            overrideScreenPreviewWidth()
        }

        adapter = ClockCarouselAdapter(clockSize, clocks, clockViewFactory, onClockSelected)
        adapter =
            ClockCarouselAdapter(
                clockViewScale,
                clockSize,
                clocks,
                clockViewFactory,
                onClockSelected,
            )
        carousel.isInfinite = clocks.size >= MIN_CLOCKS_TO_ENABLE_INFINITE_CAROUSEL
        carousel.setAdapter(adapter)
        val indexOfSelectedClock =
@@ -222,8 +236,8 @@ class ClockCarouselView(context: Context, attrs: AttributeSet) : FrameLayout(con
                        ?.largeClock
                        ?.animations
                        ?.onPickerCarouselSwiping(progress)
                    val scalingDownScale = getScalingDownScale(progress)
                    val scalingUpScale = getScalingUpScale(progress)
                    val scalingDownScale = getScalingDownScale(progress, clockViewScale)
                    val scalingUpScale = getScalingUpScale(progress, clockViewScale)
                    offCenterClockScaleView?.scaleX = scalingDownScale
                    offCenterClockScaleView?.scaleY = scalingDownScale
                    toCenterClockScaleView?.scaleX = scalingUpScale
@@ -369,6 +383,7 @@ class ClockCarouselView(context: Context, attrs: AttributeSet) : FrameLayout(con
    }

    private class ClockCarouselAdapter(
        val clockViewScale: Float,
        val clockSize: ClockSize,
        val clocks: List<ClockCarouselItemViewModel>,
        private val clockViewFactory: ClockViewFactory,
@@ -450,8 +465,8 @@ class ClockCarouselView(context: Context, attrs: AttributeSet) : FrameLayout(con
                clockScaleView.scaleY = 1f
                controller.largeClock.animations.onPickerCarouselSwiping(1F)
            } else {
                clockScaleView.scaleX = CLOCK_CAROUSEL_VIEW_SCALE
                clockScaleView.scaleY = CLOCK_CAROUSEL_VIEW_SCALE
                clockScaleView.scaleX = clockViewScale
                clockScaleView.scaleY = clockViewScale
                controller.largeClock.animations.onPickerCarouselSwiping(0F)
            }
        }
@@ -501,7 +516,6 @@ class ClockCarouselView(context: Context, attrs: AttributeSet) : FrameLayout(con
    companion object {
        // The carousel needs to have at least 5 different clock faces to be infinite
        const val MIN_CLOCKS_TO_ENABLE_INFINITE_CAROUSEL = 5
        const val CLOCK_CAROUSEL_VIEW_SCALE = 0.5f
        const val TRANSITION_DURATION = 250

        val itemViewIds =
@@ -513,10 +527,11 @@ class ClockCarouselView(context: Context, attrs: AttributeSet) : FrameLayout(con
                R.id.item_view_4,
            )

        fun getScalingUpScale(progress: Float) =
            CLOCK_CAROUSEL_VIEW_SCALE + progress * (1f - CLOCK_CAROUSEL_VIEW_SCALE)
        fun getScalingUpScale(progress: Float, clockViewScale: Float) =
            clockViewScale + progress * (1f - clockViewScale)

        fun getScalingDownScale(progress: Float) = 1f - progress * (1f - CLOCK_CAROUSEL_VIEW_SCALE)
        fun getScalingDownScale(progress: Float, clockViewScale: Float) =
            1f - progress * (1f - clockViewScale)

        // This makes the card only starts to reveal in the last quarter of the trip so
        // the card won't overlap the preview.