0

I'm trying to design my LoginActivity to look like my LoginController in iOS. Is there a way to make an activity transparent, or do I need to use a fragment? Thank you!

// My Design

enter image description here

1 Answers1

1

You can achieve this through multiple ways

  1. Create an activity and make its background as transparent in the layout.(Not recommended)

  2. Create an alert dialog within the activity and make the alert dialog background as transparent

  3. Create a dialog fragment make its layout transparent and open it from the activity.

  4. Create a view stub within the same activity layout and inflate the view when required. (Handling back press events might be a difficult task here).

Although the right way would be to create an alert dialog within the activity or creating a dialog fragment or create a view stub. Create an alert dialog if you don't have much events or elements within the dialog since its easy and efficient than creating a dialog fragment for a little dialog. Creating a view stub would be the most efficient way since it simply inflates the view which takes less amount of resource. But don't go with creating an activity for this dialog which is resource intensive and not the correct way.

thebadassdev
  • 156
  • 9