1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3 Copyright 2019 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<androidx.constraintlayout.widget.ConstraintLayout 19 xmlns:android="http://schemas.android.com/apk/res/android" 20 xmlns:app="http://schemas.android.com/apk/res-auto" 21 android:layout_width="wrap_content" 22 android:layout_height="match_parent"> 23 <androidx.constraintlayout.widget.Guideline 24 android:id="@+id/guideline_top" 25 android:layout_width="wrap_content" 26 android:layout_height="wrap_content" 27 android:orientation="horizontal" 28 app:layout_constraintGuide_begin="@dimen/usage_pickers_margin_vertical"/> 29 30 <androidx.constraintlayout.widget.Guideline 31 android:id="@+id/guideline_start" 32 android:layout_width="wrap_content" 33 android:layout_height="wrap_content" 34 android:orientation="vertical" 35 app:layout_constraintGuide_begin="@dimen/usage_bytes_picker_margin_horizontal"/> 36 37 <FrameLayout 38 android:id="@+id/bytes_threshold_container" 39 android:layout_width="wrap_content" 40 android:layout_height="wrap_content" 41 android:layout_marginEnd="@dimen/usage_pickers_text_margin_end" 42 android:focusable="true" 43 android:focusableInTouchMode="true" 44 app:layout_constraintBottom_toTopOf="@+id/guideline_bottom" 45 app:layout_constraintEnd_toStartOf="@+id/bytes_units" 46 app:layout_constraintHorizontal_chainStyle="packed" 47 app:layout_constraintStart_toStartOf="@+id/guideline_start" 48 app:layout_constraintTop_toBottomOf="@+id/guideline_top"> 49 <EditText 50 android:id="@+id/bytes_threshold" 51 android:layout_width="wrap_content" 52 android:layout_height="match_parent" 53 android:ems="@integer/data_usage_bytes_threshold_ems" 54 android:textAlignment="viewStart" 55 android:inputType="numberDecimal" 56 android:minWidth="@dimen/usage_bytes_picker_edit_text_min_width" 57 android:textAppearance="?android:attr/textAppearanceLarge"/> 58 </FrameLayout> 59 60 <FrameLayout 61 android:id="@+id/up_arrow_container" 62 android:layout_width="@dimen/touch_target_size" 63 android:layout_height="@dimen/touch_target_size" 64 android:background="?android:attr/selectableItemBackground" 65 app:layout_constraintEnd_toEndOf="@+id/bytes_units" 66 app:layout_constraintStart_toStartOf="@+id/bytes_units" 67 app:layout_constraintTop_toBottomOf="@+id/guideline_top"> 68 <ImageView 69 android:layout_width="wrap_content" 70 android:layout_height="wrap_content" 71 android:layout_gravity="center" 72 android:src="@drawable/ic_keyboard_arrow_up"/> 73 </FrameLayout> 74 75 <NumberPicker 76 android:id="@+id/bytes_units" 77 android:layout_width="@dimen/touch_target_size" 78 android:layout_height="match_parent" 79 android:theme="@style/NumberPickerStyle" 80 app:layout_constraintBottom_toTopOf="@+id/down_arrow_container" 81 app:layout_constraintEnd_toEndOf="@+id/guideline_end" 82 app:layout_constraintStart_toEndOf="@+id/bytes_threshold_container" 83 app:layout_constraintTop_toBottomOf="@+id/up_arrow_container"/> 84 85 <FrameLayout 86 android:id="@+id/down_arrow_container" 87 android:layout_width="@dimen/touch_target_size" 88 android:layout_height="@dimen/touch_target_size" 89 android:background="?android:attr/selectableItemBackground" 90 app:layout_constraintBottom_toTopOf="@+id/guideline_bottom" 91 app:layout_constraintEnd_toEndOf="@+id/bytes_units" 92 app:layout_constraintStart_toStartOf="@+id/bytes_units"> 93 <ImageView 94 android:layout_width="wrap_content" 95 android:layout_height="wrap_content" 96 android:layout_gravity="center" 97 android:src="@drawable/ic_keyboard_arrow_down"/> 98 </FrameLayout> 99 100 <androidx.constraintlayout.widget.Guideline 101 android:id="@+id/guideline_end" 102 android:layout_width="wrap_content" 103 android:layout_height="wrap_content" 104 android:orientation="vertical" 105 app:layout_constraintGuide_end="@dimen/usage_bytes_picker_margin_horizontal"/> 106 107 <androidx.constraintlayout.widget.Guideline 108 android:id="@+id/guideline_bottom" 109 android:layout_width="wrap_content" 110 android:layout_height="wrap_content" 111 android:orientation="horizontal" 112 app:layout_constraintGuide_end="@dimen/usage_pickers_margin_vertical"/> 113</androidx.constraintlayout.widget.ConstraintLayout> 114