Closed Burtan closed 8 years ago
I was actually doing the old workaround wrong, but still it is not feasible. The point was to use
getChildFragmentManager()
.beginTransaction()
.add(R.id.topLayout, dialogFragment, "Some_tag")
.commit();
instead of
FragmentManager fm = getChildFragmentManager();
dialogFragment.show(fm, "tag");
But this messes the whole dialog. You don't get any window decoration anymore (like borders) and you can't use any dialog method anymore like
setTitle("title")
The best workaround for now is to use a ShowcaseView without target and remove the background dim of the dialogfragment:
getDialog().getWindow().setDimAmount(0);
This way, you have your ShowcaseView as the normal background and the whole dialog is highlighted. To get a better result, I think we have to create a new builder, which takes the dialog instead of the activity.
Are you using 5.3.0 or above? Do dialogs work using the useDecorViewAsParent()
) detailed in the changed behaviour section of that release ([https://github.com/amlcurran/ShowcaseView/releases/tag/5.3.0]())
Using useDecorViewAsParent()
does not fix the problem. Only thing which is changing is that the button overlays the softkeys of my smartphone.. The Showcase is still located behind the dialog.
So I had a quick go, it doesn't look like it will be possible. This is what happens when I use the window that the dialog provides (as @Burtan said, Dialog's have their own Window):
So I'm marking this as will not fix. Sorry guys!
Hi, I'm having problems using ShowcaseView with dialogs. I know there is an old closed issue: https://github.com/amlcurran/ShowcaseView/issues/139 But the workaround described on StackOverflow does not work (anymore). http://stackoverflow.com/questions/23896656/showcaseview-on-top-of-dialogfragment
Without having deep knowledge about the window managing of android, I guess the problem is that ShowcaseView is always drawn on the window of the activity passed to the builder. But a dialog creates its own window which is drawn on top of the activites window. Thus, without changing the window, on which ShowcaseView is drawn, you will never get it on top of the dialog. Maybe there are some cheeky tricks to play with window options?