0

I need to implement a fragment which an image view and below that multiple options each with a toggle button and each option have 2 seek bars. So if user disables the toggle button, in that case, that view of 2 seek bar will collapse in such a way that total length of the complete fragment will decrease in the same amount.

So if all the toggle buttons are disabled in starting and a total height of fragment is half of the screen in starting and if a user enables any toggle button, the seek bar view will be visible and height of fragment will also be increased by the same amount. and of course there is a limit on the max height and after that view will scroll.

Can someone help me if any UI lib is available for this? or any idea how it can be implemented?

Adding Image for help to understand problem: **First Image which have one seekbar enabled and view size increased**

Above First Image which have one seekbar enabled and view size increased **With all seek bars disabled and minimum size**

Above Second Image With all seek bars disabled and minimum size

RATHI
  • 5,129
  • 8
  • 39
  • 48
  • Check this link for resizing views. http://stackoverflow.com/questions/8140571/resizing-layouts-programatically-as-animation – Cedric Franck Feb 23 '17 at 12:53
  • but it doesn't apply the size reduction on both the view. How to reduce height of complete fragment height and that view height at the same time.. – RATHI Feb 23 '17 at 13:16
  • can't you apply the reduction to the fragment's view too? by using Fragment.getView() – Cedric Franck Feb 23 '17 at 13:22
  • Set the height of your fragment to WRAP_CONTENT, then as you set the visibility of your views to GONE the height of the fragment should respond accordingly. – Charlie Feb 23 '17 at 13:39

0 Answers0