Stop social update view from stealing focus.
ContactDetailFragmentCarousel was requesting focus to set the initial offset of the HorizontalScrollView. This was probably a hacky work around to get the smoothScrollTo() method to work. Instead of requesting focus, call scrollTo(). Before scrollTo() did not work in the enableSwipe() method because HorizontalScrollView "clamp"s the offset to the size of the width. And the size of the width was calculated based on mEnableSwipe flag in the onMeasure() method. To fix it so scrollTo() works within enableSwipe(), change the width calculation to also take into account mCurrentPage which may be initialized to 1 instead of 0. Old order + onMeasure() [mEnabledSwipe = false, width set for a single child] + enableSwipe() [mEnabledSwipe = true, width still set for a single child] + scrollTo() [page 1, fails because width set for a single child] New logic + onMeasure() [mCurrentPage = 1, width set for 2 childs] + enableSwipe() + scrollTo() [page 1, suceeds] Bug: 8157306 Change-Id: I3a693a0b3d43a68d251faea4b5805791f2316aaa
Loading
Please register or sign in to comment