1 <?xml version="1.0" encoding="utf-8"?> 2 <!-- 3 Copyright (C) 2015 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 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 19 xmlns:app="http://schemas.android.com/apk/res-auto" 20 android:layout_width="match_parent" 21 android:layout_height="match_parent" 22 android:orientation="vertical"> 23 24 <android.support.v7.widget.Toolbar 25 android:id="@+id/toolbar" 26 android:layout_height="?attr/actionBarSize" 27 android:layout_width="match_parent" 28 android:background="?attr/colorPrimary" 29 android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 30 app:contentInsetStart="72dp" 31 app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/> 32 33 <android.support.design.widget.TabLayout 34 android:id="@+id/tabs" 35 android:layout_height="wrap_content" 36 android:layout_width="match_parent" 37 android:background="?attr/colorPrimary" 38 android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 39 app:tabMode="scrollable" 40 app:tabContentStart="72dp"/> 41 42 <android.support.v4.view.ViewPager 43 android:id="@+id/tabs_viewpager" 44 android:layout_height="0px" 45 android:layout_width="match_parent" 46 android:layout_weight="1"/> 47 48 <LinearLayout 49 android:id="@+id/buttons" 50 android:layout_width="match_parent" 51 android:layout_height="wrap_content" 52 android:layout_margin="16dp"> 53 54 <Button 55 android:id="@+id/btn_add_tab" 56 android:layout_width="wrap_content" 57 android:layout_height="wrap_content" 58 android:text="@string/add_tab" 59 android:onClick="addTab"/> 60 61 <Button 62 android:id="@+id/btn_remove_tab" 63 android:layout_width="wrap_content" 64 android:layout_height="wrap_content" 65 android:text="@string/remove_tab" 66 android:onClick="removeTab"/> 67 68 <Button 69 android:id="@+id/btn_select_first_tab" 70 android:layout_width="wrap_content" 71 android:layout_height="wrap_content" 72 android:text="@string/select_first_tab" 73 android:onClick="selectFirstTab"/> 74 75 </LinearLayout> 76 77 <RadioGroup 78 android:id="@+id/radiogroup_tab_mode" 79 android:layout_width="match_parent" 80 android:layout_height="wrap_content" 81 android:orientation="horizontal" 82 android:gravity="center_horizontal" 83 android:padding="8dp"> 84 85 <RadioButton 86 android:id="@+id/rb_tab_fixed" 87 android:layout_width="wrap_content" 88 android:layout_height="wrap_content" 89 android:text="@string/tabs_fixed"/> 90 91 <RadioButton 92 android:id="@+id/rb_tab_scrollable" 93 android:layout_width="wrap_content" 94 android:layout_height="wrap_content" 95 android:text="@string/tabs_scrollable"/> 96 </RadioGroup> 97 98 <RadioGroup 99 android:id="@+id/radiogroup_tab_gravity" 100 android:layout_width="match_parent" 101 android:layout_height="wrap_content" 102 android:orientation="horizontal" 103 android:gravity="center_horizontal" 104 android:padding="8dp"> 105 106 <RadioButton 107 android:id="@+id/rb_tab_g_center" 108 android:layout_width="wrap_content" 109 android:layout_height="wrap_content" 110 android:text="@string/tabs_gravity_center"/> 111 112 <RadioButton 113 android:id="@+id/rb_tab_g_fill" 114 android:layout_width="wrap_content" 115 android:layout_height="wrap_content" 116 android:text="@string/tabs_gravity_fill"/> 117 118 </RadioGroup> 119 120 </LinearLayout> 121