Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrollbar isn't showing #41

Closed
Nxt3 opened this issue Apr 27, 2016 · 10 comments
Closed

Scrollbar isn't showing #41

Nxt3 opened this issue Apr 27, 2016 · 10 comments

Comments

@Nxt3
Copy link

Nxt3 commented Apr 27, 2016

No matter what I do, I simply can't get the MaterialScrollBar to show.

I've tried using the XML way of inserting the scrollbar and the programmatic way.

Here is my XML

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?attr/activity_background">

    <me.ccrama.redditslide.Views.GeneralSwipeRefreshLayout
        android:id="@+id/activity_main_swipe_refresh_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <android.support.v7.widget.RecyclerView
                android:id="@+id/vertical_content"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:scrollbars="vertical" />

            <com.turingtechnologies.materialscrollbar.TouchScrollBar
                android:id="@+id/dragScrollBar"
                app:recyclerView="@id/vertical_content"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                app:lightOnTouch="true"
                app:barThickness="4"
                android:layout_alignParentTop="true"
                android:layout_alignParentEnd="true" />
        </RelativeLayout>

    </me.ccrama.redditslide.Views.GeneralSwipeRefreshLayout>
</FrameLayout>

And here is how I would create it in the class:

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        LayoutInflater localInflater = inflater.cloneInContext(contextThemeWrapper);
        v = localInflater.inflate(R.layout.fragment_verticalcontenttoolbar, container, false);

        rv = ((RecyclerView) v.findViewById(R.id.vertical_content));
        TouchScrollBar msb = new TouchScrollBar(getActivity(), rv, true);

        rv.setLayoutManager(mLayoutManager);
        rv.getLayoutManager().scrollToPosition(0);
        doAdapter(); //sets the adapter on rv
        return v;
    }

No matter what--nothing shows. What am I doing wrong?

@turing-tech
Copy link
Owner

I have a couple of idea that I can try. Give me a bit and I'll see what's going on.

@Nxt3
Copy link
Author

Nxt3 commented Apr 27, 2016

Thank you!

@turing-tech
Copy link
Owner

I just double-checked and in theory that setup should work. If you'd like to provide more of the code about how the fragment is created and included I'd be happy to troubleshoot further.

@Nxt3
Copy link
Author

Nxt3 commented Apr 27, 2016

Source can be found here.

@Nxt3
Copy link
Author

Nxt3 commented Apr 29, 2016

Any ideas?

@turing-tech
Copy link
Owner

Yeah, sorry. I've been really busy. I'm going to look at it this afternoon.

@Nxt3
Copy link
Author

Nxt3 commented Apr 29, 2016

No worries, I totally understand.

@turing-tech
Copy link
Owner

So for the programmatic case it is being added but it just can't be seen. (You can drag on the right side of the rv and get a drag out of it) To be frank I can't really debug that for you since the adapter alone is over 3000 lines. What I suspect is happening is that somewhere the scroll detection is failing or has been replaced or the view is being hidden somehow. If you'd like to fork this lib and test out changes by disabling some of the fade out and hide features to make sure the lib isn't hiding itself for some reason I'd suggest doing so. I wish you luck, and sorry I can't be more helpful.

@Nxt3
Copy link
Author

Nxt3 commented Apr 30, 2016

Don't worry about it! I appreciate your comments on it though. Hopefully I can figure it out. That isn't my code so I'm as unfamiliar with it as you are. :P

Again, thank you--take care!

@turing-tech
Copy link
Owner

Best of luck :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants