L4Digital / FastScroll

A ListView-like FastScroller for Android’s RecyclerView.
Apache License 2.0
901 stars 75 forks source link

Bubble not appearing #9

Closed myinnos closed 7 years ago

myinnos commented 7 years ago

Scroll view works well as name said fast scroller, but bubble view is not showing at all on scroll!

 @Override
    public String getSectionText(int position) {
        return "some text";
    }
randr0id commented 7 years ago

If the bubble doesn't show at all it's most likely that the adapter implementing the FastScroller.SectionIndexer wasn't setup correctly. Can you post snippets from your xml layout and where you are setting the adapter to the FastScrollRecyclerView?

myinnos commented 7 years ago
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <include android:id="@+id/standard_toolbar" layout="@layout/standard_toolbar" />

 <com.l4digital.fastscroll.FastScrollRecyclerView
        android:id="@+id/recyclerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@id/standard_toolbar"
        app:bubbleColor="#00bb00"
        app:bubbleTextColor="#ffffff"
        app:handleColor="#999999"
        app:trackColor="#bbbbbb"
        app:hideScrollbar="false"
        app:showTrack="false" />

</RelativeLayout >
randr0id commented 7 years ago

I used your layout for the example project and the bubble appeared correctly (attached screenshot). Take a look at how the example project implements FastScroll to see if there are any differences with your implementation.

screenshot
myinnos commented 7 years ago

Base Activity

@BindView(R.id.recycler_view)
 FastScrollRecyclerView recyclerView;

       recyclerView.setHasFixedSize(true);
       recyclerView.setLayoutManager(new LinearLayoutManager(this));
       recyclerView.setAdapter(new UserAppsAdapter(getAppsList(), recyclerView));

Adapter class

public class UserAppsAdapter extends RecyclerView.Adapter<UserAppsAdapter.ViewHolder> implements FastScroller.SectionIndexer {

 @Override
    public String getSectionText(int position) {
        return "test";
    }

Let me know if any thing missed out!

randr0id commented 7 years ago

I don't see any issues with this code, except for passing the recyclerView into the adapter constructor seems unnecessary.

When scrolling, are you seeing the scrollbar handle? If so, when touching the handle to fastscroll the bubble should appear.

myinnos commented 7 years ago

Your awesome, exactly as you said, the bubble is appearing when i touching the handle.

Then how can i resolve now!

randr0id commented 7 years ago

Great! I'll close this issue.

myinnos commented 7 years ago

How you closed this issue! still need to resolved, even text also not showing inside bubble

randr0id commented 7 years ago

Your last comment said the bubble was now appearing, which resolves the original issue. This is the intended behavior.

If the adapter is implemented correctly, the text will show in the bubble. Take a look at the example module to see how it is implemented.

myinnos commented 7 years ago

I Have Question ? Is bubble will show only when user touch on scroll ? if yes my issue resolved 👍

or Even when user scroll view if bubble appears 🥇 ?

randr0id commented 7 years ago

Yes, the bubble only appears when the user touches the scroll handle as intended.

myinnos commented 7 years ago

Thanks! 🥇 awesome 💯! My issue resolved 👍

karthickperumal commented 7 years ago

@randr0id Hi I am getting Java.lang.StringIndexOutOfBoundsException: length=0; index=0 error on scrolling.Kindly give me the solution.

randr0id commented 7 years ago

@karthickperumal I need more context or a stacktrace. From the error you provided it looks like you're​ trying to access a character by index on an empty String, and I don't think there is code that does that in the library (there is in the example).