This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Prototypical Cell Cache for IsEnabled testing; UITest #1153
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
samhouts
changed the title
Prototypical Cell Cache for IsEnabled testing; UITest
[Android] Prototypical Cell Cache for IsEnabled testing; UITest
Sep 26, 2017
kingces95
commented
Sep 27, 2017
@@ -309,6 +311,68 @@ public override AView GetView(int position, AView convertView, ViewGroup parent) | |||
return layout; | |||
} | |||
|
|||
internal void InvalidatePrototypicalCellCache() | |||
{ | |||
_prototypicalCellByTypeOrDataTemplate.Clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: Invalidate the cache if the DataTemplateSelector
changes. For now, just wanna get this in while I have a CI baseline.
kingces95
commented
Sep 27, 2017
var templatedItems = GetTemplatedItemsListForPath(indexPath); | ||
return templatedItems.UpdateContent(protoCell, indexPath); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will rename indexPath
to index
and ForPath
to ForIndex
before merging. For now, leave as is so as not to trigger another test run.
kingces95
requested review from
rmarinho and
samhouts
and removed request for
rmarinho
September 27, 2017 16:15
rmarinho
approved these changes
Sep 28, 2017
PureWeen
pushed a commit
that referenced
this pull request
Oct 24, 2019
PureWeen
pushed a commit
that referenced
this pull request
Oct 24, 2019
mattleibow
pushed a commit
that referenced
this pull request
Jan 28, 2021
Fix to fatal iOS 13 memory leak when using TextToSpeach.SpeekAsync #1112
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
Expect checking if a cell is enabled does not always create a new view. Actually, before the stop gap fix, we had been creating a new view, binding, then checking if the view is enabled. As views are checked all the time to see if they are enabled this was a big leak.
The stop gap fix, which this fix replaces, was to create and cache a new view,
_enabledCheckCell
, and rebind that view to determine if a cell is enabled. That worked fine so long as all cells used the same type of view to render themselves. However, when aDataTemplateSelector
is used, then different cells can use different views so its not sufficient to cache a single view.This fix caches the correct view for a given type of cell which can be repeatedly rebound and checked to see if it's enabled. How the type of a cell is determined depends on the caching strategy.
Bugs Fixed
None; Discovered while fixing iOS caching.
API Changes
None
Behavioral Changes
None
PR Checklist