app/src/main/res/layout/activity_main.xml (2697 bytes)
1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:id="@+id/root" 4 android:layout_width="match_parent" 5 android:layout_height="match_parent" 6 android:orientation="vertical"> 7 8 <Toolbar 9 android:id="@+id/toolbar" 10 android:layout_width="match_parent" 11 android:layout_height="wrap_content" 12 android:background="?android:attr/colorPrimary" 13 android:minHeight="?android:attr/actionBarSize" 14 android:theme="@android:style/ThemeOverlay.Material.Dark.ActionBar" 15 android:title="@string/app_name" /> 16 17 <EditText 18 android:id="@+id/search" 19 android:layout_width="match_parent" 20 android:layout_height="wrap_content" 21 android:layout_margin="8dp" 22 android:hint="@string/search_hint" 23 android:imeOptions="actionGo" 24 android:importantForAutofill="no" 25 android:inputType="text|textNoSuggestions" 26 android:singleLine="true" /> 27 28 <!-- The live preview: the page of the first match, or of the bookmark 29 that the user picks with Preview. It shows only during a search. 30 MainActivity adds the web view under the caption when it is first 31 necessary, so that the app starts fast. --> 32 <LinearLayout 33 android:id="@+id/preview" 34 android:layout_width="match_parent" 35 android:layout_height="0dp" 36 android:layout_weight="1" 37 android:orientation="vertical" 38 android:visibility="gone"> 39 40 <TextView 41 android:id="@+id/caption" 42 android:layout_width="match_parent" 43 android:layout_height="wrap_content" 44 android:background="?android:attr/selectableItemBackground" 45 android:ellipsize="middle" 46 android:paddingHorizontal="16dp" 47 android:paddingVertical="6dp" 48 android:singleLine="true" 49 android:textAppearance="?android:attr/textAppearanceSmall" 50 android:textColor="?android:attr/textColorSecondary" /> 51 </LinearLayout> 52 53 <FrameLayout 54 android:layout_width="match_parent" 55 android:layout_height="0dp" 56 android:layout_weight="1"> 57 58 <ListView 59 android:id="@+id/list" 60 android:layout_width="match_parent" 61 android:layout_height="match_parent" /> 62 63 <TextView 64 android:id="@+id/empty" 65 android:layout_width="match_parent" 66 android:layout_height="match_parent" 67 android:gravity="center" 68 android:padding="24dp" 69 android:textAppearance="?android:attr/textAppearanceMedium" /> 70 </FrameLayout> 71 </LinearLayout>