Fix selection/unselection when using badges #271
Merged
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.
When using badges, an extra FrameLayout is inserted as the container
for each tab. This container inherits the tag of the pre-badge tab view,
but the tag is not reset on the pre-badge tab view. This causes selection
and unselection of tabs to fail because findViewWithTag will erroneously
find the now obsolete tab views when searching for active tabs, resulting
in multiple tabs being visually selected when changing tabs.
By clearing the tag of the old (now inner) view when putting it in the new
tab container, we can ensure that findViewWithTag will only find relevant
views.
This fixes #266.