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