From ac0e31d7e8da9faac90093770b7c06ffa54ffd95 Mon Sep 17 00:00:00 2001 From: Satyarth Sampath Date: Tue, 2 Aug 2016 16:13:32 +0530 Subject: [PATCH] also add code for enableDismissaftershow --- .../main/java/com/wooplr/spotlight/SpotlightView.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Spotlight-library/src/main/java/com/wooplr/spotlight/SpotlightView.java b/Spotlight-library/src/main/java/com/wooplr/spotlight/SpotlightView.java index e54a7ac..d61a622 100755 --- a/Spotlight-library/src/main/java/com/wooplr/spotlight/SpotlightView.java +++ b/Spotlight-library/src/main/java/com/wooplr/spotlight/SpotlightView.java @@ -599,6 +599,7 @@ public void onAnimationStart(Animation animation) { public void onAnimationEnd(Animation animation) { dismissOnTouch = true; dismissOnBackPress = true; + enableDismissOnBackPress(); } @Override @@ -628,6 +629,12 @@ public void onAnimationRepeat(Animator animator) { } + private void enableDismissOnBackPress() { + setFocusableInTouchMode(true); + setFocusable(true); + requestFocus(); + } + private List checkLinePoint() { //Screen Height @@ -1041,9 +1048,7 @@ public SpotlightView build() { spotlightView.padding); spotlightView.setCircleShape(circle); if (spotlightView.dismissOnBackPress) { - spotlightView.setFocusableInTouchMode(true); - spotlightView.setFocusable(true); - spotlightView.requestFocus(); + spotlightView.enableDismissOnBackPress(); } return spotlightView; }