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:src="@drawable/ic_volume_ringer_vibrate" 71 android:tint="?android:attr/textColorPrimary" /> 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:accessibilityTraversalAfter="@id/volume_drawer_vibrate" 80 android:contentDescription="@string/volume_ringer_hint_mute" 81 android:gravity="center"> 82 83 <ImageView 84 android:id="@+id/volume_drawer_mute_icon" 85 android:layout_width="@dimen/volume_ringer_drawer_icon_size" 86 android:layout_height="@dimen/volume_ringer_drawer_icon_size" 87 android:layout_gravity="center" 88 android:src="@drawable/ic_speaker_mute" 89 android:tint="?android:attr/textColorPrimary" /> 90 91 </FrameLayout> 92 93 <FrameLayout 94 android:id="@+id/volume_drawer_normal" 95 android:layout_width="@dimen/volume_ringer_drawer_item_size" 96 android:layout_height="@dimen/volume_ringer_drawer_item_size" 97 android:accessibilityTraversalAfter="@id/volume_drawer_mute" 98 android:contentDescription="@string/volume_ringer_hint_unmute" 99 android:gravity="center"> 100 101 <ImageView 102 android:id="@+id/volume_drawer_normal_icon" 103 android:layout_width="@dimen/volume_ringer_drawer_icon_size" 104 android:layout_height="@dimen/volume_ringer_drawer_icon_size" 105 android:layout_gravity="center" 106 android:src="@drawable/ic_speaker_on" 107 android:tint="?android:attr/textColorPrimary" /> 108 109 </FrameLayout> 110 111 </LinearLayout> 112 113 </FrameLayout> 114 115 <!-- The current ringer selection. When the drawer is opened, this animates to the corresponding 116 position in the drawer. When the drawer is closed, it animates back. --> 117 <FrameLayout 118 android:id="@+id/volume_new_ringer_active_icon_container" 119 android:layout_width="@dimen/volume_ringer_drawer_item_size" 120 android:layout_height="@dimen/volume_ringer_drawer_item_size" 121 android:layout_gravity="bottom|right" 122 android:contentDescription="@string/volume_ringer_change" 123 android:background="@drawable/volume_drawer_selection_bg"> 124 125 <ImageView 126 android:id="@+id/volume_new_ringer_active_icon" 127 android:layout_width="@dimen/volume_ringer_drawer_icon_size" 128 android:layout_height="@dimen/volume_ringer_drawer_icon_size" 129 android:layout_gravity="center" 130 android:tint="?android:attr/textColorPrimaryInverse" 131 android:src="@drawable/ic_volume_media" /> 132 133 </FrameLayout> 134 135</FrameLayout>