1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 Copyright (C) 2021 The Android Open Source Project 4 5 Licensed under the Apache License, Version 2.0 (the "License"); 6 you may not use this file except in compliance with the License. 7 You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11 Unless required by applicable law or agreed to in writing, software 12 distributed under the License is distributed on an "AS IS" BASIS, 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 See the License for the specific language governing permissions and 15 limitations under the License. 16--> 17<com.android.wallpaper.picker.WallpaperSectionView 18 xmlns:android="http://schemas.android.com/apk/res/android" 19 xmlns:app="http://schemas.android.com/apk/res-auto" 20 android:layout_width="match_parent" 21 android:layout_height="wrap_content" 22 android:paddingBottom="@dimen/section_bottom_padding" 23 android:paddingHorizontal="@dimen/section_horizontal_padding" 24 android:orientation="vertical"> 25 26 <androidx.constraintlayout.widget.ConstraintLayout 27 android:layout_width="match_parent" 28 android:layout_height="wrap_content" 29 android:background="@drawable/wallpaper_section_background" 30 android:contentDescription="@string/wallpaper_preview_card_content_description"> 31 32 <!-- Width percent = 146(preview width in spec) / 364(parent width in spec) = 0.4 --> 33 <!-- The height will be determined programmatically --> 34 <include 35 android:id="@+id/lock_preview" 36 layout="@layout/wallpaper_preview_card" 37 android:layout_width="0dp" 38 android:layout_height="0dp" 39 android:layout_marginTop="@dimen/wallpaper_preview_margin_top" 40 app:layout_constraintEnd_toStartOf="@id/home_preview" 41 app:layout_constraintStart_toStartOf="parent" 42 app:layout_constraintTop_toTopOf="parent" 43 app:layout_constraintWidth_percent="0.4" /> 44 45 <include 46 android:id="@+id/home_preview" 47 layout="@layout/wallpaper_preview_card" 48 android:layout_width="0dp" 49 android:layout_height="0dp" 50 android:layout_marginTop="@dimen/wallpaper_preview_margin_top" 51 app:layout_constraintEnd_toEndOf="parent" 52 app:layout_constraintStart_toEndOf="@id/lock_preview" 53 app:layout_constraintTop_toTopOf="parent" 54 app:layout_constraintWidth_percent="0.4" /> 55 56 <include 57 android:id="@+id/permission_needed" 58 layout="@layout/permission_needed_layout" 59 android:layout_width="0dp" 60 android:layout_height="wrap_content" 61 android:visibility="gone" 62 app:layout_constraintEnd_toEndOf="parent" 63 app:layout_constraintStart_toStartOf="parent" 64 app:layout_constraintTop_toBottomOf="@id/home_preview" /> 65 66 <Button 67 android:id="@+id/wallpaper_picker_entry" 68 android:layout_width="wrap_content" 69 android:layout_height="wrap_content" 70 android:layout_marginVertical="@dimen/wallpaper_picker_entry_margin_vertical" 71 android:paddingHorizontal="@dimen/wallpaper_picker_entry_horizontal_padding" 72 android:background="@drawable/btn_transparent_background" 73 android:textColor="?android:attr/colorAccent" 74 android:drawablePadding="@dimen/wallpaper_picker_entry_drawable_padding" 75 android:drawableStart="@drawable/ic_nav_wallpaper" 76 android:drawableTint="?android:attr/colorAccent" 77 android:text="@string/wallpaper_picker_entry_title" 78 app:layout_constraintBottom_toBottomOf="parent" 79 app:layout_constraintEnd_toEndOf="parent" 80 app:layout_constraintStart_toStartOf="parent" 81 app:layout_constraintTop_toBottomOf="@id/permission_needed" /> 82 83 </androidx.constraintlayout.widget.ConstraintLayout> 84</com.android.wallpaper.picker.WallpaperSectionView> 85