MultiSlider icon indicating copy to clipboard operation
MultiSlider copied to clipboard

Create a thumb binder

Open djodjoni opened this issue 9 years ago • 8 comments

This should be a separate module that will help binding a specific view to a thumb, so when the thumb moves the View moves with it. Here is a few possible attr :

  • text value id - refference of the text field that will be used to set the current value
  • value func - value function that will transform the value to be displayed to the user
  • tint
  • x,y - relative to the thumb position
  • move lag - if the View does not immediately moves with the thumb but waits
  • animationOpen
  • animationClose

the list is definitely not exhaustive nor the names are stable

djodjoni avatar Jan 23 '17 12:01 djodjoni

add options:

  • always visible
  • overlap mode - this option must be used when always visible enabled. Modes:
    • default: adjust neighbours by width, fix x-offset and hide all views in the middle
    • draw the latest moved thumb on the top
  • custom overlap func - user's func for stack, visibility and etc. Disable overlap modes, require always visible enabled too.

bmx666 avatar Feb 10 '17 00:02 bmx666

OK. just 2 questions:

  1. then always visible is off then the binded view will show only when thumb is being dragged right?
  2. for 'custom overlap func' are you thinking of some kind of filter?

djodjoni avatar Feb 10 '17 09:02 djodjoni

  1. yes
  2. user can deside what do with binded views on drag complete

bmx666 avatar Feb 10 '17 10:02 bmx666

great thx :+1:

djodjoni avatar Feb 10 '17 12:02 djodjoni

I push my initial work into branch thumb-binder-dev

I re-thinking design of thumb-binder:

  1. start/stop animation - must be called in callback when start/stop touch moving
  2. value func is not required, because user can set any value in callback and do with view want he/she wants.
  3. overlap mode is very hard to design for neighbours with adjustment by width:
    • for every thumbs user must set left and right neighbours
    • if thumb is first, then use left neighbour as parent view ?
    • if thumb is last, then use right neighbour as parent view ?
    • hide neighbours in the middle - change visibility to GONE?
  4. if enable and/or visibility properties for thumb was changed, change them for bound view too?
  5. Add popup indicators in example will be great.

bmx666 avatar Mar 29 '17 23:03 bmx666

Nice ! I'll check it out .

djodjoni avatar Apr 03 '17 13:04 djodjoni

is there an example how to use this?

sandransoria avatar Sep 29 '17 11:09 sandransoria

@sandransoria, in examples find MultiSliderFragmentViewBinder

bmx666 avatar Sep 29 '17 11:09 bmx666