@@ -84,7 +84,13 @@ internal class TutorialPresenter(private val activity: FloatingTutorialActivity,
8484 val cx = firstPage.width / 2
8585 val cy = firstPage.height / 2
8686 val finalRadius = Math .hypot(cx.toDouble(), cy.toDouble()).toFloat()
87- ViewAnimationUtils .createCircularReveal(firstPage, cx, cy, 0f , finalRadius).start()
87+
88+ try {
89+ ViewAnimationUtils .createCircularReveal(firstPage, cx, cy, 0f , finalRadius).start()
90+ } catch (e: IllegalStateException ) {
91+ firstPage.alpha = 0f
92+ firstPage.animate().alpha(1f ).start()
93+ }
8894 } else {
8995 firstPage.alpha = 0f
9096 firstPage.animate().alpha(1f ).start()
@@ -104,16 +110,26 @@ internal class TutorialPresenter(private val activity: FloatingTutorialActivity,
104110 val cx = currentPage.width / 2
105111 val cy = currentPage.height / 2
106112 val initialRadius = Math .hypot(cx.toDouble(), cy.toDouble()).toFloat()
107- val anim = ViewAnimationUtils .createCircularReveal(currentPage, cx, cy, initialRadius, 0f )
108- anim.addListener(object : AnimatorListenerAdapter () {
109- override fun onAnimationEnd (animation : Animator ) {
110- super .onAnimationEnd(animation)
111- currentPage.visibility = View .INVISIBLE
112- activity.close()
113- }
114- })
115113
116- anim.start()
114+ try {
115+ val anim = ViewAnimationUtils .createCircularReveal(currentPage, cx, cy, initialRadius, 0f )
116+ anim.addListener(object : AnimatorListenerAdapter () {
117+ override fun onAnimationEnd (animation : Animator ) {
118+ super .onAnimationEnd(animation)
119+ currentPage.visibility = View .INVISIBLE
120+ activity.close()
121+ }
122+ })
123+
124+ anim.start()
125+ } catch (e: IllegalStateException ) {
126+ currentPage.animate().alpha(0f ).setListener(object : AnimatorListenerAdapter () {
127+ override fun onAnimationEnd (animation : Animator ) {
128+ super .onAnimationEnd(animation)
129+ activity.close()
130+ }
131+ }).start()
132+ }
117133 } else {
118134 currentPage.animate().alpha(0f ).setListener(object : AnimatorListenerAdapter () {
119135 override fun onAnimationEnd (animation : Animator ) {
0 commit comments