Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed height ChipsView does not scroll #8

Closed
jlindenbaum opened this issue Mar 16, 2016 · 3 comments
Closed

Fixed height ChipsView does not scroll #8

jlindenbaum opened this issue Mar 16, 2016 · 3 comments

Comments

@jlindenbaum
Copy link

When setting the layout_height to a fixed height, instead of wrap_content it's not possible to scroll through the chips added.

EDIT
It's easy to wrap the ChipsView in a ScrollView with a fixed height, and setting the ChipsView to match_parent. This almost gives the desired result. An odd case where if the scroll view is not scrolled it is not possible to remove chips, the second "remove" tap is swallowed. A work around is to fullScroll(VIEW.FOCUS_DOWN) on the containing scroll view each time a chip is added in the ChipsListener call back. This properly allows the removal of chips again.

I stepped through this in the debugger a bit, and it's a difficult problem to express. If the ChipsView is contained in a ScrollView the unSelectChipsExcept() function acts up. It always marks all chips as unselected, but the UI never updates to reflect that. The chip remains visually selected, but its selected flag is set to false. For whatever reason this is mitigated when the ScrollView is scrolled.

@jlindenbaum
Copy link
Author

For anyone else with issues of having a ChipsView inside a ScrollView the issue with the removal of the chips was not being triggered properly due to the ScrollView consistently giving focus back to the EditText within the ChipsView, this would mark all chips as unselected (bot not update the UI to reflect that).

This SO worked for me, ensuring the surrounding ScrollView does not give focus back to the EditText unless a user explicitly taps it. http://stackoverflow.com/questions/5375838/scrollview-disable-focus-move

@myacxy
Copy link
Contributor

myacxy commented Apr 8, 2016

Hey @jlindenbaum,
thanks for your feedback. Due to your suggestions we decided to make the ChipsView itself a ScrollView. Therefore you should consider that you do not need to wrap it in your own ScrollView anymore after you upgrade to the new version and use app:cv_max_height="${dimension}" instead.

@myacxy myacxy closed this as completed Apr 8, 2016
@LTroya
Copy link

LTroya commented Jun 15, 2016

Is there a way to disable the scroll? I have two chipViews and I only want to add chips for the second one while the first one only has one not editable chip

In the meantime, I disabled with this http://stackoverflow.com/questions/18893198/how-to-disable-and-enable-the-scrolling-on-android-scrollview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants