From b55ad9c485fffadd115d9fe03d513c547a9d3551 Mon Sep 17 00:00:00 2001 From: Rebecca Franks Date: Wed, 3 Jan 2018 13:16:23 +0200 Subject: [PATCH] Added check for if no tutorial items are passed --- .../tutorial/MaterialTutorialActivity.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/materialhelptutorial/src/main/java/za/co/riggaroo/materialhelptutorial/tutorial/MaterialTutorialActivity.java b/materialhelptutorial/src/main/java/za/co/riggaroo/materialhelptutorial/tutorial/MaterialTutorialActivity.java index 58c75ce..ebb674f 100644 --- a/materialhelptutorial/src/main/java/za/co/riggaroo/materialhelptutorial/tutorial/MaterialTutorialActivity.java +++ b/materialhelptutorial/src/main/java/za/co/riggaroo/materialhelptutorial/tutorial/MaterialTutorialActivity.java @@ -23,8 +23,8 @@ public class MaterialTutorialActivity extends AppCompatActivity implements MaterialTutorialContract.View { - private static final String TAG = "MaterialTutActivity"; public static final String MATERIAL_TUTORIAL_ARG_TUTORIAL_ITEMS = "tutorial_items"; + private static final String TAG = "MaterialTutActivity"; private ViewPager mHelpTutorialViewPager; private View mRootView; private TextView mTextViewSkip; @@ -63,7 +63,6 @@ protected void onCreate(Bundle savedInstanceState) { mDoneButton.setOnClickListener(finishTutorialClickListener); - mNextButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -73,7 +72,11 @@ public void onClick(View v) { } }); List tutorialItems = getIntent().getParcelableArrayListExtra(MATERIAL_TUTORIAL_ARG_TUTORIAL_ITEMS); - materialTutorialPresenter.loadViewPagerFragments(tutorialItems); + if (tutorialItems == null) { + showEndTutorial(); + } else { + materialTutorialPresenter.loadViewPagerFragments(tutorialItems); + } } private void setStatusBarColor() {