Coder Social home page Coder Social logo

recycler-fast-scroll's Introduction

Recycler Fast Scroll

Art

Widget for RecyclerView fast scrolling, like Android's built-in fast scroll option for ListView.

Currently only supports verically-scrolling LayoutManagers.
Planned features are listed at the issues page.
You can download the sample APK from the releases page.

Dependency

Release
Add the jitpack.io repo and this library to build.gradle:

repositories {
  // ...
  maven { url "https://jitpack.io" }
}

dependencies {
  // ...
  compile 'com.github.plusCubed:recycler-fast-scroll:{latest-version}'
}

The library is versioned according to Semantic Versioning.

Usage

  1. Add the widget to your layout file, e.g.:

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    
        <android.support.v7.widget.RecyclerView
            android:layout_width="match_parent"
            android:layout_height="match_parent" />
    
        <com.pluscubed.recyclerfastscroll.RecyclerFastScroller
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_gravity="end" />
    
    </FrameLayout>
  2. Attach the RecyclerFastScroller to your RecyclerView:

    fastScroller.setRecyclerView(recyclerView);

See the sample project for complete demos.

Customization & Methods

Method Attribute Description
setBarColor(int color) rfs_barColor Color of scrollbar. Defaults to colorControlNormal attribute. Alpha of ~22% is applied to the drawable to match stock ListView fast scroller.
setHandleNormalColor(int color) rfs_handleNormalColor Color of handle. Defaults to colorControlNormal attribute.
setHandlePressedColor(int color) rfs_handlePressedColor Color of pressed handle. Defaults to colorAccent attribute.
setTouchTargetWidth(int width) rfs_touchTargetWidth Width of the touch target. Defaults to 24dp (while the Android docs recommend at least 48dp, 24dp is more practical considering it will block touch in the right of the RecyclerView).
setOnHandleTouchListener(OnTouchListener listener) -- Sets listener for handle touch events.

####Attribute Usage

<com.pluscubed.recyclerfastscroll.RecyclerFastScroller
    ...
    app:{attributeName}="{value}"/>

License

Copyright 2015 Daniel Ciao

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.


Mostly rewritten, but originally based off of [danoz73/RecyclerViewFastScroller](https://github.com/danoz73/RecyclerViewFastScroller).

recycler-fast-scroll's People

Contributors

eoinfogarty avatar pluscubed avatar

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.