Bug 27088 - Component Support Library Issue on HorizontalScrollView
Summary: Component Support Library Issue on HorizontalScrollView
Status: RESOLVED ANSWERED
Alias: None
Product: Components
Classification: Xamarin
Component: Xamarin Components ()
Version: Production (addons.xamarin.com)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jon Dick
URL:
Depends on:
Blocks:
 
Reported: 2015-02-16 04:22 UTC by cheansiong
Modified: 2015-12-22 21:16 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description cheansiong 2015-02-16 04:22:50 UTC
Precondition
1. Use Component Android Support Library v4
2. Has HorizontalScrollView in your layout

Recently, our project perform the upgrade to target Lollipop. However, the part that has the above conditions do not work after rotate. I created a sample project that could simulate this issue.

Steps to reproduce:
1. Run the application.
2. Slide the horizontal scroll view to the right most.
3. Rotate the device at any time, the horizontal scroll view will reset to the left.

PS: When i tries to add a id to the HorizontalScrollView, suddenly the scrollView will scroll to correct position after rotate. In my case, I have my scrollView with the id specified, but the scrollView still do not scroll to correct position and I still have other issues related to the HorizontalScrollView, therefore, I could not use this as a solution.

This is working earlier in the previous version before the new component Android Support Library v4 is added. The reason it is added is a lot of warning is shown after the build, and suggested us to update it.

A description with sample project to reproduce is also available here:
http://forums.xamarin.com/discussion/33163/component-support-library-issue-on-scrollview
Comment 1 David Humphreys 2015-12-22 21:16:17 UTC
This seems to be a bug with the android library not the component directly.

There is a work around as listed in the forum post

Basically is to ignore the reset of HorizontalScrollView when OnLayoutChange in HorizontalScrollView and save the Scroll X and Y in OnSavedInstanceState.