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

Commit 80e1ceed authored by Santiago Etchebehere's avatar Santiago Etchebehere
Browse files

ThemePicker: First iteration of Grid section

Create the Fragment and provider to interface with
Launcher.
Some polish is still pending, as well as applying the grid
to the launcher.

Bug: 120560197
Change-Id: I5fc35c901a33f2163d2864bfc9e177c74d49aa36
parent deabe903
Loading
Loading
Loading
Loading
+58 −0
Original line number Original line 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/grid_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
                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>
+42 −0
Original line number Original line 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:padding="@dimen/option_tile_padding_vertical"
        android:background="@drawable/option_border"
        android:gravity="center">
        <ImageView
            android:id="@+id/grid_option_thumbnail"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>
    </FrameLayout>
</LinearLayout>
+29 −0
Original line number Original line 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/grid_preview_image"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/primary_color"/>

</androidx.cardview.widget.CardView>
 No newline at end of file
+2 −2
Original line number Original line Diff line number Diff line
@@ -23,11 +23,11 @@
    <item
    <item
        android:id="@+id/nav_clock"
        android:id="@+id/nav_clock"
        android:title="@string/clock_title"
        android:title="@string/clock_title"
        android:icon="@drawable/ic_nav_grid" />
        android:icon="@drawable/ic_nav_clock" />
    <item
    <item
        android:id="@+id/nav_grid"
        android:id="@+id/nav_grid"
        android:title="@string/grid_title"
        android:title="@string/grid_title"
        android:icon="@drawable/ic_nav_theme" />
        android:icon="@drawable/ic_nav_grid" />
    <item
    <item
        android:id="@+id/nav_wallpaper"
        android:id="@+id/nav_wallpaper"
        android:title="@string/wallpaper_title"
        android:title="@string/wallpaper_title"
+2 −0
Original line number Original line Diff line number Diff line
@@ -17,4 +17,6 @@
-->
-->
<resources>
<resources>
    <string name="themes_stub_package" translatable="false"/>
    <string name="themes_stub_package" translatable="false"/>

    <string name="grid_control_authority" translatable="false"/>
</resources>
</resources>
 No newline at end of file
Loading