Skip to content

Commit

Permalink
Fix #474 - Hide ShowcaseView in Activity.onPause()
Browse files Browse the repository at this point in the history
  • Loading branch information
barbeau committed Apr 28, 2016
1 parent 51b86f6 commit ea3c0e3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.onebusaway.android.io.elements.ObaStop;
import org.onebusaway.android.provider.ObaContract;
import org.onebusaway.android.util.FragmentUtils;
import org.onebusaway.android.util.ShowcaseViewUtils;
import org.onebusaway.android.util.UIUtils;

import android.content.Context;
Expand Down Expand Up @@ -170,6 +171,12 @@ protected void onResume() {
}
}

@Override
protected void onPause() {
ShowcaseViewUtils.hideShowcaseView();
super.onPause();
}

@Override
protected void onStart() {
ObaAnalytics.reportActivityStart(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,12 @@ public void onResume() {
}
}

@Override
protected void onPause() {
ShowcaseViewUtils.hideShowcaseView();
super.onPause();
}

@Override
public void onStop() {
// Tear down GoogleApiClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,15 @@ public static boolean isShowcaseViewShowing() {
return mShowcaseView != null && mShowcaseView.isShowing();
}

/**
* Hides a currently showing ShowcaseView
*/
public static void hideShowcaseView() {
if (mShowcaseView != null) {
mShowcaseView.hide();
}
}

/**
* Adds the provided icon to the right side of the provided SpannableString
*
Expand Down

0 comments on commit ea3c0e3

Please sign in to comment.