1

I have a bit of a problem with the SliderView I created. The sliderview can not be scrolled at the same time as the recyclerview. I've tried adding ScrollView but it still seems to be still.

Here is the layout:

fragment_home.xml

<FrameLayout 
    <android.support.v4.widget.SwipeRefreshLayout
        <LinearLayout
        <RelativeLayout
            <RelativeLayout
                <FrameLayout
                    <com.mimdudin.carekkerje.Activities.SliderView
                </FrameLayout>
            <View />
            <LinearLayout
        </RelativeLayout>
        <android.support.v7.widget.RecyclerView
        </RelativeLayout>
        </LinearLayout>
    </android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout>

How can I resolve this?

grizzthedj
  • 7,131
  • 16
  • 42
  • 62
Kitereative Indonesia
  • 1,097
  • 6
  • 19
  • 39
  • Please be more specific and give more detail. Does your SliderView works vertically or horizontally? What is your main problem? What do you want to achieve exactly? – Oğuzhan Döngül Feb 04 '18 at 07:09
  • My SliderView works horizontally, underneath there is a recyclerview. when i scrolled, this sliderview is not hide. I want to when to scrolling, the imageslider will hide @OğuzhanDöngül – Kitereative Indonesia Feb 04 '18 at 07:58

1 Answers1

2

As I understand, your achievement is hiding, scrolling or collapsing your SliderView which is placed above your RecyclerView.

You have different options here. Choose one of them and make some research, you can find lots of documentations and tutorials about them.

  1. Add your SliderView as an item of RecyclerView and add it to first position. (like a HeaderView used in ListView)
  2. Use CollapsingToolbarLayout and put your SliderView as a collapsable view when the RecyclerView scrolls to bottom and expands when you scroll to top.
  3. You can use CoordinatorLayout behaviors to hide and show your slider with animations according to RecyclerView scrolling statuses.
  4. Use NestedScrollView and put your SliderView and RecyclerView inside.(setting nestedScrollingEnabled true/false is the trick)
Oğuzhan Döngül
  • 7,856
  • 4
  • 38
  • 52