Bug 39417 - ListView items appear to be entered out of order when section is hidden
Summary: ListView items appear to be entered out of order when section is hidden
Status: RESOLVED INVALID
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 1.3.3
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-03-07 16:26 UTC by Cody Beyer (MSFT)
Modified: 2016-03-17 07:53 UTC (History)
3 users (show)

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


Attachments
Sample (287.66 KB, application/zip)
2016-03-07 16:28 UTC, Cody Beyer (MSFT)
Details
Updated Sample (64.69 KB, application/zip)
2016-03-16 15:02 UTC, Cody Beyer (MSFT)
Details


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 INVALID

Description Cody Beyer (MSFT) 2016-03-07 16:26:51 UTC
# Description

The following sample demonstrates a potential issue, where adding an item to a ListView will result in the item being inserted at an incorrect position, if the section is out of range of the view

# Sample

Attached

# Video

https://www.dropbox.com/s/flbn6jn9clzgv8b/ListViewRnd.mov?dl=0

# Steps to Reproduce

1. Download sample
2. Deploy to Android
3. Hit the add buttons in an alternating manner
4. Repeat step three until list is long enough to extend well beyond the view
5. Scroll to reveal out of view range items

# Expected Results

Scrolling down should reveal a continuation of the blue > yellow > blue > yellow pattern

# Actual Results

The pattern is interrupted, with yellow and blue repeating at differing intervals

# Versions

Microsoft Visual Studio 2015
Version 14.0.24720.00 Update 1
Microsoft .NET Framework
Version 4.6.01055

Installed Version: Community

Visual Basic 2015   00322-20000-00000-AA067
Microsoft Visual Basic 2015

Visual C# 2015   00322-20000-00000-AA067
Microsoft Visual C# 2015

Visual C++ 2015   00322-20000-00000-AA067
Microsoft Visual C++ 2015

Visual F# 2015   00322-20000-00000-AA067
Microsoft Visual F# 2015

Application Insights Tools for Visual Studio Package   4.2.60128.3
Application Insights Tools for Visual Studio

Common Azure Tools   1.5
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JetBrains ReSharper Ultimate 10.0.2   Build 104.0.20151218.120627
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2016 JetBrains, Inc.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager   3.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

TypeScript   1.7.6.0
TypeScript for Microsoft Visual Studio

Visual Studio Tools for Universal Windows Apps   14.0.24720.00
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Xamarin   4.0.1.145 (f869dba)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   6.0.2.1 (46c3f7e)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   9.4.2.24 (49ba15e)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 Cody Beyer (MSFT) 2016-03-07 16:28:11 UTC
Created attachment 15289 [details]
Sample
Comment 2 Jason Smith [MSFT] 2016-03-13 11:15:01 UTC
This does not happen on modern versions of Forms.
Comment 3 toSilence 2016-03-15 07:49:12 UTC
Modern suggests that we are using an very old version.
But we are using Xamarin.Forms 1.5.0.6446 from 09/16/2015 (when we started developing our app).

Please suggest a stable Xamarin (Forms) version where this problem is working.

Thank you
Comment 4 Cody Beyer (MSFT) 2016-03-16 15:00:16 UTC
Attached is a new sample, updated to 2.1.x of Xamarin.Forms. The issue occurs in this sample as well.
Comment 5 Cody Beyer (MSFT) 2016-03-16 15:02:23 UTC
Created attachment 15429 [details]
Updated Sample
Comment 6 Jason Smith [MSFT] 2016-03-16 17:37:54 UTC
MyImageRenderer is not updating MyImageView with the new Element when OnElementChanged is called during re-use, so when re-use happens its retaining the old image. Effectively this renderer doesn't re-use correctly
Comment 7 toSilence 2016-03-17 07:53:11 UTC
@JasonSmith
Please provide an corrected example of the OnElementChanged method.

I'm not sure what you mean with 're-use'. Do you mean it has something to do with Caching:
https://developer.xamarin.com/api/type/Xamarin.Forms.ListViewCachingStrategy/