1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 ~ Copyright (C) 2022 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<LinearLayout 18 xmlns:android="http://schemas.android.com/apk/res/android" 19 android:layout_width="match_parent" 20 android:layout_height="match_parent" 21 android:orientation="vertical" 22 android:background="@android:color/holo_blue_bright"> 23 24 <!-- All the buttons (and other clickable elements) should be arranged in a way so that it is 25 possible to "cycle" over all them by clicking on the D-Pad DOWN button. The way we do it 26 here is by arranging them this vertical LL and by relying on the nextFocusDown attribute 27 where things are arranged differently and to circle back up to the top once we reach the 28 bottom. --> 29 30 <!-- View used for testing sourceRectHint. --> 31 <View 32 android:id="@+id/source_rect" 33 android:layout_width="320dp" 34 android:layout_height="180dp" 35 android:visibility="gone" 36 android:background="@android:color/holo_green_light" 37 /> 38 39 <Button 40 android:id="@+id/enter_pip" 41 android:layout_width="wrap_content" 42 android:layout_height="wrap_content" 43 android:text="Enter PIP" 44 android:onClick="enterPip"/> 45 46 <CheckBox 47 android:id="@+id/with_custom_actions" 48 android:layout_width="wrap_content" 49 android:layout_height="wrap_content" 50 android:text="With custom actions"/> 51 52 <RadioGroup 53 android:layout_width="match_parent" 54 android:layout_height="wrap_content" 55 android:orientation="vertical" 56 android:checkedButton="@id/enter_pip_on_leave_disabled"> 57 58 <TextView 59 android:layout_width="wrap_content" 60 android:layout_height="wrap_content" 61 android:text="Enter PiP on home press"/> 62 63 <RadioButton 64 android:id="@+id/enter_pip_on_leave_disabled" 65 android:layout_width="wrap_content" 66 android:layout_height="wrap_content" 67 android:text="Disabled" 68 android:onClick="onAutoPipSelected"/> 69 70 <RadioButton 71 android:id="@+id/enter_pip_on_leave_manual" 72 android:layout_width="wrap_content" 73 android:layout_height="wrap_content" 74 android:text="Via code behind" 75 android:onClick="onAutoPipSelected"/> 76 77 <RadioButton 78 android:id="@+id/enter_pip_on_leave_autoenter" 79 android:layout_width="wrap_content" 80 android:layout_height="wrap_content" 81 android:text="Auto-enter PiP" 82 android:onClick="onAutoPipSelected"/> 83 </RadioGroup> 84 85 <RadioGroup 86 android:layout_width="match_parent" 87 android:layout_height="wrap_content" 88 android:orientation="vertical" 89 android:checkedButton="@id/ratio_default"> 90 91 <TextView 92 android:layout_width="wrap_content" 93 android:layout_height="wrap_content" 94 android:text="Ratio"/> 95 96 <RadioButton 97 android:id="@+id/ratio_default" 98 android:layout_width="wrap_content" 99 android:layout_height="wrap_content" 100 android:text="Default" 101 android:onClick="onRatioSelected"/> 102 103 <RadioButton 104 android:id="@+id/ratio_square" 105 android:layout_width="wrap_content" 106 android:layout_height="wrap_content" 107 android:text="Square [1:1]" 108 android:onClick="onRatioSelected"/> 109 110 <RadioButton 111 android:id="@+id/ratio_wide" 112 android:layout_width="wrap_content" 113 android:layout_height="wrap_content" 114 android:text="Wide [2:1]" 115 android:onClick="onRatioSelected"/> 116 117 <RadioButton 118 android:id="@+id/ratio_tall" 119 android:layout_width="wrap_content" 120 android:layout_height="wrap_content" 121 android:text="Tall [1:2]" 122 android:onClick="onRatioSelected"/> 123 </RadioGroup> 124 125 <Button 126 android:id="@+id/set_source_rect_hint" 127 android:layout_width="wrap_content" 128 android:layout_height="wrap_content" 129 android:text="Set SourceRectHint" 130 android:onClick="setSourceRectHint"/> 131 132 <TextView 133 android:layout_width="wrap_content" 134 android:layout_height="wrap_content" 135 android:text="Media Session"/> 136 137 <LinearLayout 138 android:layout_width="wrap_content" 139 android:layout_height="wrap_content"> 140 141 <Button 142 android:id="@+id/media_session_start" 143 android:layout_width="wrap_content" 144 android:layout_height="wrap_content" 145 android:nextFocusDown="@id/media_session_stop" 146 android:text="Start"/> 147 148 <Button 149 android:id="@+id/media_session_stop" 150 android:layout_width="wrap_content" 151 android:layout_height="wrap_content" 152 android:nextFocusDown="@id/enter_pip" 153 android:text="Stop"/> 154 155 </LinearLayout> 156 157</LinearLayout> 158