Code Monkey home page Code Monkey logo

fastscroll's People

Contributors

adakoda avatar antimonit avatar arsenehuot avatar radiokot avatar randr0id avatar ricknout avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fastscroll's Issues

Bubble displaying underneath custom actionbar

Hi,

I am implementing the FastScroll for a directory/contacts style app, however, I have a custom action bar/toolbar and I can't seem to get the bubble for "a" and "b" displaying as it underneath the action bar, however, the handle stops at the bottom of the action bar. Is there a style I can override that will allow the bubble to lay on top of the handle (not have a large space between the bubble and top of the scroll handle) so it isn't hidden by the action bar?

Thanks for your help :)

FastScrollRecyclerView Error

I still can't import FastScrollRecyclerView yet i have already add 'implementation "io.github.l4digital:fastscroll:2.0.1"

cannot find symbol
    private FastScrollRecyclerView recyclerView;

setSectionIndexer in FastScrollRecyclerView

Could you add setSectionIndexer to FastScrollRecyclerView?
I use common adapter for all screens and because of this limitation I have to extend the adapter for all screens I have to use the library:

 public void setSectionIndexer(FastScroller.SectionIndexer sectionIndexer) {
     mFastScroller.setSectionIndexer(sectionIndexer);
 }

Size!

Hi
Pls add size bubble setting.
Ty!

setSectionIndexer visibility

Hello! Thank you for the lovely library.
It seems like with the new 3.0.0-beta updates setSectionIndexer method is no longer exposed for FastScrollRecyclerView?
That would be nice to have one!

Ability to disable navigation by touch

Sometimes I am scrolling and I by accident touch the handle track much farther down than I am currently viewing, and it skips very far down and I lose my place. Is there a way/is it possible that you can add a way to disable navigation any other way than by dragging the handle itself? If you tell me what needs to be done and where the relevant code is, I can try and make a PR, but I am very busy, so no guarantee.

Change holdable area size for the scrollbar

On my phone, using the scrollbar is difficult because of how tiny it is. I really have to touch the edges of my phone in order to scroll properly. Is there any way to make to holdable scrollbar area bigger? I'd like to adjust the width and I can't find any documentation on doing so.

collapsible toolbar not collapsing

first of all thanks for this amazing library it's working great but in one of my screens when recycler view is scrolled using fastscroll the CollapsingToolbarLayout is not collapsing and i can not scroll till end using thumb in this case

Bubble not showing on scroll

I'm using your library and it's working really nice however I have issue showing the bar when user scroll the recyclerview

I want the bubble to appear when the user start scrolling, is it possible ?

I've implemented it that way:

<com.l4digital.fastscroll.FastScrollRecyclerView
        android:id="@+id/rv_country"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
        app:hideScrollbar="false"
        app:bubbleColor="@color/primaryLightColor"
        app:bubbleTextColor="@color/primaryTextColor"
        app:handleColor="@color/primaryDarkColor"
        tools:listitem="@layout/item_country" />
Activity:

findViewById<FastScrollRecyclerView>(R.id.recycler_view)?.apply {
    layoutManager = LinearLayoutManager(this@ExampleActivity)
    adapter = CountryAdapter()
    setBubbleVisible(true)
}


Adapter:

override fun getSectionText(position: Int): CharSequence = getItem(position).countryStripAccents[0].toString()

Ability To Adjust Handle Size

Your library is phenomenal! On the Google Contacts app, their handle for FastScroll is much bigger than the one in your library. Can you add an XML attribute to adjust the size? By the way, I thought you might appreciate the comment from this SO user who said: "We're working with this library in production with a large user base app w/o any problem."

how to use with SwipeRefreshLayout?

I can't use inside SwipdeRefreshLayout, because cant drag FastScroll.
When I do action drag FastScrollbar, refresh action begin.

