Another activity comes up and covers half the screen size
Asked Answered
R

3

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

Rimbaud answered 6/10, 2015 at 18:16 Comment(6)
No not yet, but i wonder how can a drawer be used as an activity. I'm pretty new to android development.Rimbaud
i think you need drawer, not an activity. Check some navigation drawer examplesCasablanca
The drawer would be having a fix size which it overlays from below. I've implemented it using two parallel views one of which has visibility="gone" and on clicking the button the view is set to VISIBLE with some animation.Rimbaud
@MrsEd: im still searching how can achieve it.if possible plz provide some exampleMelda
@MrsEd: yes right. you can also see gmail official app with material design also for reference.Melda
@ρяσѕρєя K , i have answered this question please have a look and tell me in case of any doubts.Rimbaud
R
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

Rimbaud answered 22/11, 2015 at 6:15 Comment(0)
M
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

Merth answered 27/11, 2015 at 10:3 Comment(0)
Y
1

Please. Don't redo this.

And instead, use Flipboard's BottomSheet.

Youmans answered 27/11, 2015 at 22:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.