All Projects → zhanghai → Androidfastscroll

zhanghai / Androidfastscroll

Licence: apache-2.0
Fast scroll for Android RecyclerView and more

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Androidfastscroll

Ultimaterefreshview
UltimateRefreshView 实现下拉刷新,上拉加载更多的轻量级库;支持RecyclerView ,ListView ,ScrollView & WebView
Stars: ✭ 64 (-79.75%)
Mutual labels:  webview, recyclerview, scrollview
Pull To Refresh
ESPullToRefresh is developed and maintained by Vincent Li. If you have any questions or issues in using ESPullToRefresh, welcome to issue. If you want to contribute to ESPullToRefresh, Please submit Pull Request, I will deal with it as soon as possible.
Stars: ✭ 1,591 (+403.48%)
Mutual labels:  webview, scrollview
Kohii
Android Video Playback made easy.
Stars: ✭ 204 (-35.44%)
Mutual labels:  recyclerview, scrollview
Swipemenu
[DEPRECATED] A swipe menu for horizontal/vertical, support left/right and top/bottom directions
Stars: ✭ 817 (+158.54%)
Mutual labels:  recyclerview, scrollview
Overscroll Decor
Android: iOS-like over-scrolling effect applicable over almost all scrollable Android views.
Stars: ✭ 2,671 (+745.25%)
Mutual labels:  recyclerview, scrollview
Kotlin Playground
Kotlin practice
Stars: ✭ 111 (-64.87%)
Mutual labels:  webview, recyclerview
InfiniteScrollRecyclerView
Enables the RecyclerView to Auto scroll for indefinite time.
Stars: ✭ 49 (-84.49%)
Mutual labels:  recyclerview, scrollview
Stickyscrollview
Sticky header and footer for android ScrollView.
Stars: ✭ 284 (-10.13%)
Mutual labels:  scrollview
Swiftwebvc
A drop-in inline browser for your Swift iOS app.
Stars: ✭ 307 (-2.85%)
Mutual labels:  webview
Containercontroller
UI Component. This is a copy swipe-panel from app: Apple Maps, Stocks. Swift version
Stars: ✭ 273 (-13.61%)
Mutual labels:  scrollview
Android Pagination With Recyclerview
Pagination (Endless or Infinite Scrolling) using RecyclerView's onScrollListener
Stars: ✭ 269 (-14.87%)
Mutual labels:  recyclerview
Azexpandableiconlistview
An expandable/collapsible view component written in Swift.
Stars: ✭ 284 (-10.13%)
Mutual labels:  scrollview
Jsqwebviewcontroller
[Deprecated] A lightweight Swift WebKit view controller for iOS
Stars: ✭ 307 (-2.85%)
Mutual labels:  webview
Aiforms.settingsview
SettingsView for Xamarin.Forms
Stars: ✭ 274 (-13.29%)
Mutual labels:  recyclerview
Injuredandroid
A vulnerable Android application that shows simple examples of vulnerabilities in a ctf style.
Stars: ✭ 317 (+0.32%)
Mutual labels:  webview
Citypicker
🔥🔥🔥城市选择、定位、搜索及右侧字母导航,类似美团 百度糯米 饿了么等APP选择城市功能
Stars: ✭ 2,973 (+840.82%)
Mutual labels:  recyclerview
Recycleritemdecoration
ItemDecoration for RecyclerView using LinearLayoutManager for Android
Stars: ✭ 320 (+1.27%)
Mutual labels:  recyclerview
Android Inline Youtube View
Utility library around using YouTube inside your android app.
Stars: ✭ 313 (-0.95%)
Mutual labels:  webview
Kiel
Kotlin way of building RecyclerView Adapter 🧩. You do not have to write RecyclerView Adapters again and again and suffer from handling of different view types. Kiel will help you.
Stars: ✭ 297 (-6.01%)
Mutual labels:  recyclerview
Knphotobrowser
📷 图片 || 视频 浏览器(本地和网络) , UIViewController + CollectionView , 完美适配 iPhone 以及 iPad ,屏幕旋转功能 , 适配SDWebImage 5.0
Stars: ✭ 296 (-6.33%)
Mutual labels:  scrollview

AndroidFastScroll

Android CI status

Fast scroll for Android RecyclerView and more.

This is not an officially supported Google product.

Why AndroidFastScroll?

  • Fully customizable: Override track, thumb, popup, animation and scrolling.
  • Easy-to-use defaults: Predefined default style, Material Design 2 style and animation.
  • Extensive view support: Out-of-box support for RecyclerView, ScrollView, NestedScrollView and WebView, plus any view with a ViewHelper implementation.
  • Window insets friendly: Support setting a separate padding for scrollbar.
  • Clean implementation: Decoupled touch handling, animation and scrolling logic.

Preview

Google Play

Sample APK

Implementation

This library is loosely based on the following AOSP implementations:

Integration

Gradle:

implementation 'me.zhanghai.android.fastscroll:library:1.1.5'

This library uses Java 8 bytecode, so you will need to enable it in your project as well:

android {
    ...
    // For Java projects
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    // For Kotlin projects
    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8.toString()
    }
}

Usage

Simply create a FastScroller with FastScrollerBuilder, and enjoy!

new FastScrollerBuilder(recyclerView).build();

You can also implement PopupTextProvider in your RecyclerView.Adapter to show a popup.

For more customization, please use the methods on FastScrollerBuilder. Namely:

  • setViewHelper() allows providing a custom ViewHelper to support more views.
  • setPopupTextProvider() allows providing a custom PopupTextProvider if your RecyclerView.Adapter cannot implement that interface.
  • setPadding() allows setting a custom padding for the scrollbar, instead of the padding of the view.
  • setTrackDrawable() and setThumbDrawable() allow setting custom drawables for the scrollbar. The android:state_pressed state will be updated for them so you can use a selector.
  • setPopupStyle() allows customizing the popup view with a lambda that will receive the view.
  • setAnimationHelper() allows providing a custom AnimationHelper to use an alternative scrollbar animation.
  • disableScrollbarAutoHide() allows disabling the auto hide animation for scrollbar. This implies using a DefaultAnimationHelper.
  • useDefaultStyle() and useMd2Style() allow using the predefined styles, which sets the drawables and popup style. useDefaultStyle(), as its name suggests, is the default style when a FastScrollerBuilder is created.

The default ViewHelper implementation for RecyclerView supports both LinearLayoutManager and GridLayoutManager, but assumes that each item has the same height when calculating scroll, as there's no common way to deal with variable item height. If you know how to measure for scrolling in your specific case, you can provide your own ViewHelper implementation and fast scroll will work correctly again.

If you are using any RecyclerView.ItemDecoration that implements onDrawOver(), you might be interested in FixItemDecorationRecyclerView which can fix the drawing order.

If you are using any other library that makes use of RecyclerView.OnItemTouchListener (e.g. recyclerview-selection), you might be interested in FixOnItemTouchListenerRecyclerView which can correctly handle cancellations when dispatching touch events to listeners. You may also want to configure this library before others so that this library can take precedence in touch event handling.

You can also refer to the sample app source for how things like window insets and lift on scroll are implemented.

License

Copyright 2019 Google LLC

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

    https://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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].