AnderWeb / discreteSeekBar

Apache License 2.0
2.11k stars 400 forks source link

Add attr to always show indicator #30

Closed almozavr closed 9 years ago

almozavr commented 9 years ago

Sometimes, we want floating indicator to stay visible

AnderWeb commented 9 years ago

I think the idea is good, but maybe we should use a different implementation:

Currently, the indicator is shown inside a popup window, and if we want it always visible, it will create multiple popup windows than will be all over the layout (imagine scrolling contents, etc).

If we want an "always visible" indicator, we could just add the Floater view class to the layout instead of a popup window.

almozavr commented 9 years ago

I doubt popup which is already visible on screen, won’t be recreated. Also, during sample and in-product tests I haven’t seen multiple popups. Have you run the sample?

On Tue, Jun 2, 2015 at 1:13 PM AnderWeb notifications@github.com wrote:

I think the idea is good, but maybe we should use a different implementation:

Currently, the indicator is shown inside a popup window, and if we want it always visible, it will create multiple popup windows than will be all over the layout (imagine scrolling contents, etc).

If we want an "always visible" indicator, we could just add the Floater view class to the layout instead of a popup window.

— Reply to this email directly or view it on GitHub https://github.com/AnderWeb/discreteSeekBar/pull/30#issuecomment-107906776 .

AnderWeb commented 9 years ago

if you modify your sample to use app:dsb_alwaysShowIndicator="true" on all the DiscreteSeekBar components you'll see the issues: -Every DiscreteSeekBar adds a PopupWindow (instead of just inflating the bubble making room inside the DiscreteSeekBar layout) -If the DiscreteSeekBar is inside a scroll container, the floater will remain fixed.

almozavr commented 9 years ago

Thanks for pointing out – I'll look around to fix the issue.

AnderWeb commented 9 years ago

The "proper" solution would be making DiscreteSeekBar extend from ViewGroup. Then, if the alwaysShowIndicator flag is enabled, it would create and add the Floater to itself taking care of measuring/layout/positioning. Else, it would behave as usual, creating the Popup with the Floater inside. Please open a improvement issue and we'll try to do it for a future release.