android - Pages confilicts with keyboard when ViewPager.pageTransformer use view.setTranslationY() -
i have problem when using view.settranslationy()
in viewpager.pagetransformer
when page transformed other page while soft keyboard open, 2 issue occurs:
1- focus rest on old page(is not important)
2- if keyboard hide in new page, user can't tap area of under keyboard(it seams transition fixed top of keyboard)
transformer class:
public class verticalpagetransformer implements viewpager.pagetransformer { @override public void transformpage(view view, float position) { final float width = view.getwidth(); final float height = view.getheight(); view.settranslationy(0); view.setalpha(position <= -1f || position >= 1f ? 0f : 1f); view.settranslationx(width * -position); float yposition = position * height; view.settranslationy(yposition); } }
it fixed getting height display screen:
final float height = resources.getsystem().getdisplaymetrics().heightpixels;
Comments
Post a Comment