Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Another activity comes up and covers half the screen size

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

like image 270
Pardyot Shahi Avatar asked Oct 06 '15 18:10

Pardyot Shahi


People also ask

What is an activity on android?

An activity provides the window in which the app draws its UI. This window typically fills the screen, but may be smaller than the screen and float on top of other windows. Generally, one activity implements one screen in an app.


1 Answers

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

like image 113
Dhaval Parmar Avatar answered Nov 15 '22 22:11

Dhaval Parmar