Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ public class MaterialIntroView extends RelativeLayout {
*/
private boolean usesCustomShape = false;

/**
* status of dismiss
*/
private boolean isDismiss = false;

public MaterialIntroView(Context context) {
super(context);
init(context);
Expand Down Expand Up @@ -372,16 +377,17 @@ public boolean onTouchEvent(MotionEvent event) {

return true;
case MotionEvent.ACTION_UP:

if (isTouchOnFocus || dismissOnTouch)
dismiss();

if (isTouchOnFocus && isPerformClick) {
targetView.getView().performClick();
targetView.getView().setPressed(true);
targetView.getView().invalidate();
targetView.getView().setPressed(false);
targetView.getView().invalidate();
if(!isDismiss){
if (isTouchOnFocus || dismissOnTouch)
dismiss();

if (isTouchOnFocus && isPerformClick) {
targetView.getView().performClick();
targetView.getView().setPressed(true);
targetView.getView().invalidate();
targetView.getView().setPressed(false);
targetView.getView().invalidate();
}
}

return true;
Expand Down Expand Up @@ -425,12 +431,14 @@ public void onAnimationStart() {
if(isIdempotent) {
preferencesManager.setDisplayed(materialIntroViewId);
}
isDismiss = false;
}

/**
* Dismiss Material Intro View
*/
public void dismiss() {
isDismiss = true;
if(!isIdempotent) {
preferencesManager.setDisplayed(materialIntroViewId);
}
Expand Down