1

So, I'm this library (https://github.com/amlcurran/ShowcaseView), it's working great but I need to hide the button it has because I really don't need it. I've tried using the method .replaceEndButton() by making it replace it with one invisible button I added to the XML file of the but it crashes

Diego Rivera
  • 403
  • 1
  • 5
  • 19

1 Answers1

3

I fixed it by creating a button programmatically and making it with GONE visibility.

 Button button = new Button(getContext());
    button.setText("");
    button.setEnabled(false);
    button.setVisibility(View.GONE);

And then on the ShowcaseView builder method replaceEndButton(), I send this new button like this:

ShowcaseView sv = new ShowcaseView.Builder(getActivity())
            .withMaterialShowcase()
            .setTarget(new ViewTarget(fabIntercom))
            .hideOnTouchOutside()
            .replaceEndButton(button)
            .setStyle(R.style.CustomShowcaseTheme)
            .setContentTitle(R.string.showcase_main_title)
            .setContentText(R.string.showcase_main_message)
            .singleShot(42)
            //.setParent()
            .build();
Diego Rivera
  • 403
  • 1
  • 5
  • 19