Git Product home page Git Product logo

threephasesbottomsheet's Introduction

ThreePhasesBottomSheet

A bottom sheet sample that's similar to how Google Maps treat it. Example animation:

enter image description here

This is based mainly on these 2 repositories:

and was asked about on StackOverflow here:

http://stackoverflow.com/q/34160423/878126

It might be possible to use this repository instead of the bottomSheet repo:

https://github.com/umano/AndroidSlidingUpPanel

known issues:

first method, of using AppBarLayout,CoordinatorLayout , etc :

  • Tested on version 6, 4.2 and 4.4 . Not sure about the others.
  • doesn't handle well orientation changes. Handled in the sample by re-showing the bottom sheet, but it doesn't restore its state.
  • rare issue of being able to scroll inside the bottom sheet's content while it's still collapsed (at the bottom). Not sure if still exist.
  • can have weird issues (like showing in full-screen) in case the keyboard was shown before peeking. This is handled in the sample by just hiding the bottom sheet when the keyboard appears.
  • can't handle situations that the bottom sheet is larger in its peeked state, compared to when it's in expanded state.
  • when you press the back button to go from a scrolled expanded bottom sheet state, to the state of peek, it has some weird issues. Need to handle this, or make it work differently. In the sample, I chose to just dismiss the bottom sheet for this case.

Second method, of using just a NestedScrollView :

  • doesn't snap for scrolling of the bottom sheet, when it's in expanded mode. not an issue, just a missing feature.
  • pressing the back button when the bottom sheen is expaneded can cause weird UI issues.
  • might have other issues.

threephasesbottomsheet's People

Contributors

androiddeveloperlb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

threephasesbottomsheet's Issues

Bug in your MyFragment class

You have the following code:

mBottomSheetContentView.setOnClickListener(new OnClickListener()
  {
  @Override
  public void onClick(final View v)
    {
        mBottomSheetLayout.expandSheet();
    }
  });

The correct for me is this one:

mBottomSheetContentView.setOnClickListener(new OnClickListener()
  {
  @Override
  public void onClick(final View v)
    {
        if (mBottomSheetLayout.getState() == State.PEEKED) mBottomSheetLayout.expandSheet();
    }
  });

Because if you click the mBottomSheetContentView (in the imageView or in the textView) when the state is State.EXPANDED, you have a bug that resizes the image and puts the other textview element in a wrong position

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.