We will be re-using the grid UI for the dream complication picker, so this change refactors some of that logic so it can be re-used in the complication controller. We also update some of the UI here to match the most recent UX decisions. http://screen/BxhAwZwQSVoxUmN.png Test: locally on device Test: make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.dream.DreamPickerControllerTest" Bug: 214250590 Bug: 215703483 Change-Id: I9fbfa0f0cd31ae3d119c7cd1a9562d4cdb203d6c
92 lines
4.1 KiB
XML
92 lines
4.1 KiB
XML
<?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.
|
|
-->
|
|
|
|
<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"
|
|
android:layout_height="wrap_content"
|
|
style="@style/DreamCardStyle"
|
|
android:clickable="true">
|
|
|
|
<androidx.constraintlayout.widget.ConstraintLayout
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:minHeight="?android:attr/listPreferredItemHeight">
|
|
|
|
<androidx.cardview.widget.CardView
|
|
android:id="@+id/preview_container"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="0dp"
|
|
app:cardCornerRadius="@dimen/dream_item_corner_radius"
|
|
app:cardElevation="0dp"
|
|
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>
|
|
|
|
<Button
|
|
android:id="@+id/customize_button"
|
|
style="@style/ActionPrimaryButton"
|
|
android:layout_width="wrap_content"
|
|
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"/>
|
|
|
|
<ImageView
|
|
android:id="@+id/icon"
|
|
android:layout_width="@dimen/dream_item_icon_size"
|
|
android:layout_height="0dp"
|
|
android:layout_marginTop="@dimen/dream_item_title_margin_top"
|
|
android:layout_marginStart="@dimen/dream_item_icon_margin_start"
|
|
android:layout_marginBottom="@dimen/dream_item_title_margin_bottom"
|
|
android:gravity="center_vertical"
|
|
app:layout_constraintDimensionRatio="1:1"
|
|
app:layout_constraintHorizontal_chainStyle="packed"
|
|
app:layout_constraintTop_toBottomOf="@+id/preview_container"
|
|
app_layout_constraintEnd_toStartOf="@+id/title_text"
|
|
app:layout_constraintStart_toStartOf="parent"/>
|
|
|
|
<TextView
|
|
android:id="@+id/title_text"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginTop="@dimen/dream_item_title_margin_top"
|
|
android:layout_marginStart="@dimen/dream_item_title_margin_start"
|
|
android:layout_marginBottom="@dimen/dream_item_title_margin_bottom"
|
|
android:gravity="center_vertical"
|
|
android:maxLines="1"
|
|
android:ellipsize="end"
|
|
android:textAppearance="?android:attr/textAppearanceListItemSmall"
|
|
app:layout_constraintTop_toBottomOf="@+id/preview_container"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toEndOf="@+id/icon"/>
|
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
</androidx.cardview.widget.CardView>
|