1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 ~ Copyright (C) 2018 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<!-- 19 Demonstrates Picture-In-Picture with various configurations. 20 - Enter PiP with on-screen button 21 - Enter PiP by swiping up to home or tap on home button 22 - Toggle the auto enter PiP flag on and off 23 - Toggle the source rect hint on and off 24 - Toggle the seamless resize flag on and off 25 - Change the position of current and next source rect hint 26 - Tablet layout on foldables 27 - Enter content PiP 28 --> 29<LinearLayout 30 xmlns:android="http://schemas.android.com/apk/res/android" 31 xmlns:app="http://schemas.android.com/apk/res-auto" 32 android:id="@+id/container" 33 android:layout_width="match_parent" 34 android:layout_height="match_parent" 35 android:orientation="vertical"> 36 37 <!-- layout params would be changed programmatically --> 38 <include layout="@layout/picture_in_picture_content" /> 39 40 <ScrollView 41 android:id="@+id/control_group" 42 android:layout_width="match_parent" 43 android:layout_height="0dp" 44 android:layout_weight="1"> 45 46 <LinearLayout 47 android:layout_width="match_parent" 48 android:layout_height="match_parent" 49 android:orientation="vertical"> 50 51 <Switch 52 android:id="@+id/auto_pip_toggle" 53 android:layout_width="match_parent" 54 android:layout_height="wrap_content" 55 android:padding="8dp" 56 android:text="@string/activity_picture_in_picture_auto_pip_toggle" /> 57 58 <Switch 59 android:id="@+id/source_rect_hint_toggle" 60 android:layout_width="match_parent" 61 android:layout_height="wrap_content" 62 android:padding="8dp" 63 android:text="@string/activity_picture_in_picture_source_rect_hint_toggle" /> 64 65 <Switch 66 android:id="@+id/seamless_resize_toggle" 67 android:layout_width="match_parent" 68 android:layout_height="wrap_content" 69 android:padding="8dp" 70 android:text="@string/activity_picture_in_picture_seamless_resize_toggle" /> 71 72 <Switch 73 android:id="@+id/enter_pip_on_back" 74 android:layout_width="match_parent" 75 android:layout_height="wrap_content" 76 android:padding="8dp" 77 android:text="@string/activity_picture_in_picture_enter_pip_on_back_toggle" /> 78 79 <RadioGroup 80 android:id="@+id/current_position" 81 android:layout_width="match_parent" 82 android:layout_height="wrap_content" 83 android:orientation="horizontal" 84 android:padding="8dp"> 85 86 <TextView 87 android:layout_width="wrap_content" 88 android:layout_height="wrap_content" 89 android:text="@string/label_current_position" /> 90 91 <RadioButton 92 android:id="@+id/radio_current_start" 93 android:layout_width="wrap_content" 94 android:layout_height="wrap_content" 95 android:text="@string/label_position_start" /> 96 97 <RadioButton 98 android:id="@+id/radio_current_end" 99 android:layout_width="wrap_content" 100 android:layout_height="wrap_content" 101 android:text="@string/label_position_end" /> 102 103 </RadioGroup> 104 105 <LinearLayout 106 android:layout_width="match_parent" 107 android:layout_height="wrap_content" 108 android:padding="8dp" 109 android:orientation="horizontal"> 110 111 <TextView 112 android:layout_width="wrap_content" 113 android:layout_height="wrap_content" 114 android:text="@string/label_aspect_ratio" /> 115 116 <Spinner 117 android:id="@+id/aspect_ratio" 118 android:layout_width="0dp" 119 android:layout_height="wrap_content" 120 android:layout_weight="1" /> 121 </LinearLayout> 122 123 <Button 124 android:id="@+id/enter_pip_button" 125 android:layout_width="wrap_content" 126 android:layout_height="wrap_content" 127 android:text="@string/enter_picture_in_picture" /> 128 129 <Button 130 android:id="@+id/enter_content_pip_button" 131 android:layout_width="wrap_content" 132 android:layout_height="wrap_content" 133 android:text="@string/enter_content_pip" /> 134 135 </LinearLayout> 136 137 </ScrollView> 138 139</LinearLayout> 140