Create a thumb binder
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
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.
OK. just 2 questions:
- then always visible is off then the binded view will show only when thumb is being dragged right?
- for 'custom overlap func' are you thinking of some kind of filter?
- yes
- user can deside what do with binded views on drag complete
great thx :+1:
I push my initial work into branch thumb-binder-dev
I re-thinking design of thumb-binder:
- start/stop animation - must be called in callback when start/stop touch moving
- value func is not required, because user can set any value in callback and do with view want he/she wants.
- 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?
- if enable and/or visibility properties for thumb was changed, change them for bound view too?
- Add popup indicators in example will be great.
Nice ! I'll check it out .
is there an example how to use this?
@sandransoria, in examples find MultiSliderFragmentViewBinder