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 <Button 31 android:id="@+id/enter_pip" 32 android:layout_width="wrap_content" 33 android:layout_height="wrap_content" 34 android:text="Enter PIP" 35 android:onClick="enterPip"/> 36 37 <CheckBox 38 android:id="@+id/with_custom_actions" 39 android:layout_width="wrap_content" 40 android:layout_height="wrap_content" 41 android:text="With custom actions"/> 42 43 <RadioGroup 44 android:layout_width="match_parent" 45 android:layout_height="wrap_content" 46 android:orientation="vertical" 47 android:checkedButton="@id/enter_pip_on_leave_disabled"> 48 49 <TextView 50 android:layout_width="wrap_content" 51 android:layout_height="wrap_content" 52 android:text="Enter PiP on home press"/> 53 54 <RadioButton 55 android:id="@+id/enter_pip_on_leave_disabled" 56 android:layout_width="wrap_content" 57 android:layout_height="wrap_content" 58 android:text="Disabled" 59 android:onClick="onAutoPipSelected"/> 60 61 <RadioButton 62 android:id="@+id/enter_pip_on_leave_manual" 63 android:layout_width="wrap_content" 64 android:layout_height="wrap_content" 65 android:text="Via code behind" 66 android:onClick="onAutoPipSelected"/> 67 68 <RadioButton 69 android:id="@+id/enter_pip_on_leave_autoenter" 70 android:layout_width="wrap_content" 71 android:layout_height="wrap_content" 72 android:text="Auto-enter PiP" 73 android:onClick="onAutoPipSelected"/> 74 </RadioGroup> 75 76 <RadioGroup 77 android:layout_width="match_parent" 78 android:layout_height="wrap_content" 79 android:orientation="vertical" 80 android:checkedButton="@id/ratio_default"> 81 82 <TextView 83 android:layout_width="wrap_content" 84 android:layout_height="wrap_content" 85 android:text="Ratio"/> 86 87 <RadioButton 88 android:id="@+id/ratio_default" 89 android:layout_width="wrap_content" 90 android:layout_height="wrap_content" 91 android:text="Default" 92 android:onClick="onRatioSelected"/> 93 94 <RadioButton 95 android:id="@+id/ratio_square" 96 android:layout_width="wrap_content" 97 android:layout_height="wrap_content" 98 android:text="Square [1:1]" 99 android:onClick="onRatioSelected"/> 100 101 <RadioButton 102 android:id="@+id/ratio_wide" 103 android:layout_width="wrap_content" 104 android:layout_height="wrap_content" 105 android:text="Wide [2:1]" 106 android:onClick="onRatioSelected"/> 107 108 <RadioButton 109 android:id="@+id/ratio_tall" 110 android:layout_width="wrap_content" 111 android:layout_height="wrap_content" 112 android:text="Tall [1:2]" 113 android:onClick="onRatioSelected"/> 114 </RadioGroup> 115 116 <TextView 117 android:layout_width="wrap_content" 118 android:layout_height="wrap_content" 119 android:text="Media Session"/> 120 121 <LinearLayout 122 android:layout_width="wrap_content" 123 android:layout_height="wrap_content"> 124 125 <Button 126 android:id="@+id/media_session_start" 127 android:layout_width="wrap_content" 128 android:layout_height="wrap_content" 129 android:nextFocusDown="@id/media_session_stop" 130 android:text="Start"/> 131 132 <Button 133 android:id="@+id/media_session_stop" 134 android:layout_width="wrap_content" 135 android:layout_height="wrap_content" 136 android:nextFocusDown="@id/enter_pip" 137 android:text="Stop"/> 138 139 </LinearLayout> 140 141</LinearLayout> 142