Obsolete
Status Update
Comments
sh...@gmail.com <sh...@gmail.com> #2
I face with the same problem. I have different pageMargin in landscape and portrait and when viewpager is scrolled for the more than first position, after rotating device it is shifted.
I beleive the problem is inside onSizeChanged that is called after onConfigurationChanged, it has following code:
if (w != oldw) {
recomputeScrollPosition(w, oldw, mPageMargin, mPageMargin);
}
w always not equals oldw when changing orientation, so recomputeScrollPosition is called, but whit the same values for margin and oldMargin.
This should be fixed.
I beleive the problem is inside onSizeChanged that is called after onConfigurationChanged, it has following code:
if (w != oldw) {
recomputeScrollPosition(w, oldw, mPageMargin, mPageMargin);
}
w always not equals oldw when changing orientation, so recomputeScrollPosition is called, but whit the same values for margin and oldMargin.
This should be fixed.
be...@gmail.com <be...@gmail.com> #3
[Comment deleted]
sp...@google.com <sp...@google.com> #4
I found the same problem in suport library v4, wrong align happens only when ViewPager has a page margin > 0.
Description
If "cancel" is selected at that point, no callback (onAuthenticationError / onAuthenticationFailed / onAuthenticationSucceeded) is being triggered.
When looking at the application logs I see this warning, which may be related:
I/BiometricPrompt: onDialogDismissed: 2
W/Binder: Caught a RuntimeException from the binder stub implementation.
java.lang.NullPointerException: Attempt to read from field 'java.util.concurrent.Executor android.hardware.biometrics.BiometricPrompt$ButtonInfo.executor' on a null object reference
at android.hardware.biometrics.BiometricPrompt$1.onDialogDismissed(BiometricPrompt.java:738)
at android.hardware.biometrics.IBiometricServiceReceiver$Stub.onTransact(IBiometricServiceReceiver.java:179)
at android.os.Binder.execTransactInternal(Binder.java:1195)
at android.os.Binder.execTransact(Binder.java:1159)
BUILD INFO
- Device type: Galaxy S20 5G OS11
- OS version: Android 11
- Biometric library version: 1.1.0
STEPS TO REPRODUCE
[Be as specific as possible please]
1. Run phone
2. Set FaceID
3. Run project
4. Tab button
5. Authenticating using face biometrics
6. Cancel the Confirm dialog
EXPECTED RESULTS
callback (onAuthenticationError / onAuthenticationFailed / onAuthenticationSucceeded) is being triggered.
OBSERVED RESULTS
no callback (onAuthenticationError / onAuthenticationFailed / onAuthenticationSucceeded) is being triggered.
NUMBER OF TIMES YOU WERE ABLE TO REPRODUCE (e.g. 3/10)
Always
My codes:
fun authenticate(fragment: Fragment, listener: AuthenticateListener) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
return
}
val executor = Executors.newSingleThreadExecutor()
val biometricPrompt = BiometricPrompt(fragment, executor,
object : BiometricPrompt.AuthenticationCallback() {
override fun onAuthenticationError(
errorCode: Int,
errString: CharSequence
) {
super.onAuthenticationError(errorCode, errString)
listener.onAuthenticationError(errorCode, errString)
}
override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
super.onAuthenticationSucceeded(result)
listener.onAuthenticationSucceeded(result)
}
override fun onAuthenticationFailed() {
super.onAuthenticationFailed()
listener.onAuthenticationFailed()
}
})
val promptInfo = BiometricPrompt.PromptInfo.Builder()
.setTitle(fragment.getString(R.string.lib_payment_text_uqpay_biometricauthentication_title))
.setDescription(fragment.getString(R.string.lib_payment_text_uqpay_biometricauthentication_description))
.setConfirmationRequired(true)
.setAllowedAuthenticators(BIOMETRIC_STRONG or DEVICE_CREDENTIAL or BIOMETRIC_WEAK)
.build()
biometricPrompt.authenticate(promptInfo)
}