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

Commit 4d1f8c3d authored by Santiago Etchebehere's avatar Santiago Etchebehere
Browse files

ThemePicker: Implement the Clock section

Add a Fragment to show and apply available clockfaces.
A few more iterations are needed on the UI but this CL focuses
on the functionality.

Bug: 120560400

Change-Id: I809cb861cf4c03c4b6d84b94e839300dbea200a1
parent b36df5d5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
        android:restoreAnyVersion="true"
        android:supportsRtl="true">

        <activity android:name="com.android.theme.picker.ThemePickerActivity"
        <activity android:name="com.android.customization.picker.CustomizationPickerActivity"
            android:label="@string/app_name"
            android:theme="@style/CustomizationTheme.NoActionBar"
            android:resizeableActivity="true">
+42 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2019 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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <TextView
        android:id="@+id/option_label"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:layout_marginBottom="@dimen/theme_option_label_margin"
        android:textAppearance="@style/OptionTitleTextAppearance"/>
    <FrameLayout
        android:id="@+id/option_tile"
        android:layout_width="@dimen/option_tile_width"
        android:layout_height="@dimen/option_tile_width"
        android:layout_gravity="center_horizontal"
        android:paddingHorizontal="@dimen/option_tile_padding_horizontal"
        android:paddingVertical="@dimen/option_tile_padding_vertical"
        android:background="@drawable/option_border">
        <ImageView
            android:id="@+id/clock_option_thumbnail"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>
    </FrameLayout>
</LinearLayout>
+29 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2019 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.cardview.widget.CardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    style="@style/FullContentPreviewCard"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ImageView
        android:id="@+id/clock_preview_image"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/clockface_preview_background"/>

</androidx.cardview.widget.CardView>
 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) 2019 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.
-->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@color/category_picker_background_color">
    <include layout="@layout/section_header"/>

    <com.android.customization.widget.PreviewPager
        android:id="@+id/clock_preview_pager"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:background="@color/secondary_color"/>

    <LinearLayout
        android:id="@+id/options_section"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="10dp"
        android:orientation="vertical">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/options_container"
            android:layout_width="match_parent"
            android:layout_height="@dimen/options_container_height"
            android:layout_gravity="center_horizontal"/>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <Button
                android:id="@+id/apply_button"
                style="@style/ActionPrimaryButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:text="@string/apply_btn"/>
        </RelativeLayout>

    </LinearLayout>

</LinearLayout>
+2 −0
Original line number Diff line number Diff line
@@ -23,4 +23,6 @@

    <color name="shape_thumbnail_color">#b2b2b2</color>
    <color name="icon_thumbnail_color">@android:color/black</color>

    <color name="clockface_preview_background">@android:color/black</color>
</resources>
 No newline at end of file
Loading