Files
app_Settings/res/layout/dream_preference_layout.xml
Prince 487e510a6d Dream settings UI update
Update dream settings button placement and other updates.

Test: Device tested
Fixes: 349656117
Flag: android.service.dreams.dreams_v2
Change-Id: Iea4d015b0da65b506f84c81e509380ba6db74fb8
2025-04-11 11:34:56 -07:00

152 lines
7.3 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: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">
<ImageView
android:id="@+id/preview"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/dream_preview_rounded_bg"
android:importantForAccessibility="no"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<ImageView
android:id="@+id/preview_placeholder"
android:layout_width="@dimen/dream_preview_placeholder_width"
android:layout_height="0dp"
android:src="@drawable/dream_default_preview_icon"
android:importantForAccessibility="no"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintTop_toTopOf="@+id/preview"
app:layout_constraintBottom_toBottomOf="@+id/preview"
app:layout_constraintStart_toStartOf="@+id/preview"
app:layout_constraintEnd_toEndOf="@+id/preview"/>
<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"
android:hyphenationFrequency="normalFast"
android:lineBreakWordStyle="phrase"
app:layout_constraintTop_toTopOf="@+id/preview"
app:layout_constraintBottom_toBottomOf="@+id/preview"
app:layout_constraintStart_toStartOf="@+id/preview"
app:layout_constraintEnd_toEndOf="@+id/preview"/>
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/customize_button_new"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dream_item_customize_button_margin_bottom"
android:text="@string/customize_button_title"
android:contentDescription="@string/customize_button_title"
lineBreakWordStyle="phrase"
android:textAllCaps="false"
android:visibility="gone"
android:textColor="@color/settingslib_btn_colored_text_material"
android:theme="@style/Theme.CollapsingToolbar.Settings"
app:backgroundTint="@color/settingslib_btn_colored_background_material"
app:iconTint="@color/settingslib_btn_colored_text_material"
app:icon="@drawable/ic_edit"
app:layout_constraintBottom_toBottomOf="@+id/preview"
app:layout_constraintStart_toStartOf="@+id/preview"
app:layout_constraintEnd_toEndOf="@+id/preview"/>
<FrameLayout
android:id="@+id/preview_button"
android:layout_width="@dimen/dream_preview_button_frame_size"
android:layout_height="@dimen/dream_preview_button_frame_size"
android:clipChildren="false"
android:focusable="true"
android:contentDescription="@string/dream_preview_button_title"
android:visibility="gone"
app:layout_constraintTop_toTopOf="@+id/preview"
app:layout_constraintEnd_toEndOf="@+id/preview">
<FrameLayout
android:layout_width="@dimen/dream_preview_button_size"
android:layout_height="@dimen/dream_preview_button_size"
android:layout_gravity="center"
android:background="@drawable/dream_preview_button_background"
app:backgroundTint="@color/settingslib_btn_colored_background_material"
android:focusable="false">
<ImageView
android:layout_width="@dimen/dream_preview_button_icon_size"
android:layout_height="@dimen/dream_preview_button_icon_size"
android:layout_gravity="center"
android:background="@drawable/dream_preview_button_background"
android:src="@drawable/dream_preview_icon"
android:tint="@color/settingslib_btn_colored_text_material"
android:tintMode="src_in" />
</FrameLayout>
</FrameLayout>
<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_marginHorizontal="@dimen/dream_item_title_margin_horizontal"
android:layout_marginBottom="@dimen/dream_item_title_margin_bottom"
android:gravity="center_vertical"
android:maxLines="1"
android:ellipsize="end"
android:textSize="@dimen/dream_item_title_text_size"
android:textColor="@color/dream_card_text_color_state_list"
android:drawablePadding="@dimen/dream_item_icon_padding"
android:drawableTint="@color/dream_card_icon_color_state_list"
app:layout_constraintTop_toBottomOf="@+id/preview"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@id/summary_text"/>
<TextView
android:id="@+id/summary_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/dream_item_title_margin_horizontal"
android:layout_marginBottom="@dimen/dream_item_title_margin_bottom"
android:maxLines="2"
android:ellipsize="end"
android:textSize="@dimen/dream_item_summary_text_size"
android:textColor="@color/dream_card_summary_color_state_list"
app:layout_constraintTop_toBottomOf="@+id/title_text"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>