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<androidx.constraintlayout.widget.ConstraintLayout
18    xmlns:android="http://schemas.android.com/apk/res/android"
19    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
20    xmlns:app="http://schemas.android.com/apk/res-auto"
21    xmlns:tools="http://schemas.android.com/tools"
22    android:id="@+id/root"
23    android:layout_width="match_parent"
24    android:layout_height="match_parent">
25
26    <Button
27        android:id="@+id/save"
28        style="@android:style/Widget.DeviceDefault.Button.Colored"
29        android:layout_width="wrap_content"
30        android:layout_height="48dp"
31        android:text="@string/save"
32        android:layout_marginStart="8dp"
33        android:layout_marginTop="@dimen/long_screenshot_action_bar_top_margin"
34        android:background="@drawable/overlay_button_background"
35        android:backgroundTint="?androidprv:attr/materialColorPrimary"
36        android:textColor="?androidprv:attr/materialColorOnPrimary"
37        app:layout_constraintStart_toStartOf="parent"
38        app:layout_constraintTop_toTopOf="parent"
39        app:layout_constraintBottom_toTopOf="@id/preview" />
40
41    <Button
42        android:id="@+id/cancel"
43        style="@android:style/Widget.DeviceDefault.Button.Colored"
44        android:layout_width="wrap_content"
45        android:layout_height="48dp"
46        android:text="@android:string/cancel"
47        android:layout_marginStart="6dp"
48        android:layout_marginTop="@dimen/long_screenshot_action_bar_top_margin"
49        android:background="@drawable/overlay_button_outline"
50        android:backgroundTint="?androidprv:attr/materialColorPrimary"
51        android:textColor="?androidprv:attr/materialColorOnSurface"
52        app:layout_constraintStart_toEndOf="@id/save"
53        app:layout_constraintTop_toTopOf="parent"
54        app:layout_constraintBottom_toTopOf="@id/preview"
55    />
56
57    <ImageButton
58        android:id="@+id/share"
59        style="@android:style/Widget.Material.Button.Borderless"
60        android:tint="?androidprv:attr/materialColorOnSurface"
61        android:layout_width="48dp"
62        android:layout_height="48dp"
63        android:layout_marginEnd="8dp"
64        android:layout_marginTop="@dimen/long_screenshot_action_bar_top_margin"
65        android:padding="12dp"
66        android:src="@drawable/ic_screenshot_share"
67        android:scaleType="fitCenter"
68        android:contentDescription="@*android:string/share"
69        android:tooltipText="@*android:string/share"
70        app:layout_constraintEnd_toEndOf="parent"
71        app:layout_constraintTop_toTopOf="parent"
72        app:layout_constraintBottom_toTopOf="@id/preview" />
73
74    <ImageView
75        android:id="@+id/preview"
76        android:layout_width="0px"
77        android:layout_height="0px"
78        android:paddingHorizontal="48dp"
79        android:paddingTop="8dp"
80        android:paddingBottom="42dp"
81        android:alpha="0"
82        app:layout_constrainedHeight="true"
83        app:layout_constrainedWidth="true"
84        app:layout_constraintTop_toBottomOf="@id/save"
85        app:layout_constraintEnd_toEndOf="parent"
86        app:layout_constraintStart_toStartOf="parent"
87        app:layout_constraintBottom_toBottomOf="parent"
88        tools:background="?android:colorBackground"
89        tools:minHeight="100dp"
90        tools:minWidth="100dp" />
91
92    <ImageView
93        android:id="@+id/enter_transition"
94        android:layout_width="wrap_content"
95        android:layout_height="wrap_content"
96        android:scaleType="matrix"
97        android:visibility="invisible"
98        app:layout_constraintTop_toTopOf="@id/preview"
99        app:layout_constraintEnd_toEndOf="parent"
100        app:layout_constraintStart_toStartOf="parent"
101        android:transitionName="screenshot_preview_image"/>
102
103    <com.android.systemui.screenshot.scroll.CropView
104        android:id="@+id/crop_view"
105        android:layout_width="0px"
106        android:layout_height="0px"
107        android:paddingTop="8dp"
108        android:paddingBottom="42dp"
109        android:visibility="gone"
110        app:layout_constrainedHeight="true"
111        app:layout_constrainedWidth="true"
112        app:layout_constraintTop_toTopOf="@id/preview"
113        app:layout_constraintEnd_toEndOf="parent"
114        app:layout_constraintStart_toStartOf="parent"
115        app:layout_constraintBottom_toBottomOf="parent"
116        app:handleThickness="@dimen/screenshot_crop_handle_thickness"
117        app:handleColor="?androidprv:attr/materialColorSecondary"
118        app:scrimColor="?androidprv:attr/materialColorSurfaceContainer"
119        app:scrimAlpha="128"
120        app:containerBackgroundColor="?androidprv:attr/materialColorSurfaceContainer"
121        tools:background="?android:colorBackground"
122        tools:minHeight="100dp"
123        tools:minWidth="100dp" />
124
125    <com.android.systemui.screenshot.scroll.MagnifierView
126        android:id="@+id/magnifier"
127        android:visibility="invisible"
128        android:layout_width="200dp"
129        android:layout_height="200dp"
130        android:elevation="2dp"
131        app:layout_constraintTop_toTopOf="@id/preview"
132        app:layout_constraintLeft_toLeftOf="parent"
133        app:handleThickness="@dimen/screenshot_crop_handle_thickness"
134        app:handleColor="?androidprv:attr/materialColorSecondary"
135        app:scrimColor="?androidprv:attr/materialColorSurfaceContainer"
136        app:scrimAlpha="128"
137        app:borderThickness="4dp"
138        app:borderColor="?androidprv:attr/materialColorSurfaceBright" />
139
140    <ImageButton
141        android:id="@+id/edit"
142        android:layout_width="56dp"
143        android:layout_height="56dp"
144        android:layout_marginBottom="16dp"
145        android:layout_marginEnd="16dp"
146        style="@android:style/Widget.DeviceDefault.Button.Colored"
147        android:background="@drawable/screenshot_edit_background"
148        android:src="@drawable/ic_screenshot_edit"
149        android:contentDescription="@string/screenshot_edit_label"
150        android:tint="?androidprv:attr/materialColorOnSecondaryFixed"
151        android:padding="16dp"
152        android:scaleType="fitCenter"
153        app:layout_constraintBottom_toBottomOf="parent"
154        app:layout_constraintEnd_toEndOf="parent"/>
155
156    <ImageView
157        android:id="@+id/transition"
158        android:layout_width="wrap_content"
159        android:layout_height="wrap_content"
160        app:layout_constraintTop_toTopOf="@id/preview"
161        app:layout_constraintLeft_toLeftOf="parent"
162        android:scaleType="centerCrop"
163        android:visibility="invisible" />
164
165</androidx.constraintlayout.widget.ConstraintLayout>
166