File tree Expand file tree Collapse file tree
Spotlight-library/src/main/java/com/wooplr/spotlight Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -599,6 +599,7 @@ public void onAnimationStart(Animation animation) {
599599 public void onAnimationEnd (Animation animation ) {
600600 dismissOnTouch = true ;
601601 dismissOnBackPress = true ;
602+ enableDismissOnBackPress ();
602603 }
603604
604605 @ Override
@@ -628,6 +629,12 @@ public void onAnimationRepeat(Animator animator) {
628629
629630 }
630631
632+ private void enableDismissOnBackPress () {
633+ setFocusableInTouchMode (true );
634+ setFocusable (true );
635+ requestFocus ();
636+ }
637+
631638 private List <AnimPoint > checkLinePoint () {
632639
633640 //Screen Height
@@ -1041,9 +1048,7 @@ public SpotlightView build() {
10411048 spotlightView .padding );
10421049 spotlightView .setCircleShape (circle );
10431050 if (spotlightView .dismissOnBackPress ) {
1044- spotlightView .setFocusableInTouchMode (true );
1045- spotlightView .setFocusable (true );
1046- spotlightView .requestFocus ();
1051+ spotlightView .enableDismissOnBackPress ();
10471052 }
10481053 return spotlightView ;
10491054 }
You can’t perform that action at this time.
0 commit comments