Skip to content

Commit db7b0e6

Browse files
committed
Centering the auxiliary views and filling the viewport
1 parent d38397f commit db7b0e6

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

app/src/main/res/layout/activity_search.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
<org.secfirst.advancedsearch.views.SearchResultView
99
android:id="@+id/searchResultView"
1010
android:layout_width="match_parent"
11-
android:layout_height="wrap_content"/>
11+
android:layout_height="match_parent"/>
1212

1313
</LinearLayout>

library/src/main/res/layout/search_view.xml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<androidx.core.widget.NestedScrollView
33
xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:fitsSystemWindows="true"
5+
android:fillViewport="true"
46
android:layout_height="match_parent"
57
android:layout_width="match_parent">
68

@@ -96,7 +98,7 @@
9698
<TextView
9799
android:id="@+id/searchTermView"
98100
android:layout_marginTop="20dp"
99-
android:gravity="end|right"
101+
android:gravity="center_horizontal"
100102
android:layout_marginLeft="5dp"
101103
android:layout_marginRight="5dp"
102104
android:layout_width="match_parent"
@@ -106,7 +108,7 @@
106108

107109
<FrameLayout
108110
android:layout_width="match_parent"
109-
android:layout_height="wrap_content">
111+
android:layout_height="match_parent">
110112

111113
<androidx.recyclerview.widget.RecyclerView
112114
android:id="@+id/searchResultsListView"
@@ -116,8 +118,8 @@
116118
android:layout_height="wrap_content" />
117119

118120
<TextView
119-
android:layout_marginTop="60dp"
120-
android:layout_marginBottom="60dp"
121+
android:layout_marginTop="@dimen/defaultMargin"
122+
android:layout_marginBottom="@dimen/defaultMargin"
121123
android:id="@+id/searchResultsEmptyView"
122124
android:visibility="gone"
123125
android:gravity="center"
@@ -130,8 +132,8 @@
130132
<TextView
131133
android:id="@+id/searchResultsNoSearchTerm"
132134
android:visibility="gone"
133-
android:layout_marginTop="60dp"
134-
android:layout_marginBottom="60dp"
135+
android:layout_marginTop="@dimen/defaultMargin"
136+
android:layout_marginBottom="@dimen/defaultMargin"
135137
android:layout_gravity="center"
136138
android:gravity="center"
137139
android:textSize="@dimen/largerTextSize"
@@ -142,8 +144,8 @@
142144
<TextView
143145
android:id="@+id/applyToRefresh"
144146
android:visibility="gone"
145-
android:layout_marginTop="60dp"
146-
android:layout_marginBottom="60dp"
147+
android:layout_marginTop="@dimen/defaultMargin"
148+
android:layout_marginBottom="@dimen/defaultMargin"
147149
android:layout_gravity="center"
148150
android:gravity="center"
149151
android:textSize="@dimen/largerTextSize"

0 commit comments

Comments
 (0)