over-scrolling效果 OverScrollDecor

码农软件 · 软件分类 · 滚动视图(ScrollView) · 2019-06-03 20:26:32

软件介绍

OverScrollDecor是一款类似IOS的over-scrolling效果的软件,即对于滑动到顶部的View继续滑动时会超出,松手后自动还原到原始位置。支持ListView,GridView,ScrollView,WebView,RecyclerView,以及其他的任意View和ViewGroup。

演示:

imageimageimage

用法:

使用前,对于Android Studio的用户,可以选择添加:

 compile project(':library_overscroll')

实现原理:

采用ViewDragHelper 和重写布局的 dispatchTouchEvent实现。

代码参考:

使用简单,Java代码无需做任何修改,需要要将想要实现效果的布局外包一层OverScrollDecor即可。对于 ListView,GridView,ScrollView,WebView,RecyclerView 五个类需要使用该项目中提供的 Vertical开头的对应类,其余View 和 ViewGroup 使用原生即可。如果是自定义的 ListView(其余类似),只需要将你自定义的ListView 继承 VerticalListView ,在不修改代码的情况下同样可以实现。

 <?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">

        <com.lzy.ui.OverScrollDecor            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <com.lzy.ui.VerticalListView                android:id="@+id/listView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"/>
        </com.lzy.ui.OverScrollDecor>
</RelativeLayout>

本文地址:https://www.codercto.com/soft/d/7190.html

Natural Language Processing with Python

Natural Language Processing with Python

Steven Bird、Ewan Klein、Edward Loper / O'Reilly Media / 2009-7-10 / USD 44.99

This book offers a highly accessible introduction to Natural Language Processing, the field that underpins a variety of language technologies, ranging from predictive text and email filtering to autom......一起来看看 《Natural Language Processing with Python》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

随机密码生成器
随机密码生成器

多种字符组合密码