From c1b83413275abb4a378985a6fe9f8c38e568e10b Mon Sep 17 00:00:00 2001 From: Shashank Singhal Date: Sat, 17 Jul 2021 10:21:23 +0530 Subject: [PATCH] - Added the functionality to show and hide the fab from the particular onboarding page --- README.md | 3 ++- .../sony/fancywalkthroughlibrary/MainActivity.java | 4 ++++ .../fancywalkthroughlib/FancyWalkthroughFragment.java | 8 +++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 402ed15..ff78d0d 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Add this to your module's `build.gradle` file (make sure the version matches the ```gradle dependencies { ... - compile 'com.github.Shashank02051997:FancyWalkthrough-Android:2.1' + compile 'com.github.Shashank02051997:FancyWalkthrough-Android:2.2' } ``` # Fancy Walkthrough @@ -56,6 +56,7 @@ FancyWalkthroughCard fancywalkthroughCard1 = new FancyWalkthroughCard("Title", " fancywalkthroughCard1.setBackgroundColor(R.color.white); fancywalkthroughCard1.setTitleColor(R.color.black); fancywalkthroughCard1.setDescriptionColor(R.color.black); +//fancywalkthroughCard1.setDisplaySkip(false); //fancywalkthroughCard1.setTitleTextSize(dpToPixels(10, this)); //fancywalkthroughCard1.setDescriptionTextSize(dpToPixels(8, this)); //fancywalkthroughCard1.setIconLayoutParams(iconWidth, iconHeight, marginTop, marginLeft, marginRight, marginBottom); diff --git a/app/src/main/java/com/shashank/sony/fancywalkthroughlibrary/MainActivity.java b/app/src/main/java/com/shashank/sony/fancywalkthroughlibrary/MainActivity.java index d71e371..356895b 100644 --- a/app/src/main/java/com/shashank/sony/fancywalkthroughlibrary/MainActivity.java +++ b/app/src/main/java/com/shashank/sony/fancywalkthroughlibrary/MainActivity.java @@ -21,12 +21,16 @@ protected void onCreate(Bundle savedInstanceState) { fancywalkthroughCard1.setBackgroundColor(R.color.white); fancywalkthroughCard1.setIconLayoutParams(300, 300, 0, 0, 0, 0); + fancywalkthroughCard1.setDisplaySkip(true); fancywalkthroughCard2.setBackgroundColor(R.color.white); fancywalkthroughCard2.setIconLayoutParams(300, 300, 0, 0, 0, 0); + fancywalkthroughCard2.setDisplaySkip(true); fancywalkthroughCard3.setBackgroundColor(R.color.white); fancywalkthroughCard3.setIconLayoutParams(300, 300, 0, 0, 0, 0); + fancywalkthroughCard3.setDisplaySkip(true); fancywalkthroughCard4.setBackgroundColor(R.color.white); fancywalkthroughCard4.setIconLayoutParams(300, 300, 0, 0, 0, 0); + fancywalkthroughCard4.setDisplaySkip(true); List pages = new ArrayList<>(); pages.add(fancywalkthroughCard1); diff --git a/fancywalkthroughlib/src/main/java/com/shashank/sony/fancywalkthroughlib/FancyWalkthroughFragment.java b/fancywalkthroughlib/src/main/java/com/shashank/sony/fancywalkthroughlib/FancyWalkthroughFragment.java index 8ea8fc5..8740bf4 100644 --- a/fancywalkthroughlib/src/main/java/com/shashank/sony/fancywalkthroughlib/FancyWalkthroughFragment.java +++ b/fancywalkthroughlib/src/main/java/com/shashank/sony/fancywalkthroughlib/FancyWalkthroughFragment.java @@ -18,6 +18,8 @@ import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; +import com.google.android.material.floatingactionbutton.FloatingActionButton; + public class FancyWalkthroughFragment extends Fragment { private static final String FANCY_PAGE_TITLE = "ahoy_page_title"; @@ -175,10 +177,10 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa } - if (!isDisplay) { - skip.setVisibility(View.GONE); - } else { + if (isDisplay) { skip.setVisibility(View.VISIBLE); + } else { + skip.setVisibility(View.GONE); } if (iconWidth != 0 && iconHeight != 0) {