<android.support.v4.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_below="@+id/fragCardlist_divider"
android:id="@+id/fragCardlist_swipe"
android:layout_width="match_parent"
android:layout_height="match_parent"
>

            <com.l4digital.fastscroll.FastScrollRecyclerView
                android:id="@+id/recycler_view"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:bubbleColor="@color/viewpager_underline"
                app:bubbleTextColor="@color/white"
                app:handleColor="@color/viewpager_underline"
                app:hideScrollbar="false"
                app:showTrack="false"
                />
        </FrameLayout>
    </android.support.v4.widget.SwipeRefreshLayout>

Conflict with other libraries in same parent layout

Problem
For the same RecyclerView I use FastScroll and sticky headers library by @bgogetap, which also uses parent layout to draw views. Because of this sticky header overlaps fast scroll bubble and scrollbar.

Proposed solution
Add fast scroll views as a params to the listener methods, so we can call .bringToFront() on them.

Separate padding left|top|right|bottom

I need of distinguishing between padding left and other paddings of fastscroll.
Now all paddings have the same value : fastscroll_scrollbar_padding.

Can you separate them with for example
fastscroll_scrollbar_padding_left
fastscroll_scrollbar_padding_top
ecc...?

Thanks

FastScroller#getScrollProportion method returns Infinity

I'm using a FastScrollRecyclerView inside a DialogFragment and whenever I manually scroll down, the thumb goes down to the bottom and sticks to the bottom. I have discovered that the problem comes from the FastScroller#getScrollProportion. Let me explain why:

final int verticalScrollOffset = recyclerView.computeVerticalScrollOffset(); // verticalScrollOffset == 120
final int verticalScrollRange = recyclerView.computeVerticalScrollRange(); // verticalScrollRange == 400
float proportion = (float) verticalScrollOffset / ((float) verticalScrollRange - mHeight); // mHeight == 400, proportion = 120 / 0 = Infinity
return mHeight * proportion; // returns Infinity

I will try to create a PR whenever I have some free time ;)

Accidental scroll jumps because of bubble width touch area on whole height

It seems that while the bubble is visible the whole vertical area (pink rectangle on screenshot) is tappable and when tapping in that area (pink circle on the screenshot) the bubble jumps to that position and with that scrolls far away from the current position.

The wider the bubble is the wider is that tappable area and accidental jumps happen easy. Would it be possible to only allow dragging the bubble (green rectangle area on screenshot) instead of making the whole vertical area tappable?
bubble_area

FastScrollRecyclerView leaks parent view

device-2019-04-23-115350
To fix crash you need to make following changes:

class FastScrollRecyclerView @JvmOverloads constructor(
    context: Context,
    attrs: AttributeSet? = null,
    defStyleAttr: Int = 0
) : FastScrollRecyclerView(context, attrs, defStyleAttr) {

    override fun onDetachedFromWindow() {
        super.onDetachedFromWindow()
        adapter = null
    }

}

RecyclerView shows handle when Filterable returns an empty list

Behavior similar to #5, the handle is shown when the adapter implements Filterable and the search filter returns an empty dataset.
As a bonus, this caused my app to crash when touching the handle in that situation, because my implementation of the getSectionText() method, calling .get() on an empty list, threw an ArrayIndexOutOfBoundsException.

I fixed implementing the following code in my class, but in my opinion this should be managed by the Fastscroller itself:

public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        MyClassBinding binding = MyClassBinding.inflate(getLayoutInflater());
        FastScrollRecyclerView recyclerView = binding.recyclerView;
        
        [... myAdapter initialization ...]

        myAdapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
                @Override public void onChanged() {
                        super.onChanged();
                        recyclerView.setFastScrollEnabled(myAdapter.getItemCount() != 0);
                }
        });

        [...]

        return binding.getRoot();
}

Bubble not appearing

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";
    }

FastScroller layout is messed up in 1.1.0

I have the following layout:

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

    <android.support.v4.widget.SwipeRefreshLayout
        android:id="@+id/swipeLayout"
        android:layout_height="match_parent"
        android:layout_width="match_parent">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/recyclerView"
            android:layout_height="match_parent"
            android:layout_width="match_parent" />

    </android.support.v4.widget.SwipeRefreshLayout>

    <com.l4digital.fastscroll.FastScroller
        app:bubbleColor="?colorAccent"
        app:handleColor="?colorAccent"
        android:id="@+id/fastScroller"
        android:layout_gravity="end"
        android:layout_height="match_parent"
        android:layout_width="wrap_content"
        app:showTrack="false" />

