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<FrameLayout
17    xmlns:android="http://schemas.android.com/apk/res/android"
18    xmlns:sysui="http://schemas.android.com/apk/res-auto"
19    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
20    android:id="@+id/volume_dialog_container"
21    android:layout_width="wrap_content"
22    android:layout_height="wrap_content"
23    android:gravity="right"
24    android:layout_gravity="right"
25    android:background="@android:color/transparent"
26    android:theme="@style/volume_dialog_theme">
27
28    <!-- right-aligned to be physically near volume button -->
29    <LinearLayout
30        android:id="@+id/volume_dialog"
31        android:layout_width="wrap_content"
32        android:layout_height="wrap_content"
33        android:gravity="right"
34        android:layout_gravity="right"
35        android:layout_marginRight="@dimen/volume_dialog_panel_transparent_padding_right"
36        android:orientation="vertical"
37        android:clipToPadding="false"
38        android:clipChildren="false">
39
40
41        <LinearLayout
42            android:id="@+id/volume_dialog_top_container"
43            android:layout_width="wrap_content"
44            android:layout_height="wrap_content"
45            android:orientation="vertical"
46            android:clipChildren="false"
47            android:gravity="right">
48
49            <include layout="@layout/volume_ringer_drawer" />
50
51            <FrameLayout
52                android:visibility="gone"
53                android:id="@+id/ringer"
54                android:layout_width="@dimen/volume_dialog_ringer_size"
55                android:layout_height="@dimen/volume_dialog_ringer_size"
56                android:layout_marginBottom="@dimen/volume_dialog_spacer"
57                android:gravity="right"
58                android:layout_gravity="right"
59                android:translationZ="@dimen/volume_dialog_elevation"
60                android:clipToPadding="false"
61                android:background="@drawable/rounded_bg_full">
62                <com.android.keyguard.AlphaOptimizedImageButton
63                    android:id="@+id/ringer_icon"
64                    style="@style/VolumeButtons"
65                    android:background="@drawable/rounded_ripple"
66                    android:layout_width="match_parent"
67                    android:layout_height="match_parent"
68                    android:scaleType="fitCenter"
69                    android:padding="@dimen/volume_dialog_ringer_icon_padding"
70                    android:tint="?android:attr/textColorPrimary"
71                    android:layout_gravity="center"
72                    android:soundEffectsEnabled="false" />
73
74                <include layout="@layout/volume_dnd_icon"
75                    android:layout_width="match_parent"
76                    android:layout_height="wrap_content"
77                    android:layout_marginRight="@dimen/volume_dialog_stream_padding"
78                    android:layout_marginTop="6dp"/>
79            </FrameLayout>
80
81            <LinearLayout
82                android:id="@+id/volume_dialog_rows_container"
83                android:layout_width="wrap_content"
84                android:layout_height="wrap_content"
85                android:gravity="right"
86                android:layout_gravity="right"
87                android:orientation="vertical"
88                android:clipChildren="false"
89                android:clipToPadding="false" >
90                <LinearLayout
91                    android:id="@+id/volume_dialog_rows"
92                    android:layout_width="wrap_content"
93                    android:layout_height="wrap_content"
94                    android:gravity="center"
95                    android:orientation="horizontal">
96                    <!-- volume rows added and removed here! :-) -->
97                </LinearLayout>
98                <FrameLayout
99                    android:id="@+id/settings_container"
100                    android:layout_width="wrap_content"
101                    android:layout_height="wrap_content"
102                    android:background="@drawable/volume_background_bottom"
103                    android:paddingLeft="@dimen/volume_dialog_ringer_rows_padding"
104                    android:paddingBottom="@dimen/volume_dialog_ringer_rows_padding"
105                    android:paddingRight="@dimen/volume_dialog_ringer_rows_padding">
106                    <com.android.keyguard.AlphaOptimizedImageButton
107                        android:id="@+id/settings"
108                        android:src="@drawable/horizontal_ellipsis"
109                        android:layout_width="@dimen/volume_dialog_tap_target_size"
110                        android:layout_height="@dimen/volume_dialog_tap_target_size"
111                        android:layout_gravity="center"
112                        android:contentDescription="@string/accessibility_volume_settings"
113                        android:background="@drawable/ripple_drawable_20dp"
114                        android:tint="?androidprv:attr/colorAccent"
115                        android:soundEffectsEnabled="false" />
116                </FrameLayout>
117            </LinearLayout>
118
119        </LinearLayout>
120
121        <FrameLayout
122            android:id="@+id/odi_captions"
123            android:layout_width="@dimen/volume_dialog_caption_size"
124            android:layout_height="@dimen/volume_dialog_caption_size"
125            android:layout_marginTop="@dimen/volume_dialog_row_margin_bottom"
126            android:gravity="right"
127            android:layout_gravity="right"
128            android:clipToPadding="false"
129            android:clipToOutline="true"
130            android:background="@drawable/volume_row_rounded_background">
131            <com.android.systemui.volume.CaptionsToggleImageButton
132                android:id="@+id/odi_captions_icon"
133                android:src="@drawable/ic_volume_odi_captions_disabled"
134                style="@style/VolumeButtons"
135                android:layout_width="match_parent"
136                android:layout_height="match_parent"
137                android:tint="?android:attr/colorAccent"
138                android:layout_gravity="center"
139                android:soundEffectsEnabled="false" />
140        </FrameLayout>
141    </LinearLayout>
142
143    <ViewStub
144        android:id="@+id/odi_captions_tooltip_stub"
145        android:inflatedId="@+id/odi_captions_tooltip_view"
146        android:layout="@layout/volume_tool_tip_view"
147        android:layout_width="wrap_content"
148        android:layout_height="wrap_content"
149        android:layout_gravity="bottom | right"
150        android:layout_marginRight="@dimen/volume_tool_tip_right_margin"/>
151
152</FrameLayout>