7

Android: Custom Viewgroup draws children incorrectly (on old devices)

view full story
linux-howto

http://stackoverflow.com – I have implemented a custom pager that is very similar to ViewPager. It takes use of canvas to make the scrolling effect. It works as intended on new devices (Android 4.2) but it doesn't on older ones (Android 2.3). onDraw looks like Log.d(TAG, "onDraw()"); if (mSwipe != null) { Log.d(TAG, "Swipe effect=" + (mSwipe.lastX - mSwipe.startX)); canvas.translate(mSwipe.lastX - mSwipe.startX, 0); } Page current; current = getPage(mPosition); if (current != null) { if (mPosition != 0) { Log.d(TAG, "Offset effect=" + current.offset.left); (HowTos)