faruktoptas / FancyShowCaseView

An easy-to-use customisable show case view with circular reveal animation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DialogueFragement and ChildFragment of DialogueFragment, I was implemented in FancyShowCaseView That is not working

AravinthSri opened this issue · comments

Used FancyShowCaseView version 1.3.0

Base Class

public class GuidanceUtils{

public static FancyShowCaseView getGuidanceViewCir(Activity context,int viewId,int customLayout,OnViewInflateListener listener){
        return new FancyShowCaseView.Builder(context)
                .focusOn(context.findViewById(viewId))
                .focusShape(FocusShape.CIRCLE)
                .customView(customLayout, listener)
                .build();
    }

 public static FancyShowCaseView getGuidanceViewCir(Activity context,View view,int customLayout,OnViewInflateListener listener){
        return new FancyShowCaseView.Builder(context)
                .focusOn(view)
                .focusShape(FocusShape.CIRCLE)
                .customView(customLayout, listener)
                .build();
    }
}

In DialogueFragment onCreateView() method I use the code below to show:
1st time tried using traget id but crached.

if (getActivity()!=null){
                FancyShowCaseView fancyShowCaseView =  GuidanceUtils.getGuidanceViewCir(getActivity(),
                            R.id.rlClose,
                            R.layout.layout_target,
                            view -> {
                                AppCompatTextView tvTitle = view.findViewById(R.id.tvTitle);
                                AppCompatTextView tvContent = view.findViewById(R.id.tvContent);
                                FrameLayout flSkip = view.findViewById(R.id.flSkip);
                                flSkip.setOnClickListener(v -> {
                                        isSkipped = true;
                                        skipAll();
                                        }
                                );

                                tvTitle.setText(getString(R.string.home_comments));
                                tvContent.setText(getString(R.string.guide_hd_comment));
                            }
                    );

                    fancyShowCaseView.show();
                }

Crashed

java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter view

2nd time tried using the register view in DialogueFragment. I used some other target views also but no focus was appear and no crash.

 if (getActivity()!=null){
                FancyShowCaseView fancyShowCaseView =  GuidanceUtils.getGuidanceViewCir(getActivity(),
                            rlClose,
                            R.layout.layout_target,
                            view -> {
                                AppCompatTextView tvTitle = view.findViewById(R.id.tvTitle);
                                AppCompatTextView tvContent = view.findViewById(R.id.tvContent);
                                FrameLayout flSkip = view.findViewById(R.id.flSkip);
                                flSkip.setOnClickListener(v -> {
                                        isSkipped = true;
                                        skipAll();
                                        }
                                );

                                tvTitle.setText(getString(R.string.home_comments));
                                tvContent.setText(getString(R.string.guide_hd_comment));
                            }
                    );

                    fancyShowCaseView.show();
                }
            }

Kindly guide me please.

But it was appear in parent of DialogueFragment

Please fill all necessary fields in the issue template. https://github.com/faruktoptas/FancyShowCaseView/blob/master/ISSUE_TEMPLATE.md

Sorry for the inconvenience, Please check now.

Can you check that the views you are trying to focus are not null? It seems that one of the views is null.

Can you check that the views you are trying to focus are not null? It seems that one of the views is null.

When I replace as Dialogue Fragment to Fragment means, It is working fine. But when I use as a DialogueFragment means view are fouced on parent fragment, When i dismiss the DialogueFragment that fouce was appear on parent fragment.

I am facing the same problem.
it's not showing on DialogFragment but after dismiss its show on parent fragment.
Any solution for this?

@AravinthSri @sandeeptank52 This is known a issue. Dialogs are shown on top of all views. Unfortunately there is no support for dialogs now. FancyShowCaseView is a FrameLayout added to the root view of the activity. So all dialogs are shown in front of it.
PRs welcome If you want to contribute to support dialogs :)

contribute

Thanks for the response :)