</FrameLayout>

which worked fine in 1.0.4. However, after upgrading to 1.1.0 the index bubble now runs off the bottom of the screen. The track and handle also run off the bottom. In addition, the bubble is offset from the handle; it's about 50% lower. The issue is also present in 1.1.1.

svid_20180615_084039_moment
svid_20180615_084039_moment 2

Auto hide for scrollbar

Is there any support in auto-hide scroll bar?
I mean, if user touch the scrollbar area show it otherwise hide it with animation (what happens in native dialer app)?

Sup! Using FastScrollRecyclerView inside ScrollView doesn't work, should be?

Hi! Library is cool and smooth to use. Like it.
I'm interesting. Is this possible to make it working inside ScrollView/NestedSV? I tried. but it doesn't work. The XML

<ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent">
                    <com.l4digital.fastscroll.FastScrollRecyclerView
                        android:id="@+id/recycler_view"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        app:bubbleColor="@color/blue_main"
                        app:bubbleTextColor="#ffffff"
                        app:handleColor="#999999"
                        app:hideScrollbar="false"
                        app:showTrack="true"
                        app:trackColor="@color/blue_light" />
</ScrollView>

In code

                    binding.recyclerView.setAdapter(adapter);
                    binding.recyclerView.setNestedScrollingEnabled(true); // with false the same result
                    binding.recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));

Thanks!

Problems with a right navigation view in a drawerlayout

Hi! Thank you for such a great library! It works great but I'm facing a problem when using it in a activity which has a drawer layout with a navigation view which opens from the right.

When I try to scroll using the handle, most of the time, the scroll stops suddenly while my finger still is touching the screen and the right navigation view starts to open.

Also, when I have the showtrack property set to true, start a scroll and try to touch the track, it also doesn't work well.

While writing this report, I decided to use the padding support you added based on #15 and it seemed to make the behaviour much better as it doesn't compete with the right navigation view.

I decided to open this issue anyway because it would be very good if you could check this out. Maybe disable the touch processing of the parent view when handling track and handle touch.

Thanks for any advice.

Convert FastScroll to Kotlin

Now that Kotlin is widely accepted as the standard language for Android development, we should improve FastScroll's Kotlin support by converting the library language to Kotlin.

Scrollbar snaps to top

Hey,
great library so far, way better than most that I used before!
But i got a problem with the UI-Handle. Sometimes it snaps back to the top. It seems the problem occurs when I release while dragging or some kind of swipe motion in generel. The handle snaps back to top then, the position inside the recyclerview is correct though.
Also, when I scroll my recyclerview, the handle snaps back to the top.

I use a custom layout manager which is not a derivation of LinearLayoutManager.

Scroll handle and bubble by default touched with toolbar

Can you provide option so with that i can set handle by default position with distance of toolbar. Please once see in WhatsApp. There are almost 10 - 15 dp space between toolbar and scroll handle by default. If possible then please provide something like this option.

How to Hide Bubble

In my app I only want fast scroll but a bubble should not appear. Is it possible to hide it? How?

NullPointerException

Hi.

We use fast scroller on a recycler view but some of user's session (We use Fabric) show this error:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.support.v7.widget.RecyclerView.computeVerticalScrollOffset()' on a null object reference
at com.l4digital.fastscroll.FastScroller.getScrollProportion(FastScroller.java:443)
at com.l4digital.fastscroll.FastScroller.access$000(FastScroller.java:51)
at com.l4digital.fastscroll.FastScroller$3.run(FastScroller.java:221)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:251)
at android.app.ActivityThread.main(ActivityThread.java:6589)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

Library Version:
api 'com.l4digital.fastscroll:fastscroll:1.1.1'

Got a error when building

I use android studio to import the project, but I got a error :
Could not get unknown property 'bintray_user' for object of type com.jfrog.bintray.gradle.BintrayExt

what went wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.