1. AC Question's Avatar
    I'm having a scrollview in my layout with a lot of views.

    Within scrollview I'm having this layout for one particular item

    <scrollview>
    ...
    <FrameLayout>
    <View1/>
    <View2 hidden/>
    </FrameLayout>
    ...
    </scrollview>

    ____________ ____________
    | | | |
    | | | View 2 |
    | View 1 | | |
    | | | |
    | | ----------------------
    -----------------------
    I'm animating the views like this:

    On some action: Sliding the view View1 out and View2 in (hiding the view1)
    On some other action: Sliding the view View2 out and View1 in (hiding the view2)
    My problem is: On doing these actions, the scrollview is scrolling automatically (which is not looking good).

    Probably the cause is : changing the visibility of the views.

    I tried two things:

    Disabling vertical scrolling but that didn't help
    Remembering the scrollY in onAnimationStart and restoring this scroll position in onAnimationEnd - problem with this approach is, its visible clearly that the scrollview moved (although it moved really fast).

    This idea came to my mind, but i didn't know how to implement this: Keeping the upper views (wrt the framelayout) as it is and shifting the lower views to fill up the space, so that vertical scrollY value remains the same.

    Is there a way I can implement this? If not, is there any other way i can achieve this?
    06-04-2015 10:58 AM

Similar Threads

  1. Replies: 7
    Last Post: 06-04-2015, 03:08 PM
  2. Replies: 3
    Last Post: 06-04-2015, 02:56 PM
  3. How do I stop my S6 Edge from continuously making an alert tone. ...?
    By AC Question in forum Samsung Galaxy S6 edge
    Replies: 1
    Last Post: 06-04-2015, 11:18 AM
  4. Replies: 1
    Last Post: 06-04-2015, 11:11 AM
  5. Replies: 0
    Last Post: 06-04-2015, 10:14 AM
LINK TO POST COPIED TO CLIPBOARD