question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Request: Add a BottomSheetDialog example with a RecyclerView inside

See original GitHub issue

Hi, I’d be nice to have an example featuring a BottomSheetDialog, which would have views at the top of the layout, a RecyclerView with more items than can fit in the screen, and views in the bottom as well.

This would be very helpful to not just me as I failed to find how to do it right on the public web (and failed to do it right on my own, having views behind the SystemUI).

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alexvanyocommented, Apr 9, 2021

@itsandreramon It depends on the behavior you are going for!

One comment for the above code is that view?.applyInsetter is acting on the Fragment.getView(), and not the com.google.android.material.R.id.container, even though the nesting seems to imply otherwise. You’d probably be better off applying those insets directly in onViewCreated, rather than in the onAttachedToWindow callback.

If the content in your bottom sheet can be really big (large enough to fill up the entire screen), you might also see your content interact strangely with the status bar unless you also apply the status bar insets.

The latest 1.4.0-alpha versions of the material components library also now have more built-in support for going edge-to-edge, including some fancy dynamic updating of the status bar color.

0reactions
itsandreramoncommented, Apr 9, 2021

Thank you very much, will fix this 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android RecyclerView inside BottomSheetBehavior layout
Try this: mRecycler.setOnTouchListener(new RecyclerView.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { int action = event ...
Read more >
Android - Display BottomSheet on RecyclerView Item Click ...
A sample video is given below to get an idea about what we are going to do in this article.
Read more >
Implementing Bottom Sheet Dialogs using Android Studio
Here is an example of a Persistent Bottom Sheet dialog in a Google Maps application. Google Maps Bottom Sheet ...
Read more >
Android Studio Tutorial | Bottom Sheet Dialog - YouTube
larntech #BottomSheet # BottomSheetDialog Android Bottom Sheet Dialog Fragment is what we are going to learn and implement in this tutorial.
Read more >
Bottom sheet with a list and a pull to refresh action on Android
A tutorial on how to create a bottom sheet with a recycler view and a pull to refresh action on Android This is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found