9

I have a button which on clicking opens another activity which comes up from below and covers half the screen. I searched about it but did not get any useful approach except the overridePendingTransition function which is useful in getting the animation on activity transition, but this didn't solve my problem. I know this is done in google hangout as shown in the images but can't find any useful solution.

When we press the button this activity comes up and covers half the screen size When we press the button this activity comes up and covers half the screen size

when we scroll up the activity becomes our main activity when we scroll up the activity becomes our main activity

Any idea how this can be done?

Thanks

Pardyot Shahi
  • 499
  • 4
  • 15

3 Answers3

4

After some searching i got exactly what i wanted with all the codes, but still the profile picture animation is remaining, rest the SlidingPanelLayout code can be seen here . It contains some detailed information with all the classes implemented which you can use directly. I think this will surely help you. :D

Edit: As said by @MrsEd i would like to add some code that helped me. This is the custom built DraggableLayout which you can use directly, the code can be found here. Then the activity must implement the onStopVerticalDragDown() of the DraggableLayoutCallbackListener inteface and set the content view as this xml file. Hope this clears all the doubt and makes it easier for anyone to implement their own custom built DraggableLayout without using any third party library. :D

Pardyot Shahi
  • 499
  • 4
  • 15
4

you can use bottom sheet for this type of UI.

here is first sample.

enter image description here


another sample

here is code

enter image description here

Dhaval Parmar
  • 18,812
  • 8
  • 82
  • 177
1

Please. Don't redo this.

And instead, use Flipboard's BottomSheet.

Fadils
  • 1,508
  • 16
  • 21