Loading res/layout/themed_icon_section_view.xml +0 −15 Original line number Diff line number Diff line Loading @@ -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> res/values-iw/strings.xml +1 −1 Original line number Diff line number Diff line Loading @@ -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> Loading res/values-w800dp/dimens.xml +1 −0 Original line number Diff line number Diff line Loading @@ -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 res/values/dimens.xml +1 −0 Original line number Diff line number Diff line Loading @@ -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> Loading src/com/android/customization/picker/clock/ui/view/ClockCarouselView.kt +24 −9 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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 Loading @@ -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 } } /** Loading Loading @@ -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 = Loading Loading @@ -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 Loading Loading @@ -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, Loading Loading @@ -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) } } Loading Loading @@ -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 = Loading @@ -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. Loading Loading
res/layout/themed_icon_section_view.xml +0 −15 Original line number Diff line number Diff line Loading @@ -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>
res/values-iw/strings.xml +1 −1 Original line number Diff line number Diff line Loading @@ -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> Loading
res/values-w800dp/dimens.xml +1 −0 Original line number Diff line number Diff line Loading @@ -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
res/values/dimens.xml +1 −0 Original line number Diff line number Diff line Loading @@ -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> Loading
src/com/android/customization/picker/clock/ui/view/ClockCarouselView.kt +24 −9 Original line number Diff line number Diff line Loading @@ -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 Loading @@ -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 Loading @@ -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 } } /** Loading Loading @@ -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 = Loading Loading @@ -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 Loading Loading @@ -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, Loading Loading @@ -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) } } Loading Loading @@ -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 = Loading @@ -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. Loading