Stretchable dialog from Android

Denis Aleksandrov
Sep 1, 2018 · 1 min read

Often I need to create a dialog with transparent back without fixed size. It can be some text, image with unknown ratio, list of something. I can calculate the height, but Constraint Layout can to do it automatically. Small example:

That’s all! I can attach to dialog_container some content, such as ScrollView(from fixed content), RecyclerView.
My window will shrink to size of content size, or limit size of the window size.

my small example

Github demo: https://github.com/d-aleksandrov/Stretchable-Dialog-Android

Denis Aleksandrov
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade