1<!--
2  ~ Copyright (C) 2021 The Android Open Source Project
3  ~
4  ~ Licensed under the Apache License, Version 2.0 (the "License");
5  ~ you may not use this file except in compliance with the License.
6  ~ You may obtain a copy of the License at
7  ~
8  ~      http://www.apache.org/licenses/LICENSE-2.0
9  ~
10  ~ Unless required by applicable law or agreed to in writing, software
11  ~ distributed under the License is distributed on an "AS IS" BASIS,
12  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  ~ See the License for the specific language governing permissions and
14  ~ limitations under the License.
15  -->
16
17<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
18             android:background="@color/preview_background_color"
19             android:layout_width="match_parent"
20             android:layout_height="match_parent">
21
22    <androidx.viewpager2.widget.ViewPager2
23        android:layout_width="match_parent"
24        android:layout_height="match_parent"
25        android:id="@+id/preview_viewPager"
26        android:layout_gravity="center"
27        android:accessibilityTraversalBefore="@+id/toolbar"/>
28
29    <!-- Adds scrim for Toolbar -->
30    <FrameLayout
31        android:id="@+id/preview_top_scrim"
32        android:layout_width="match_parent"
33        android:layout_height="@dimen/preview_toolbar_scrim_height"
34        android:background="@drawable/preview_gradient_desc"
35        android:layout_gravity="top"
36        android:visibility="gone"/>
37
38    <!-- Adds scrim for deselect and Add button -->
39    <FrameLayout
40        android:id="@+id/preview_bottom_scrim"
41        android:layout_width="match_parent"
42        android:layout_height="@dimen/preview_deselect_scrim_height"
43        android:background="@drawable/preview_gradient_asc"
44        android:layout_gravity="bottom"
45        android:visibility="gone"/>
46
47    <FrameLayout
48        android:id="@+id/preview_bottom_bar"
49        android:layout_gravity="bottom"
50        android:layout_width="match_parent"
51        android:layout_height="@dimen/picker_bottom_bar_size"
52        android:paddingHorizontal="@dimen/preview_buttons_padding_horizontal"
53        android:importantForAccessibility="yes"
54        android:accessibilityTraversalAfter="@+id/toolbar">
55
56        <!-- Buttons for Preview on Long press. Visible by default -->
57        <Button
58            android:id="@+id/preview_add_or_select_button"
59            android:layout_width="@dimen/preview_add_or_select_width"
60            android:layout_height="wrap_content"
61            android:layout_gravity="center"
62            android:backgroundTint="@color/preview_highlight_color"
63            android:paddingVertical="@dimen/picker_bottom_bar_buttons_vertical_gap"
64            android:text="@string/add"
65            android:textAllCaps="false"
66            android:textColor="@color/preview_default_grey"
67            style="@style/MaterialButtonStyle"/>
68
69        <!-- Buttons for Preview on View Selected. Hidden by default -->
70        <Button
71            android:id="@+id/preview_selected_check_button"
72            android:layout_width="wrap_content"
73            android:layout_height="wrap_content"
74            android:layout_gravity="start|center_vertical"
75            android:paddingStart="@dimen/preview_deselect_padding_start"
76            android:paddingVertical="@dimen/picker_bottom_bar_buttons_vertical_gap"
77            android:background="@android:color/transparent"
78            android:drawableLeft="@drawable/preview_check"
79            android:drawableTint="@color/preview_highlight_color"
80            android:textAllCaps="false"
81            android:text="@string/selected"
82            android:textColor="@color/picker_default_white"
83            android:visibility="gone"
84            style="@style/MaterialBorderlessButtonStyle"/>
85
86        <Button
87            android:id="@+id/preview_add_button"
88            android:layout_width="wrap_content"
89            android:layout_height="wrap_content"
90            android:layout_gravity="end|center_vertical"
91            android:backgroundTint="@color/preview_highlight_color"
92            android:paddingVertical="@dimen/picker_bottom_bar_buttons_vertical_gap"
93            android:text="@string/add"
94            android:textAllCaps="false"
95            android:textColor="@color/preview_default_grey"
96            android:visibility="gone"
97            style="@style/MaterialButtonStyle"/>
98    </FrameLayout>
99</FrameLayout>
100