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

Commit fbc93290 authored by George Lin's avatar George Lin Committed by Android (Google) Code Review
Browse files

Merge changes from topic "bind-clock-face-click" into main

* changes:
  Bind on click clock face (1/2)
  Added test cases to ClockPickerViewModelTest
  Remove fontAxes from the ClockMetadataViewModel
  Bind preset slider
  Add step slider for presets
  Remove font customization and introduce clock size tab
parents d36ec284 c75bd24d
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2024 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="960"
    android:viewportHeight="960"
    android:tint="?attr/colorControlNormal">
    <path
        android:fillColor="@android:color/white"
        android:pathData="M560,800L560,280L360,280L360,160L880,160L880,280L680,280L680,800L560,800ZM200,800L200,480L80,480L80,360L440,360L440,480L320,480L320,800L200,800Z"/>
</vector>
 No newline at end of file
+9 −41
Original line number Diff line number Diff line
@@ -14,57 +14,25 @@
     limitations under the License.
-->
<!-- Content description is set programmatically on the parent FrameLayout -->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="@dimen/floating_sheet_clock_style_option_width"
    android:layout_height="@dimen/floating_sheet_clock_style_option_height"
    xmlns:app="http://schemas.android.com/apk/res-auto"
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="@dimen/floating_sheet_clock_style_option_size"
    android:layout_height="@dimen/floating_sheet_clock_style_option_size"
    android:clipToPadding="false"
    android:clipChildren="false">

    <com.android.wallpaper.picker.option.ui.view.OptionItemBackground
        android:id="@id/background"
        android:layout_width="@dimen/floating_sheet_clock_style_option_background_size"
        android:layout_height="@dimen/floating_sheet_clock_style_option_background_size"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        android:importantForAccessibility="no"
        android:layout_gravity="bottom" />
        android:layout_width="@dimen/floating_sheet_clock_style_option_size"
        android:layout_height="@dimen/floating_sheet_clock_style_option_size"
        android:layout_gravity="center"
        android:importantForAccessibility="no" />


    <ImageView
        android:id="@+id/foreground"
        android:layout_width="@dimen/floating_sheet_clock_style_option_thumbnail_size"
        android:layout_height="@dimen/floating_sheet_clock_style_option_thumbnail_size"
        android:layout_marginBottom="@dimen/floating_sheet_clock_style_thumbnail_margin_bottom"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        android:layout_gravity="center"
        android:src="@drawable/ic_clock_24px" />

    <FrameLayout
        android:id="@+id/edit_icon"
        android:layout_width="@dimen/floating_sheet_clock_edit_icon_size"
        android:layout_height="@dimen/floating_sheet_clock_edit_icon_size"
        android:layout_marginTop="@dimen/floating_sheet_clock_edit_icon_margin"
        android:layout_marginEnd="@dimen/floating_sheet_clock_edit_icon_margin"
        app:layout_constraintEnd_toEndOf="@+id/background"
        app:layout_constraintTop_toTopOf="@+id/background" >
        <ImageView
            android:id="@+id/edit_icon_background"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:src="@drawable/edit_icon_background"
            android:importantForAccessibility="no" />

        <ImageView
            android:id="@+id/edit_icon_foreground"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:src="@drawable/edit_icon_foreground"
            android:importantForAccessibility="no" />
</FrameLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
+2 −25
Original line number Diff line number Diff line
@@ -41,8 +41,8 @@
            android:layout_height="wrap_content" />

        <include
            layout="@layout/floating_sheet_clock_font_content"
            android:id="@+id/clock_floating_sheet_font_content"
            layout="@layout/floating_sheet_clock_size_content"
            android:id="@+id/clock_floating_sheet_size_content"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </FrameLayout>
@@ -66,28 +66,5 @@
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center" />

        <LinearLayout
            android:id="@+id/clock_font_toolbar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_gravity="center_horizontal">

            <ImageView
                android:id="@+id/clock_font_revert"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/clock_font_revert"
                android:contentDescription="@string/clock_font_editor_revert" />

            <ImageView
                android:id="@+id/clock_font_apply"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:paddingStart="@dimen/clock_font_apply_padding_start"
                android:src="@drawable/clock_font_apply"
                android:contentDescription="@string/clock_font_editor_apply" />
        </LinearLayout>
    </FrameLayout>
