1

I have HorizontalScrollView on left and right of that two ImageView are there.

on Extreme left scroll left image view should hide and on extreme right scroll Right side ImageView should hide. I there any event listner for HorizontalScrollView to detect whether there is no scope to scrll right or left.

Code of in xml as below

         <HorizontalScrollView 
         android:id="@+id/HorrisontalScrollView"
         android:fillViewport="true"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:fadingEdge="none" 
         android:scrollbars="none"
         android:layout_alignParentBottom="true"
        >       
//some images to be scroll

 </HorizontalScrollView>


<ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/LeftArrrow"
            android:background="@drawable/nav_arrow_left"
            android:layout_alignParentLeft="true"
            android:layout_alignParentBottom="true"
            ></ImageView>
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/LeftArrrow"
            android:layout_alignParentRight="true"
            android:background="@drawable/nav_arrow_right"
            android:layout_alignParentBottom="true"
            ></ImageView>
dnana
  • 151
  • 1
  • 3
  • 14

2 Answers2

1

You can make a subclass of HorizontalScrollView and override the onOverScrolled method. See this link: HorizontalScrollView#onOverScrolled

Paolo Bernasconi
  • 1,890
  • 11
  • 32
  • 54
gysyky
  • 460
  • 5
  • 13
1

You need to first detect scroll end for help click this link

then animate the images as you want.

Community
  • 1
  • 1
Ali Imran
  • 8,249
  • 3
  • 35
  • 46