3

I have 2 activities, In first activity I have a button and I want when user clicks or move up that button the second activity come from bottom and stop when it goes to the half of the screen. I don't understand how can I achieve this. I also searched google but they show some type of dialog boxes :(. enter image description here

This is what I want. When app start 1st activity is shown on the screen but when user click ^ this button both 2 activities show 50% on the screen. Can anybody tell me how can I achieve this. Is it possible???

Sunny Bhadana
  • 241
  • 3
  • 14

4 Answers4

4

You would achieve this using Fragments.

I would suggest you start with the offical documentation - https://developer.android.com/training/basics/fragments/index.html

Matthew Shearer
  • 2,715
  • 3
  • 23
  • 32
0

You should read about fragments. They can be used for the UI you described. You can make it so that a second fragment is GONE, and when the user presses a button, it becomes visible. You should probably use a relative layout for the two fragments.

John Doe
  • 397
  • 3
  • 18
0

In order to create the interface above you could use fragments instead of activity.

In your case you need to have an activity with two fragments (you can use coordinatorlayout). If you don't have enough knowledge about fragments I recommend to read those articles:

Selim Ajimi
  • 344
  • 6
  • 21
0

Convert Activity to Fragment and use <FrameLayout> on page to display/remove fragments from page.

Fragments are reusable components Refer to convert Activity to Fragment

This might help you understand how to work with Fragments link

Gaurav
  • 559
  • 4
  • 8