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

Commit 75c44cd0 authored by Lucas Silva's avatar Lucas Silva
Browse files

Update dream settings UX to match latest mocks.

Updates:
- removed individual complication toggle
- added single toggle which enables/disables all supported complications
- updated colors to match mocks
- updated grid padding in order to line up with existing content. Note:
  this required more complex padding logic, using an item decorator to
  apply the padding only to inner grid elements.
- updated preview image, removing view nesting to make better use of
  ConstraintLayout
- Updated some strings to match mocks

Test: locally on device
Bug: 217555053
Change-Id: I573e5f4ed807cbe2ae9e00f183d402e6e3339590
parent cce99074
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -17,6 +17,6 @@

<selector xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
    <item android:state_selected="true" android:color="?androidprv:attr/colorSurfaceVariant"/>
    <item android:color="?androidprv:attr/colorSurfaceHighlight"/>
    <item android:state_selected="true" android:color="?androidprv:attr/colorAccentPrimary"/>
    <item android:color="?androidprv:attr/colorSurface"/>
</selector>
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2022 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.
  -->

<selector xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
    <item android:state_selected="true" android:color="?androidprv:attr/textColorOnAccent"/>
    <item android:color="?android:attr/textColorPrimary"/>
</selector>
 No newline at end of file
+20 −0
Original line number Diff line number Diff line
<!--
  ~ Copyright (C) 2022 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.
  -->

<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="rectangle">
    <corners android:radius="@dimen/dream_item_corner_radius"/>
</shape>
 No newline at end of file
+16 −23
Original line number Diff line number Diff line
@@ -15,19 +15,10 @@
    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="wrap_content">

    <androidx.cardview.widget.CardView
        android:id="@+id/dream_picker_container"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        style="@style/DreamPickerBackgroundStyle">

<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">

@@ -37,10 +28,12 @@
        android:layout_height="wrap_content"
        android:clipToPadding="true"
        android:nestedScrollingEnabled="false"
        android:paddingStart="?android:attr/listPreferredItemPaddingStart"
        android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
        android:paddingBottom="@dimen/dream_preference_card_padding"
        app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintEnd_toEndOf="parent"/>
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"/>

</androidx.constraintlayout.widget.ConstraintLayout>
 No newline at end of file

    </androidx.cardview.widget.CardView>
</LinearLayout>
+14 −20
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@

<androidx.cardview.widget.CardView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/container"
    android:layout_width="match_parent"
@@ -30,21 +29,15 @@
        android:layout_height="wrap_content"
        android:minHeight="?android:attr/listPreferredItemHeight">

        <androidx.cardview.widget.CardView
            android:id="@+id/preview_container"
            android:layout_width="match_parent"
        <ImageView
            android:id="@+id/preview"
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:cardCornerRadius="@dimen/dream_item_corner_radius"
            app:cardElevation="0dp"
            android:background="@drawable/dream_preview_rounded_bg"
            app:layout_constraintDimensionRatio="1:1"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintStart_toStartOf="parent">
            <ImageView
                android:id="@+id/preview"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scaleType="centerCrop"/>
        </androidx.cardview.widget.CardView>
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toEndOf="parent"/>

        <Button
            android:id="@+id/customize_button"
@@ -53,10 +46,10 @@
            android:layout_height="wrap_content"
            android:visibility="gone"
            android:text="@string/customize_button_title"
            app:layout_constraintTop_toTopOf="@+id/preview_container"
            app:layout_constraintBottom_toBottomOf="@+id/preview_container"
            app:layout_constraintStart_toStartOf="@+id/preview_container"
            app:layout_constraintEnd_toEndOf="@+id/preview_container"/>
            app:layout_constraintTop_toTopOf="@+id/preview"
            app:layout_constraintBottom_toBottomOf="@+id/preview"
            app:layout_constraintStart_toStartOf="@+id/preview"
            app:layout_constraintEnd_toEndOf="@+id/preview"/>

        <ImageView
            android:id="@+id/icon"
@@ -68,7 +61,7 @@
            android:gravity="center_vertical"
            app:layout_constraintDimensionRatio="1:1"
            app:layout_constraintHorizontal_chainStyle="packed"
            app:layout_constraintTop_toBottomOf="@+id/preview_container"
            app:layout_constraintTop_toBottomOf="@+id/preview"
            app_layout_constraintEnd_toStartOf="@+id/title_text"
            app:layout_constraintStart_toStartOf="parent"/>

@@ -82,8 +75,9 @@
            android:gravity="center_vertical"
            android:maxLines="1"
            android:ellipsize="end"
            android:textAppearance="?android:attr/textAppearanceListItemSmall"
            app:layout_constraintTop_toBottomOf="@+id/preview_container"
            android:textSize="16sp"
            android:textColor="@color/dream_card_text_color_state_list"
            app:layout_constraintTop_toBottomOf="@+id/preview"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@+id/icon"/>

Loading