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 18<!-- Contains the active ringer icon and a hidden drawer containing all three ringer options. --> 19<FrameLayout 20 xmlns:android="http://schemas.android.com/apk/res/android" 21 android:id="@+id/volume_ringer_and_drawer_container" 22 android:layout_width="wrap_content" 23 android:layout_height="wrap_content" 24 android:gravity="center" 25 android:paddingLeft="@dimen/volume_dialog_ringer_rows_padding" 26 android:paddingTop="@dimen/volume_dialog_ringer_rows_padding" 27 android:paddingRight="@dimen/volume_dialog_ringer_rows_padding" 28 android:paddingBottom="@dimen/volume_dialog_ringer_rows_padding" 29 android:background="@drawable/volume_background_top" 30 android:layoutDirection="ltr" 31 android:clipToPadding="false" 32 android:clipChildren="false"> 33 34 <!-- Drawer view, invisible by default. --> 35 <FrameLayout 36 android:id="@+id/volume_drawer_container" 37 android:alpha="0.0" 38 android:layout_width="match_parent" 39 android:layout_height="wrap_content" 40 android:background="@drawable/volume_drawer_bg" 41 android:orientation="vertical"> 42 43 <!-- View that is animated to a tapped ringer selection, so it appears selected. --> 44 <FrameLayout 45 android:id="@+id/volume_drawer_selection_background" 46 android:alpha="0.0" 47 android:layout_width="@dimen/volume_ringer_drawer_item_size" 48 android:layout_height="@dimen/volume_ringer_drawer_item_size" 49 android:layout_gravity="bottom|right" 50 android:background="@drawable/volume_drawer_selection_bg" /> 51 52 <LinearLayout 53 android:id="@+id/volume_drawer_options" 54 android:layout_width="match_parent" 55 android:layout_height="wrap_content" 56 android:orientation="vertical"> 57 58 <FrameLayout 59 android:id="@+id/volume_drawer_vibrate" 60 android:layout_width="@dimen/volume_ringer_drawer_item_size" 61 android:layout_height="@dimen/volume_ringer_drawer_item_size" 62 android:contentDescription="@string/volume_ringer_hint_vibrate" 63 android:gravity="center"> 64 65 <ImageView 66 android:id="@+id/volume_drawer_vibrate_icon" 67 android:layout_width="@dimen/volume_ringer_drawer_icon_size" 68 android:layout_height="@dimen/volume_ringer_drawer_icon_size" 69 android:layout_gravity="center" 70 android:tint="?android:attr/textColorPrimary" 71 android:src="@drawable/ic_volume_ringer_vibrate" /> 72 73 </FrameLayout> 74 75 <FrameLayout 76 android:id="@+id/volume_drawer_mute" 77 android:layout_width="@dimen/volume_ringer_drawer_item_size" 78 android:layout_height="@dimen/volume_ringer_drawer_item_size" 79 android:contentDescription="@string/volume_ringer_hint_mute" 80 android:gravity="center"> 81 82 <ImageView 83 android:id="@+id/volume_drawer_mute_icon" 84 android:layout_width="@dimen/volume_ringer_drawer_icon_size" 85 android:layout_height="@dimen/volume_ringer_drawer_icon_size" 86 android:layout_gravity="center" 87 android:tint="?android:attr/textColorPrimary" 88 android:src="@drawable/ic_speaker_mute" /> 89 90 </FrameLayout> 91 92 <FrameLayout 93 android:id="@+id/volume_drawer_normal" 94 android:layout_width="@dimen/volume_ringer_drawer_item_size" 95 android:layout_height="@dimen/volume_ringer_drawer_item_size" 96 android:contentDescription="@string/volume_ringer_hint_unmute" 97 android:gravity="center"> 98 99 <ImageView 100 android:id="@+id/volume_drawer_normal_icon" 101 android:layout_width="@dimen/volume_ringer_drawer_icon_size" 102 android:layout_height="@dimen/volume_ringer_drawer_icon_size" 103 android:layout_gravity="center" 104 android:tint="?android:attr/textColorPrimary" 105 android:src="@drawable/ic_speaker_on" /> 106 107 </FrameLayout> 108 109 </LinearLayout> 110 111 </FrameLayout> 112 113 <!-- The current ringer selection. When the drawer is opened, this animates to the corresponding 114 position in the drawer. When the drawer is closed, it animates back. --> 115 <FrameLayout 116 android:id="@+id/volume_new_ringer_active_icon_container" 117 android:layout_width="@dimen/volume_ringer_drawer_item_size" 118 android:layout_height="@dimen/volume_ringer_drawer_item_size" 119 android:layout_gravity="bottom|right" 120 android:contentDescription="@string/volume_ringer_change" 121 android:background="@drawable/volume_drawer_selection_bg"> 122 123 <ImageView 124 android:id="@+id/volume_new_ringer_active_icon" 125 android:layout_width="@dimen/volume_ringer_drawer_icon_size" 126 android:layout_height="@dimen/volume_ringer_drawer_icon_size" 127 android:layout_gravity="center" 128 android:tint="?android:attr/textColorPrimaryInverse" 129 android:src="@drawable/ic_volume_media" /> 130 131 </FrameLayout> 132 133</FrameLayout>