1<!--
2  ~ Copyright (C) 2019 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<merge xmlns:android="http://schemas.android.com/apk/res/android"
17    xmlns:tools="http://schemas.android.com/tools"
18    tools:orientation="vertical"
19    tools:parentTag="android.widget.LinearLayout">
20
21    <LinearLayout
22        android:layout_width="match_parent"
23        android:layout_height="@dimen/controls_header_menu_size"
24        android:paddingHorizontal="@dimen/controls_header_horizontal_padding"
25        android:layout_marginBottom="@dimen/controls_header_bottom_margin"
26        android:orientation="horizontal">
27
28        <!-- make sure the header stays centered in the layout by adding a spacer -->
29        <Space
30            android:id="@+id/controls_spacer"
31            android:layout_width="@dimen/controls_header_menu_button_size"
32            android:layout_height="1dp"
33            android:visibility="gone" />
34
35        <ImageView
36            android:id="@+id/controls_close"
37            android:layout_width="@dimen/controls_header_menu_button_size"
38            android:layout_height="@dimen/controls_header_menu_button_size"
39            android:layout_gravity="center_vertical"
40            android:background="?android:attr/selectableItemBackgroundBorderless"
41            android:contentDescription="@string/accessibility_desc_close"
42            android:padding="12dp"
43            android:src="@drawable/ic_close"
44            android:tint="@color/control_primary_text"
45            android:visibility="gone"
46            tools:visibility="visible" />
47
48        <!-- need to keep this outer view in order to have a correctly sized anchor
49             for the dropdown menu, as well as dropdown background in the right place -->
50        <LinearLayout
51            android:id="@+id/controls_header"
52            android:layout_width="0dp"
53            android:layout_height="match_parent"
54            android:layout_weight="1"
55            android:gravity="center"
56            android:orientation="horizontal">
57
58            <TextView
59                android:id="@+id/app_or_structure_spinner"
60                style="@style/Control.Spinner.Header"
61                android:layout_width="wrap_content"
62                android:layout_height="wrap_content"
63                android:layout_gravity="center"
64                android:clickable="false"
65                tools:text="@tools:sample/lorem" />
66        </LinearLayout>
67
68        <ImageView
69            android:id="@+id/controls_more"
70            android:layout_width="@dimen/controls_header_menu_button_size"
71            android:layout_height="@dimen/controls_header_menu_button_size"
72            android:layout_gravity="center_vertical"
73            android:background="?android:attr/selectableItemBackgroundBorderless"
74            android:contentDescription="@string/accessibility_menu"
75            android:padding="12dp"
76            android:src="@drawable/ic_more_vert"
77            android:tint="@color/control_more_vert" />
78    </LinearLayout>
79
80    <ScrollView
81        android:id="@+id/controls_scroll_view"
82        android:layout_width="match_parent"
83        android:layout_height="0dp"
84        android:layout_marginHorizontal="@dimen/controls_content_margin_horizontal"
85        android:layout_weight="1"
86        android:clipChildren="true"
87        android:orientation="vertical"
88        android:padding="@dimen/controls_content_padding"
89        android:background="@drawable/controls_panel_background"
90        android:scrollbars="none">
91
92        <include layout="@layout/controls_list_view" />
93
94    </ScrollView>
95
96    <FrameLayout
97        android:id="@+id/controls_panel"
98        android:layout_width="match_parent"
99        android:layout_height="0dp"
100        android:layout_marginHorizontal="@dimen/controls_content_margin_horizontal"
101        android:layout_weight="1"
102        android:background="@drawable/controls_panel_background"
103        android:visibility="gone"
104        tools:visibility="visible" />
105</merge>
106