Just on a lighter note, can u guys give me a hint how to make a view like this. I m not asking to write code for me. I just need few suggestions. When click on bottom right corner a new screen shows which has transparent background where a little bit main activity is visible and contents are not aligned vertical or horizontal. Your ideas would be appreciated
Asked
Active
Viewed 68 times
1 Answers
1
Use full screen dialog with Constraint Layout or Relative Layout
Dialog dialog = new Dialog(context, R.style.DialogTheme);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
dialog.setContentView(R.layout.your_custom_layout);
dialog.getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT);
dialog.show();

BornToCode
- 44
- 1
- 7
-
-
set the dialog theme to one of the fullscreen theme `android.R.style.Theme.Black.NoTitleBar.Fullscreen` – BornToCode Dec 11 '19 at 13:01
-
there is a problem while using constraint layout it gives me this error `Binary XML file line #9: Binary XML file line #9: Error inflating class android.support.constraint.Guideline` – Dec 11 '19 at 13:07
-
[Please refer this answer](https://stackoverflow.com/a/42502151/5403852) – BornToCode Dec 11 '19 at 13:17
-
One more question as u can see the background of dialog is not transparent.. can u tell me which color is this? – Dec 11 '19 at 13:32
-
The color will be something like this `#8BFF0000`, add this color as background to your constraint layout – BornToCode Dec 11 '19 at 13:35
-
there is a problem now when i use the content of activity its backend of activity is not working means if i have button in my activity then on click of button is not working – Dec 11 '19 at 15:51