• Stars
    star
    120
  • Rank 287,305 (Top 6 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created almost 6 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🔥🔥 An Android costomized ScrollView which likes UIScrollView over-scrolling effect in iOS.

BounceScrollView

API License

logo

🎨An Android warpped ScrollView, which works just like the UIScrollView in iOS when the user tries to scroll it beyond its content.🎨


Features

  • ♠️Maximum adaptability. It supports the horizontal and the vertical direction, and extends the NestScrollView. So it not only can work just like the ScrollView and the HorizontalScrollView, but also can work properly with Nest Scrolling.
  • ♥️Customizable damping coefficient (easier or harder to over scroll). The incremental damping or constant damping can be chose during the over-scrolling.
  • ♣️Customizable bounce delay, the duration of the restoring animation.
  • ♦️Customizable interpolator, the rate of change of the restoring animation.

Download

root project:build.gradle

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

app:build.gradle

Support:

  dependencies {
     implementation 'com.github.woxingxiao:BounceScrollView:LATEST_VERSION'
  }

AndroidX:

  dependencies {
     implementation 'com.github.woxingxiao:BounceScrollView:LATEST_VERSION-androidx'
  }

Usage

<?xml version="1.0" encoding="utf-8"?>
<com.xw.repo.widget.BounceScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.constraint.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

          <!-- The ConstraintLayout can be replaced by FrameLayout, LinearLayout, etc. -->
          <!-- Your content view goes here. -->

     </android.support.constraint.ConstraintLayout>
</com.xw.repo.widget.BounceScrollView>

Listener to the scrolling event of content of the BounceScrollView:

mBounceScrollView.setOnScrollListener(new OnScrollListener() {
    @Override
    public void onScrolling(int scrollX, int scrollY) {

    }
});

Listener to the over-scrolling event of the BounceScrollView:

mBounceScrollView.setOnOverScrollListener(new OnOverScrollListener() {
    @Override
    public void onOverScrolling(boolean fromStart, int overScrolledDistance) {

    }
});

Attributes

Attr Format Descrption
damping float The damping coefficient. The greater the value, the hard it is to over scroll. Defalut: 2.0
scrollOrientation enum The children layout direction. Default: vertical
incrementalDamping boolean Whether the damping coefficient growing with the distance or not. Default: true
bounceDelay long The duration of restoring animation. Default: 400(ms)
triggerOverScrollThreshold int The length in pixel to trigger over-scrolling. Default: 20(px)
disableBounce boolean Disable the bounce effect. Default: false
nestedScrollingEnabled boolean Whether nested scrolling is enabled. Default: true

It took me tons of time to adjust the parameters pixel by pixel, in order to achieve the best experience I think.🍻


🍰If the attr damping is set to 2.0, the over-scrolling effort is almost the same as UIScrollView in iOS.
🍰The interpolator of the restoring animation is customizable. You can do it by:

mBounceScrollView.setBounceInterpolator(new YourCustomizedInterpolator());

Thanks to the repo EasingInterpolator, there are multiple choices to make.


Most of the resources in the sample come from gameofthrones.com.

License

   Copyright 2018 woxingxiao

   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.

More Repositories

1

BubbleSeekBar

A beautiful Android custom seekbar, which has a bubble view with progress appearing upon when seeking. 自定义SeekBar,进度变化更以可视化气泡样式呈现
Java
3,322
star
2

SlidingUpPanelLayout

A vertical-handled and multi-panel support SlidingPanelLayout. 一个竖直方向的SlidingPanelLayout,支持加载多个Panel,可以灵活地实现漂亮的的交互效果。
Java
1,562
star
3

GracefulMovies

简影讯,简约精彩影讯。基于Retrofit+RxJava+Android Arch+DataBinding+Room的高颜值影讯app。简约,优雅,精彩,即看即走,已正式发布上线。
Java
892
star
4

DashboardView

Android自定义仪表盘View,仿新旧两版芝麻信用分、炫酷汽车速度仪表盘
Java
832
star
5

XEditText

XEditText: clear contents easily; show/hide password; separeta contents automatically, such as credit card number; disable Emoji inputs; 带删除功能的EditText;显示或者隐藏密码;可设置自动添加分隔符分割电话号码、银行卡号等;支持禁止Emoji表情符号输入。
Java
512
star
6

VectorCompatTextView

One VectorCompatTextView suits for hundreds of CompoundDrawable style. 一个库,满足CompoundDrawable的百变风格。
Java
155
star
7

FillBlankView

基于EditText,仿手机支付宝、微信支付时数字密码输入验证的控件,同时支持文字输入验证
Java
123
star
8

ScaleTransitionAnim

图片预览缩放过渡动画,效果如微信朋友圈,手机系统相册
Java
61
star
9

PullToRefreshAndLoadMore

Android下拉刷新、上拉加载更多控件,满足ListView等最常用上下拉刷新数据的需求,并理论上支持所有View。[DEPRECATED]
Java
58
star
10

EncryptHelper

Android data localized safely encryption/decryption tool. 数据安全本地化加密解密工具。
Java
17
star
11

Chameleon

【变色龙】实现优雅平滑地在两个色值之间过渡
Java
14
star