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

Commit b5e469ae authored by Anay Wadhera's avatar Anay Wadhera Committed by Michael Bestas
Browse files

ThemePicker: Bring back fonts, icon pack, shape customization



 * Based on android 11 impl
 * Sections moved to new UI for Android 14

Co-authored-by: default avatarAdithya R <gh0strider.2k18.reborn@gmail.com>
Co-authored-by: default avatarIdo Ben-Hur <idoybh2@gmail.com>
Co-authored-by: default avatarpalaych <palaych@arrowos.net>
Co-authored-by: default avatarTommy Webb <tommy@calyxinstitute.org>
Change-Id: I60b24f0cd8e898cb6d43ad190cad99a73cb7b2bb
parent b416885a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
    <uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>
    <uses-permission android:name="android.permission.READ_WALLPAPER_INTERNAL"/>
    <uses-permission android:name="android.permission.SET_WALLPAPER"/>
    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />

    <queries>
        <package android:name="android"/>
+37 −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:id="@+id/font_preview_card"
    android:contentDescription="@string/font_preview_content_description"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="center">

    <FrameLayout
        android:id="@+id/theme_preview_card_body_container"
        android:layout_width="match_parent"
        android:layout_height="@dimen/preview_theme_content_max_height"
        android:layout_marginTop="@dimen/preview_theme_content_margin"
        android:clipChildren="false"
        android:importantForAccessibility="noHideDescendants">

        <include layout="@layout/preview_card_font_content" />

   </FrameLayout>
</androidx.cardview.widget.CardView>
+46 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<com.android.customization.picker.font.FontSectionView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:paddingBottom="@dimen/section_bottom_padding"
    android:paddingHorizontal="@dimen/section_horizontal_padding"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:orientation="vertical">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/preview_name_font"
            style="@style/SectionTitleTextStyle" />

        <TextView
            android:id="@+id/font_section_description"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            style="@style/SectionSubtitleTextStyle"/>
    </LinearLayout>

    <FrameLayout
        android:id="@+id/font_section_tile"
        android:layout_width="@dimen/option_tile_width"
        android:layout_height="@dimen/option_tile_width"
        android:scaleType="center"
        android:background="@drawable/option_border_color">
        <TextView
            android:id="@+id/thumbnail_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:textSize="@dimen/font_comonent_option_thumbnail_size"
            android:textAlignment="center"
            android:textColor="?android:attr/colorForeground"
            android:text="@string/font_component_option_thumbnail"/>
    </FrameLayout>

</com.android.customization.picker.font.FontSectionView>
+85 −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"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <include layout="@layout/section_header"/>

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/content_section"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <FrameLayout
                android:id="@+id/preview_card_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:clipToPadding="false"
                android:paddingTop="@dimen/preview_page_top_margin"
                android:paddingBottom="@dimen/preview_page_bottom_margin"
                app:layout_constrainedHeight="true"
                app:layout_constraintBottom_toTopOf="@+id/options_container"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent">

                <include layout="@layout/font_preview_card" />
            </FrameLayout>

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/options_container"
                android:layout_width="match_parent"
                android:layout_height="@dimen/options_container_height"
                android:layout_marginBottom="@dimen/grid_options_container_bottom_margin"
                android:paddingHorizontal="@dimen/grid_options_container_horizontal_margin"
                android:clipToPadding="false"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent" />
        </androidx.constraintlayout.widget.ConstraintLayout>

        <androidx.core.widget.ContentLoadingProgressBar
            android:id="@+id/loading_indicator"
            style="@android:style/Widget.DeviceDefault.ProgressBar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="200dp"
            android:layout_gravity="center_horizontal|top"
            android:indeterminate="true"/>
        <FrameLayout
            android:id="@+id/error_section"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="gone">
            <TextView
                android:id="@+id/error_message"
                style="@style/TitleTextAppearance"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:gravity="center"
                android:text="@string/something_went_wrong"/>
        </FrameLayout>
    </FrameLayout>
</LinearLayout>
+85 −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"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <include layout="@layout/section_header"/>

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/content_section"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <FrameLayout
                android:id="@+id/preview_card_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:clipToPadding="false"
                android:paddingTop="@dimen/preview_page_top_margin"
                android:paddingBottom="@dimen/preview_page_bottom_margin"
                app:layout_constrainedHeight="true"
                app:layout_constraintBottom_toTopOf="@+id/options_container"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent">

                <include layout="@layout/icon_preview_card" />
            </FrameLayout>

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/options_container"
                android:layout_width="match_parent"
                android:layout_height="@dimen/options_container_height"
                android:layout_marginBottom="@dimen/grid_options_container_bottom_margin"
                android:paddingHorizontal="@dimen/grid_options_container_horizontal_margin"
                android:clipToPadding="false"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent" />
        </androidx.constraintlayout.widget.ConstraintLayout>

        <androidx.core.widget.ContentLoadingProgressBar
            android:id="@+id/loading_indicator"
            style="@android:style/Widget.DeviceDefault.ProgressBar"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="200dp"
            android:layout_gravity="center_horizontal|top"
            android:indeterminate="true"/>
        <FrameLayout
            android:id="@+id/error_section"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="gone">
            <TextView
                android:id="@+id/error_message"
                style="@style/TitleTextAppearance"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:gravity="center"
                android:text="@string/something_went_wrong"/>
        </FrameLayout>
    </FrameLayout>
</LinearLayout>
Loading