@@ -433,33 +433,33 @@ void setPosition(int x, int y) {
433
433
}
434
434
435
435
private void setTitleText (CharSequence contentText ) {
436
- if (mTitleTextView != null && ! contentText .equals ( "" ) ) {
436
+ if (mTitleTextView != null && contentText .length () > 0 ) {
437
437
mTitleTextView .setText (contentText );
438
438
}
439
439
}
440
440
441
441
private void setContentText (CharSequence contentText ) {
442
- if (mContentTextView != null ) {
442
+ if (mContentTextView != null && contentText . length () > 0 ) {
443
443
mContentTextView .setText (contentText );
444
444
}
445
445
}
446
446
447
447
private void setDismissText (CharSequence dismissText ) {
448
- if (mDismissButtonText != null ) {
448
+ if (mDismissButtonText != null && dismissText . length () > 0 ) {
449
449
mDismissButtonText .setText (dismissText );
450
450
451
451
updateDismissButton ();
452
452
}
453
453
}
454
454
455
455
private void setCloseText (CharSequence closeText ) {
456
- if (mCloseTextView != null ) {
456
+ if (mCloseTextView != null && closeText . length () > 0 ) {
457
457
mCloseTextView .setText (closeText );
458
458
}
459
459
}
460
460
461
461
private void setNextText (CharSequence nextText ) {
462
- if (mNextTextView != null ) {
462
+ if (mNextTextView != null && nextText . length () > 0 ) {
463
463
mNextTextView .setText (nextText );
464
464
}
465
465
}
@@ -700,18 +700,21 @@ public Builder setDismissText(int resId) {
700
700
return setDismissText (activity .getString (resId ));
701
701
}
702
702
703
- public Builder setDismissText (CharSequence dismissText ) {
704
- showcaseView .setDismissText (dismissText );
703
+ public Builder setDismissText (CharSequence text ) {
704
+ if (text != null && text .length () > 0 )
705
+ showcaseView .setDismissText (text );
705
706
return this ;
706
707
}
707
708
708
- public Builder setCloseText (CharSequence closeText ) {
709
- showcaseView .setCloseText (closeText );
709
+ public Builder setCloseText (CharSequence text ) {
710
+ if (text != null && text .length () > 0 )
711
+ showcaseView .setCloseText (text );
710
712
return this ;
711
713
}
712
714
713
- public Builder setNextText (CharSequence nextText ) {
714
- showcaseView .setNextText (nextText );
715
+ public Builder setNextText (CharSequence text ) {
716
+ if (text != null && text .length () > 0 )
717
+ showcaseView .setNextText (text );
715
718
return this ;
716
719
}
717
720
@@ -726,7 +729,8 @@ public Builder setContentText(int resId) {
726
729
* Set the descriptive text shown on the ShowcaseView.
727
730
*/
728
731
public Builder setContentText (CharSequence text ) {
729
- showcaseView .setContentText (text );
732
+ if (text != null && text .length () > 0 )
733
+ showcaseView .setContentText (text );
730
734
return this ;
731
735
}
732
736
@@ -741,7 +745,8 @@ public Builder setTitleText(int resId) {
741
745
* Set the descriptive text shown on the ShowcaseView as the title.
742
746
*/
743
747
public Builder setTitleText (CharSequence text ) {
744
- showcaseView .setTitleText (text );
748
+ if (text != null && text .length () > 0 )
749
+ showcaseView .setTitleText (text );
745
750
return this ;
746
751
}
747
752
0 commit comments