1<!-- 2 ~ Copyright (C) 2020 The Android Open Source Project 3 ~ 4 ~ Licensed under the Apache License, Version 2.0 (the "License"); 5 ~ you may not use this file except in compliance with the License. 6 ~ You may obtain a copy of the License at 7 ~ 8 ~ http://www.apache.org/licenses/LICENSE-2.0 9 ~ 10 ~ Unless required by applicable law or agreed to in writing, software 11 ~ distributed under the License is distributed on an "AS IS" BASIS, 12 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 ~ See the License for the specific language governing permissions and 14 ~ limitations under the License. 15 --> 16<LinearLayout 17 xmlns:android="http://schemas.android.com/apk/res/android" 18 android:layout_width="match_parent" 19 android:layout_height="match_parent" 20 android:orientation="horizontal"> 21 <!-- Split the screen in half horizontally. --> 22 23 <!-- Two time pickers formatted differently. --> 24 <LinearLayout 25 android:layout_width="0dp" 26 android:layout_height="match_parent" 27 android:orientation="vertical" 28 android:layout_weight="1"> 29 <!-- Put each TimePicker into a separate FocusArea. A TimePicker has several focusable views 30 and it's difficult to move to another TimePicker via rotation. Let's wrap each TimePicker 31 with a FocusArea so that we can use nudge to move to another TimePicker. --> 32 <com.android.car.ui.FocusArea 33 android:layout_width="wrap_content" 34 android:layout_height="wrap_content"> 35 <TimePicker 36 android:id="@+id/spinner_time_picker" 37 android:layout_width="wrap_content" 38 android:layout_height="wrap_content" 39 android:focusable="true" 40 android:timePickerMode="spinner"> 41 </TimePicker> 42 </com.android.car.ui.FocusArea> 43 <com.android.car.ui.FocusArea 44 android:layout_width="wrap_content" 45 android:layout_height="0dp" 46 android:layout_weight="1"> 47 <TimePicker 48 android:id="@+id/clock_time_picker" 49 android:layout_width="wrap_content" 50 android:layout_height="wrap_content" 51 android:focusable="true" 52 android:timePickerMode="clock"> 53 </TimePicker> 54 </com.android.car.ui.FocusArea> 55 </LinearLayout> 56 57 <!-- A seek bar, a radial time picker, and a custom DirectManipulationView. --> 58 <com.android.car.ui.FocusArea 59 android:layout_width="0dp" 60 android:layout_height="match_parent" 61 android:orientation="vertical" 62 android:layout_weight="1"> 63 <SeekBar 64 android:id="@+id/seek_bar" 65 android:layout_width="match_parent" 66 android:layout_height="wrap_content" 67 android:background="@drawable/seek_bar_background"> 68 </SeekBar> 69 <RadialTimePickerView 70 android:id="@+id/radial_time_picker" 71 android:layout_width="match_parent" 72 android:layout_height="0dp" 73 android:layout_weight="1" 74 android:focusable="true"> 75 </RadialTimePickerView> 76 <com.android.car.rotaryplayground.DirectManipulationView 77 android:id="@+id/direct_manipulation_view" 78 android:layout_width="match_parent" 79 android:layout_height="0dp" 80 android:layout_weight="1"> 81 </com.android.car.rotaryplayground.DirectManipulationView> 82 </com.android.car.ui.FocusArea> 83</LinearLayout> 84