[Android] Fix Onboarding done button not show if tapped too fast

Nicolas Pomepuy git at videolan.org
Wed Jul 24 15:18:32 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Wed Jul 24 07:19:21 2019 +0200| [a1a65f3210336443822636c55a4f36bf5f598e4c] | committer: Geoffrey Métais

Fix Onboarding done button not show if tapped too fast

> https://code.videolan.org/videolan/vlc-android/commit/a1a65f3210336443822636c55a4f36bf5f598e4c
---

 vlc-android/src/org/videolan/vlc/gui/onboarding/OnboardingActivity.kt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/onboarding/OnboardingActivity.kt b/vlc-android/src/org/videolan/vlc/gui/onboarding/OnboardingActivity.kt
index 649da9aac..ebe0b689a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/onboarding/OnboardingActivity.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/onboarding/OnboardingActivity.kt
@@ -5,6 +5,7 @@ import android.app.Activity
 import android.content.Intent
 import android.os.Build
 import android.os.Bundle
+import android.util.Log
 import android.view.View
 import android.view.WindowManager
 import android.widget.Button
@@ -148,6 +149,7 @@ class OnboardingActivity : AppCompatActivity(), ViewPager.OnPageChangeListener,
     }
 
     private fun selectPage(index: Int) {
+        if (BuildConfig.DEBUG) Log.d(this::class.java.simpleName, "Selecting page $index pager nb of item: ${onboardingPagerAdapter.count}")
         //Navigation button states
         if (index == 0) {
             previousButton.animate().scaleY(0f).scaleX(0f).alpha(0f)
@@ -157,6 +159,7 @@ class OnboardingActivity : AppCompatActivity(), ViewPager.OnPageChangeListener,
 
         if (index == onboardingPagerAdapter.count - 1) {
             nextButton.animate().scaleY(0f).scaleX(0f).alpha(0f)
+            doneButton.animate().cancel()
             doneButton.visibility = View.VISIBLE
             doneButton.animate().scaleY(1f).scaleX(1f).alpha(1f).setListener(null)
         } else {
@@ -224,6 +227,7 @@ class OnboardingActivity : AppCompatActivity(), ViewPager.OnPageChangeListener,
         }
         onboardingPagerAdapter.onCustomizedChanged(customizeEnabled)
         viewModel.adapterCount = if (customizeEnabled) 4 else 3
+        if (BuildConfig.DEBUG) Log.d(this::class.java.simpleName, "New adapter count: ${viewModel.adapterCount}")
     }
 }
 



More information about the Android mailing list