Open edualonso opened 9 years ago
I have solved it adding a flag, and modifying the onSizeChanged method:
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
destination.top = 0;
destination.bottom = overrideBackgroundResize ? h : oldh;
if (overrideBackgroundResize) {
super.onSizeChanged(w, h, oldw, oldh);
} else {
overrideBackgroundResize = true;
super.onSizeChanged(oldw, oldh, oldw, oldh);
}
if (getAdapter() != null && bitmap != null) {
calculateParallaxParameters();
}
}
Every time we want to override the pager's drawing behavior, we simply change the "overrideBackgroundResize" flag.
Great job, thanks! Submit a PR and I'll merge it.
Hi. It seems that every time the soft keyboard pops up, the method onSizeChanged is called and the background resource drawn again, which means that the image will sqeeze vertically. It would be nice if the pager included a "allowBackgroundResize(boolean allow)" method, so we could disable it if, for example, the keyboard pops up.