Assigned
Status Update
Comments
ni...@ngo.org.uk <ni...@ngo.org.uk> #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.
Description
Component used: appcompat-lint Version used: 1.6.1
The following code works as expected, and triggers a lint warning (https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:appcompat/appcompat-lint/src/main/kotlin/androidx/appcompat/res/DrawableLoadingDetector.kt ):
The lint warning suggests replacing that with:
However, if
ContextCompat
is used there is no lint warning:Looking at the appcompat code,
AppCompatResources.getDrawable()
does more thanContextCompat.getDrawable()
, so I was expecting it to also be a candidate for the lint warning.