I. A
I. A

Reputation: 2312

Displaying CardView as a Dialog in Android

I am looking to display a CardVeiw that displays some information for the user. At the same time, I need its behavior to be similar to a dialog, and at the same time, I need to enable the user to click on the left and right buttons as shown bellow and flip the CardView to display another CardView with richer Content such as some detailed description... Here is an example:

So far I knew that I can create a Dialog, but my content could be scrollable. So it might not be a good practice to use a Dialog in this case (According to https://material.io/guidelines/components/dialogs.html#dialogs-alerts).

enter image description here

So I would like to know what are the best practices for this problem?

Upvotes: 3

Views: 4778

Answers (1)

44kksharma
44kksharma

Reputation: 2830

set dialog window background to transparent dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);

Upvotes: 16

Related Questions