Assigned
Status Update
Comments
rb...@ergon.ch <rb...@ergon.ch> #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.
rb...@ergon.ch <rb...@ergon.ch> #3
[Comment deleted]
st...@webcomm.com.tw <st...@webcomm.com.tw> #4
I found the same problem in suport library v4, wrong align happens only when ViewPager has a page margin > 0.
rb...@ergon.ch <rb...@ergon.ch> #5
[Comment deleted]
rb...@ergon.ch <rb...@ergon.ch> #6
The issue is still reproducible in support library v4 (rev. 18).
I managed to fix the issue by importing the source code of ViewPager in my project and modifying from onSizeChanged method the following line:
From:
if (w != oldw) {
recomputeScrollPosition(w, oldw, mPageMargin, mPageMargin);
}
To:
if (w != oldw) {
recomputeScrollPosition(w, oldw, 0, 0);
}
I managed to fix the issue by importing the source code of ViewPager in my project and modifying from onSizeChanged method the following line:
From:
if (w != oldw) {
recomputeScrollPosition(w, oldw, mPageMargin, mPageMargin);
}
To:
if (w != oldw) {
recomputeScrollPosition(w, oldw, 0, 0);
}
rb...@ergon.ch <rb...@ergon.ch> #7
I use this little wrapper as a work around for the bug:
ublic class FixedViewPager extends ViewPager {
public FixedViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
}
public FixedViewPager(Context context) {
super(context);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w-this.getPageMargin(), h, oldw-this.getPageMargin(), oldh);
}
}
ublic class FixedViewPager extends ViewPager {
public FixedViewPager(Context context, AttributeSet attrs) {
super(context, attrs);
}
public FixedViewPager(Context context) {
super(context);
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w-this.getPageMargin(), h, oldw-this.getPageMargin(), oldh);
}
}
sp...@google.com <sp...@google.com> #8
Thanks for posting the workaround. Works great. Can't believe this issue still exists after almost 2 years since it's been reported.
rb...@ergon.ch <rb...@ergon.ch> #9
Greats !!
Description
- A bugreport immediately after the issue occurs.
- Sample project to trigger the issue.
- A screenrecord or screenshots showing the issue (if UI related).
BUILD INFO
- Device type: Pixel 5
- OS version: Android 12(SQ1A.220105.002)
- Biometric library version: androidx.biometric:biometric:1.1.0
My test app flow REG button keystore create user key, and AUTH button use cryptobject sign data,
In android 12 pixel 5, when i delete fingerprint and still have other fingerprints,
go back to test App press Auth button then occur user not authencatied exception,
even i press Reg button create again but Auth button still have user not authencatied issue,
Unless i delete all fingerprints and add new fingerprint the issue not produce again.
In previous android version key only invalid when a new fingerprint added.
STEPS TO REPRODUCE (Use attachments test app)
[Be as specific as possible please]
1. add N(N >= 2) fingerprints
2. press REG button -> OK
3. press AUTH button -> OK
4. delete one fingerprint(make sure other fingerprints still exists)
5. press AUTH button -> user not authencatied
6. press REG button -> OK
7. press AUTH button -> user not authencatied
EXPECTED RESULTS
auth success
OBSERVED RESULTS
user not authencatied
NUMBER OF TIMES YOU WERE ABLE TO REPRODUCE (e.g. 3/10)
Every time