From 5aebbcc1c0a3c7ca0836b761425b04b500bf92ac Mon Sep 17 00:00:00 2001 From: Heinrich Reimer Date: Fri, 24 Jun 2016 00:36:19 +0200 Subject: [PATCH] Fixed setButtonCtaLabel() methods not working --- .../materialintro/app/IntroActivity.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/library/src/main/java/com/heinrichreimersoftware/materialintro/app/IntroActivity.java b/library/src/main/java/com/heinrichreimersoftware/materialintro/app/IntroActivity.java index 83a85e9..77994a3 100644 --- a/library/src/main/java/com/heinrichreimersoftware/materialintro/app/IntroActivity.java +++ b/library/src/main/java/com/heinrichreimersoftware/materialintro/app/IntroActivity.java @@ -29,6 +29,7 @@ import android.support.v4.view.ViewCompat; import android.support.v4.view.ViewPager; import android.support.v7.app.AppCompatActivity; +import android.text.TextUtils; import android.util.TypedValue; import android.view.View; import android.view.WindowManager; @@ -388,8 +389,17 @@ private void finishIfNeeded() { } } if (buttonCtaVisible) { - return Pair.create((CharSequence) getString(R.string.mi_label_button_cta), - new ButtonCtaClickListener()); + if (buttonCtaLabelRes != 0) { + return Pair.create((CharSequence) getString(buttonCtaLabelRes), + new ButtonCtaClickListener()); + } + if (!TextUtils.isEmpty(buttonCtaLabel)) { + return Pair.create(buttonCtaLabel, new ButtonCtaClickListener()); + } + else { + return Pair.create((CharSequence) getString(R.string.mi_label_button_cta), + new ButtonCtaClickListener()); + } } return null; }