Like Google Maps

Proof of concept to create a coordinator layout behavior that mimics the bottomsheet behvior in the Google Maps app.
Alternatives To Like Google Maps
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
2 years ago35apache-2.0Java
Custom BottomSheetBehavior for Android that mimic Google Maps behavior
Shrine Materialdesign2210
5 years agoapache-2.0Kotlin
implementation of Material Design 2 Shrine project
Google Maps Bottomsheet65
5 years ago4unlicenseJava
A BottomSheetBehavior framework mirroring Google Maps'
Like Google Maps22
5 years agootherJava
Proof of concept to create a coordinator layout behavior that mimics the bottomsheet behvior in the Google Maps app.
4 years agoapache-2.0Kotlin
BottomSheetBehavior is an android library extracted from the Google I/O 2018 application source code.
4 years agoDart
Flutter application using Google Maps, Get Current Location (Devices), Markers, Camera Position, Bottom Sheet, DraggableScrollableSheet, etc 🔥
Alternatives To Like Google Maps
Select To Compare

Alternative Project Comparisons


Proof of concept; Google Maps like bottomsheet behavior

What this project is

Inspired by this article on creating a custom bottomsheet behavior, this project aims to inspire and promote the use and creation of CoordinatatorLayout Behaviors.

To achieve the final bottomsheet'esque behavior, the orginal source for the bottomsheet behavior in the Android Design Library was copied, studied, and edited (arguably butchered). The orginal source didn't handle flings and / or transient states, as in, the bottomsheet was either hidden, collapsed or expanded. After any touch / drag interaction, the sheet would snap to a then determined state.

Many different attempts led to unforeseen caveats and some unwanted side effects to overcome, particularly around nested scrolling and the allowance of a "sticky header". The inner workings of coordinator layout needed to be understood. A must watch video, takes a pretty deep dive into the inner workings of nested scrolling and CoordinatorLayout Behaviors. This article by Alex Lockwood on nested scrolling and some borrowed code allowed me to finally achieve the end goal.

The end result is a custom bottomsheet behavior that allows for an optional custom header. Snap can be enabled or disabled, as well as the peek height can be set to either auto, header (height of the header) or a custom value(dp's). As with the original behavior, a flag exists for hideable. I also added a configurable topOffset to prevent expanding past a certain y value.

One important takeaway from this experiment is that if you are creating your own behavior, it usually means the default behaviors in the Design Library are not accommodating to your requirements. So, likely, your end result will be specific to your app's design and flow. We all strive to write robust and resuable code, and that principle should be applied to custom views and behaviors as well, but beware of the cost. The more customizations and options you allow and provide, the more complex your behavior becomes. You need to account for all permutations of state that can occur, and manage those.

peek=header; snap peek=header; no snap
peek=auto; snap peek=auto; snap; hideable
Popular Google Projects
Popular Bottom Sheet Projects
Popular Companies Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Google Maps