[Android] Confirm the parental pin code as soon as it's fully entered
Nicolas Pomepuy
git at videolan.org
Mon May 13 11:59:33 UTC 2024
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon May 6 15:33:23 2024 +0200| [d59b78970769a04e285757feeb356f54ff2996e8] | committer: Nicolas Pomepuy
Confirm the parental pin code as soon as it's fully entered
> https://code.videolan.org/videolan/vlc-android/commit/d59b78970769a04e285757feeb356f54ff2996e8
---
application/vlc-android/src/org/videolan/vlc/gui/PinCodeActivity.kt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/PinCodeActivity.kt b/application/vlc-android/src/org/videolan/vlc/gui/PinCodeActivity.kt
index 44dd0fedaf..56e9b0f1a1 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/PinCodeActivity.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/PinCodeActivity.kt
@@ -30,6 +30,7 @@ import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.text.method.PasswordTransformationMethod
+import android.util.Log
import android.view.KeyEvent
import android.view.MenuItem
import android.view.inputmethod.EditorInfo
@@ -49,6 +50,7 @@ import org.videolan.tools.Settings
import org.videolan.tools.putSingle
import org.videolan.tools.setGone
import org.videolan.tools.setVisible
+import org.videolan.vlc.BuildConfig
import org.videolan.vlc.R
import org.videolan.vlc.databinding.PinCodeActivityBinding
import org.videolan.vlc.gui.helpers.UiTools
@@ -104,6 +106,7 @@ class PinCodeActivity : BaseActivity() {
updateFocus()
//focus next button on TV
if (Settings.tvUI && codeFilled) binding.nextButton.requestFocus()
+ if (editText == binding.pinCode4 && pinTexts.filter { it.text?.isNotEmpty() == true }.size == 4) next()
}
}
editText.setOnKeyListener { v, keyCode, event ->
@@ -319,6 +322,7 @@ class PinCodeActivity : BaseActivity() {
return
}
}
+ if (BuildConfig.DEBUG) Log.d(this::class.java.simpleName, "nextStep: ${getPinCode()}", Exception("Give me a stacktrace"))
model.nextStep(getPinCode())
pinTexts.forEach { it.clearText() }
}
More information about the Android
mailing list