Skip to content

Commit

Permalink
Merge pull request #216 from caarmen/fix-insets-suggestions
Browse files Browse the repository at this point in the history
Fix the insets for the search widget and suggestions
  • Loading branch information
caarmen authored Jan 5, 2025
2 parents 5b4c9f7 + 86669d7 commit a1fd448
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ class MainActivity : AppCompatActivity(), OnWordClickListener, WarningNoSpaceDia
top = insets.top,
)
}
getInsets(mBinding.searchSuggestionsList) { view, insets ->
view.updatePadding(
left = insets.left,
right = insets.right,
)
}
val searchView = mBinding.searchView
val suggestionsViewModel = ViewModelProvider(this).get(SuggestionsViewModel::class.java)
mSearch.setSearchView(searchView, suggestionsViewModel)
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context=".main.MainActivity">

<androidx.viewpager.widget.ViewPager
Expand Down Expand Up @@ -78,7 +77,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/search_suggestions_list"
app:layoutManager="LinearLayoutManager"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="match_parent">

</androidx.recyclerview.widget.RecyclerView>
Expand Down

0 comments on commit a1fd448

Please sign in to comment.