1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 ~ Copyright (C) 2017 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<androidx.constraintlayout.widget.ConstraintLayout 18 xmlns:android="http://schemas.android.com/apk/res/android" 19 xmlns:tools="http://schemas.android.com/tools" 20 android:layout_width="match_parent" 21 android:layout_height="match_parent" 22 xmlns:app="http://schemas.android.com/apk/res-auto" 23 tools:context=".MainActivity"> 24 25 <!-- Audio API container --> 26 <LinearLayout 27 android:id="@+id/audioApisContainer" 28 android:layout_width="wrap_content" 29 android:layout_height="wrap_content" 30 app:layout_constraintLeft_toLeftOf="parent" 31 app:layout_constraintTop_toTopOf="parent" 32 android:layout_marginTop="@dimen/activity_vertical_margin" 33 android:orientation="horizontal" 34 > 35 <TextView 36 android:layout_width="wrap_content" 37 android:layout_height="wrap_content" 38 android:text="@string/audio_api" 39 android:layout_marginStart="@dimen/activity_horizontal_margin" 40 android:id="@+id/audioApisTitleText" 41 android:layout_marginLeft="@dimen/activity_horizontal_margin" 42 android:layout_gravity="center_vertical" 43 /> 44 <Spinner 45 android:id="@+id/audioApiSpinner" 46 android:layout_width="wrap_content" 47 android:layout_height="wrap_content" 48 android:layout_marginStart="@dimen/activity_horizontal_margin" 49 android:layout_marginLeft="@dimen/activity_horizontal_margin" 50 android:layout_gravity="center_vertical"/> 51 </LinearLayout> 52 53 <!-- Playback device container --> 54 <LinearLayout 55 android:id="@+id/playbackDevicesContainer" 56 android:layout_width="wrap_content" 57 android:layout_height="wrap_content" 58 android:orientation="horizontal" 59 app:layout_constraintTop_toBottomOf="@id/audioApisContainer" 60 app:layout_constraintLeft_toLeftOf="parent"> 61 <TextView 62 android:layout_width="wrap_content" 63 android:layout_height="wrap_content" 64 android:text="@string/playback_device" 65 android:layout_marginStart="@dimen/activity_horizontal_margin" 66 android:id="@+id/playbackDeviceTitleText" 67 android:layout_marginLeft="@dimen/activity_horizontal_margin" 68 android:layout_gravity="center_vertical"/> 69 70 <com.google.oboe.samples.audio_device.AudioDeviceSpinner 71 android:id="@+id/playbackDevicesSpinner" 72 android:layout_width="wrap_content" 73 android:layout_height="wrap_content" 74 android:layout_marginStart="@dimen/activity_horizontal_margin" 75 android:layout_marginLeft="@dimen/activity_horizontal_margin" 76 android:layout_gravity="center_vertical"/> 77 </LinearLayout> 78 79 <!-- Channel count container --> 80 <LinearLayout 81 android:id="@+id/channelCountContainer" 82 android:layout_width="wrap_content" 83 android:layout_height="wrap_content" 84 android:orientation="horizontal" 85 app:layout_constraintTop_toBottomOf="@id/playbackDevicesContainer" 86 app:layout_constraintLeft_toLeftOf="parent"> 87 <TextView 88 android:id="@+id/channelCountTitleText" 89 android:layout_width="wrap_content" 90 android:layout_height="wrap_content" 91 android:layout_marginLeft="@dimen/activity_horizontal_margin" 92 android:text="Channel count" 93 android:layout_marginStart="@dimen/activity_horizontal_margin" 94 android:layout_gravity="center_vertical"/> 95 <Spinner 96 android:id="@+id/channelCountSpinner" 97 android:layout_width="wrap_content" 98 android:layout_height="wrap_content" 99 android:layout_marginLeft="@dimen/activity_horizontal_margin" 100 android:layout_marginStart="@dimen/activity_horizontal_margin" 101 android:layout_gravity="center_vertical"/> 102 </LinearLayout> 103 104 <!-- Buffer size container --> 105 <LinearLayout 106 android:id="@+id/bufferSizeContainer" 107 android:layout_width="wrap_content" 108 android:layout_height="wrap_content" 109 android:orientation="horizontal" 110 app:layout_constraintTop_toBottomOf="@id/channelCountContainer" 111 app:layout_constraintLeft_toLeftOf="parent"> 112 <TextView 113 android:id="@+id/bufferSizeTitleText" 114 android:layout_width="wrap_content" 115 android:layout_height="wrap_content" 116 android:layout_marginLeft="@dimen/activity_horizontal_margin" 117 android:text="@string/buffer_size_title" 118 android:layout_marginStart="@dimen/activity_horizontal_margin" 119 android:layout_gravity="center_vertical"/> 120 121 <Spinner 122 android:id="@+id/bufferSizeSpinner" 123 android:layout_width="wrap_content" 124 android:layout_height="wrap_content" 125 android:layout_marginLeft="@dimen/activity_horizontal_margin" 126 android:layout_marginStart="@dimen/activity_horizontal_margin" 127 android:layout_gravity="center_vertical"/> 128 </LinearLayout> 129 130 <!-- Audio stream latency --> 131 <TextView 132 android:id="@+id/latencyText" 133 android:layout_width="wrap_content" 134 android:layout_height="wrap_content" 135 android:layout_marginLeft="@dimen/activity_horizontal_margin" 136 android:layout_marginTop="12dp" 137 android:text="@string/latency" 138 app:layout_constraintLeft_toLeftOf="parent" 139 app:layout_constraintTop_toBottomOf="@+id/bufferSizeContainer" 140 android:layout_marginStart="@dimen/activity_horizontal_margin" /> 141 142 <!-- User instructions --> 143 <TextView 144 android:id="@+id/userInstructionView" 145 android:layout_width="wrap_content" 146 android:layout_height="wrap_content" 147 android:layout_marginLeft="@dimen/activity_horizontal_margin" 148 android:layout_marginTop="20dp" 149 android:lines="3" 150 android:text="@string/init_status" 151 app:layout_constraintLeft_toLeftOf="parent" 152 app:layout_constraintTop_toBottomOf="@+id/latencyText" 153 android:layout_marginStart="@dimen/activity_horizontal_margin" /> 154</androidx.constraintlayout.widget.ConstraintLayout> 155