</LinearLayout>
+0 −159
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2024 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/clock_floating_sheet_font_content"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingVertical="@dimen/floating_sheet_content_vertical_padding"
    android:paddingHorizontal="@dimen/floating_sheet_content_horizontal_padding"
    android:clipChildren="false"
    android:clipToPadding="false">

    <TextView
        android:id="@+id/clock_axis_slider_name1"
        android:layout_width="@dimen/clock_font_axis_name_width"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toTopOf="@+id/barrier1"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/clock_axis_slider1"
        android:layout_marginVertical="@dimen/clock_axis_control_slider_row_margin_vertical"
        android:layout_marginEnd="@dimen/clock_axis_control_text_margin_end"
        android:lines="1"
        android:ellipsize="end"
        style="@style/CustomizationOptionEntryTitleTextStyle"
        android:text="@string/tab_placeholder_text" />

    <com.google.android.material.slider.Slider
        android:id="@+id/clock_axis_slider1"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:minHeight="@dimen/accessibility_min_height"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toTopOf="@+id/barrier1"
        app:layout_constraintStart_toEndOf="@+id/clock_axis_slider_name1"
        app:layout_constraintEnd_toEndOf="parent"
        android:layout_marginVertical="@dimen/clock_axis_control_slider_row_margin_vertical"
        app:trackHeight="@dimen/slider_track_height"
        app:thumbHeight="@dimen/slider_thumb_height"
        android:theme="@style/Theme.Material3.DynamicColors.DayNight" />

    <androidx.constraintlayout.widget.Barrier
        android:id="@+id/barrier1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:barrierDirection="bottom"
        app:constraint_referenced_ids="clock_axis_slider1,clock_axis_slider_name1" />

    <TextView
        android:id="@+id/clock_axis_slider_name2"
        android:layout_width="@dimen/clock_font_axis_name_width"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toBottomOf="@+id/barrier1"
        app:layout_constraintBottom_toTopOf="@+id/barrier2"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/clock_axis_slider2"
        android:layout_marginVertical="@dimen/clock_axis_control_slider_row_margin_vertical"
        android:layout_marginEnd="@dimen/clock_axis_control_text_margin_end"
        android:lines="1"
        android:ellipsize="end"
        style="@style/CustomizationOptionEntryTitleTextStyle"
        android:text="@string/tab_placeholder_text" />

    <com.google.android.material.slider.Slider
        android:id="@+id/clock_axis_slider2"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:minHeight="@dimen/accessibility_min_height"
        app:layout_constraintTop_toBottomOf="@+id/barrier1"
        app:layout_constraintBottom_toTopOf="@+id/barrier2"
        app:layout_constraintStart_toEndOf="@+id/clock_axis_slider_name2"
        app:layout_constraintEnd_toEndOf="parent"
        android:layout_marginVertical="@dimen/clock_axis_control_slider_row_margin_vertical"
        app:trackHeight="@dimen/slider_track_height"
        app:thumbHeight="@dimen/slider_thumb_height"
        android:theme="@style/Theme.Material3.DynamicColors.DayNight" />

    <androidx.constraintlayout.widget.Barrier
        android:id="@+id/barrier2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:barrierDirection="bottom"
        app:constraint_referenced_ids="clock_axis_slider2,clock_axis_slider_name2" />

    <TextView
        android:id="@+id/clock_axis_switch_name1"
        android:layout_width="@dimen/clock_font_axis_name_width"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toBottomOf="@+id/barrier2"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        android:layout_marginVertical="@dimen/clock_axis_control_switch_row_margin_vertical"
        android:lines="1"
        android:ellipsize="end"
        style="@style/CustomizationOptionEntryTitleTextStyle"
        android:text="@string/tab_placeholder_text" />

    <com.google.android.material.materialswitch.MaterialSwitch
        android:id="@+id/clock_axis_switch1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toBottomOf="@+id/barrier2"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toEndOf="@+id/clock_axis_switch_name1"
        android:layout_marginVertical="@dimen/clock_axis_control_switch_row_margin_vertical"
        android:layout_marginStart="@dimen/clock_axis_control_text_margin_end"
        android:theme="@style/Theme.Material3.DynamicColors.DayNight" />

    <ImageView
        android:id="@+id/divider"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toBottomOf="@+id/barrier2"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        android:src="@drawable/clock_font_switch_divider"
        android:importantForAccessibility="no" />

    <TextView
        android:id="@+id/clock_axis_switch_name2"
        android:layout_width="@dimen/clock_font_axis_name_width"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toBottomOf="@+id/barrier2"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/clock_axis_switch2"
        android:layout_marginVertical="@dimen/clock_axis_control_switch_row_margin_vertical"
        android:layout_marginEnd="@dimen/clock_axis_control_text_margin_end"
        android:lines="1"
        android:ellipsize="end"
        style="@style/CustomizationOptionEntryTitleTextStyle"
        android:text="@string/tab_placeholder_text" />

    <com.google.android.material.materialswitch.MaterialSwitch
        android:id="@+id/clock_axis_switch2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toBottomOf="@+id/barrier2"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        android:layout_marginVertical="@dimen/clock_axis_control_switch_row_margin_vertical"
        android:theme="@style/Theme.Material3.DynamicColors.DayNight" />
</androidx.constraintlayout.widget.ConstraintLayout>
 No newline at end of file
+59 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (C) 2025 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingVertical="@dimen/floating_sheet_content_vertical_padding"
    android:clipToPadding="false"
    android:clipChildren="false">

    <TextView
        android:id="@+id/clock_style_clock_size_title"
        style="@style/CustomizationOptionEntryTitleTextStyle"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="@string/clock_size_large"
        android:layout_marginStart="@dimen/floating_sheet_content_horizontal_padding"
        android:layout_marginEnd="@dimen/floating_sheet_clock_style_clock_size_text_margin_end"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/clock_style_clock_size_switch"
        app:layout_constraintTop_toBottomOf="parent"
        app:layout_constraintBottom_toTopOf="@+id/clock_style_clock_size_description" />

    <TextView
        android:id="@+id/clock_style_clock_size_description"
        style="@style/CustomizationOptionEntrySubtitleTextStyle"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/floating_sheet_content_horizontal_padding"
        android:layout_marginEnd="@dimen/floating_sheet_clock_style_clock_size_text_margin_end"
        android:text="@string/clock_size_large_description"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/clock_style_clock_size_switch"
        app:layout_constraintTop_toBottomOf="@+id/clock_style_clock_size_title"
        app:layout_constraintBottom_toBottomOf="parent" />

    <com.google.android.material.materialswitch.MaterialSwitch
        android:id="@+id/clock_style_clock_size_switch"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="@dimen/floating_sheet_content_horizontal_padding"
        app:layout_constraintTop_toTopOf="@+id/clock_style_clock_size_title"
        app:layout_constraintBottom_toBottomOf="@+id/clock_style_clock_size_description"
        app:layout_constraintEnd_toEndOf="parent"
        android:theme="@style/Theme.Material3.DynamicColors.DayNight" />
</androidx.constraintlayout.widget.ConstraintLayout>
Loading