All Projects → 0kai → KKRefreshLayout

0kai / KKRefreshLayout

Licence: other
An android refresh layout, support custom vertical/horizontal refresh.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to KKRefreshLayout

Transition
Easy interactive interruptible custom ViewController transitions
Stars: ✭ 2,566 (+19638.46%)
Mutual labels:  custom
Arc-for-Vivaldi
Make Vivaldi integrate with Arc.
Stars: ✭ 30 (+130.77%)
Mutual labels:  custom
CircularDialogs
Android dialog library to give user feedback about the common operations like Success, Warning and Errors.
Stars: ✭ 35 (+169.23%)
Mutual labels:  custom
Jest Expect Message
Add custom message to Jest expects 🃏🗯
Stars: ✭ 240 (+1746.15%)
Mutual labels:  custom
vscode-icons-manager--electron
Manage vscode icons by Dhanish Gajjar easy with ease
Stars: ✭ 22 (+69.23%)
Mutual labels:  custom
Env-KB
A custom mechanical keyboard inspired by the CFTKB Mysterium utilizing the Raspberry Pi Pico
Stars: ✭ 203 (+1461.54%)
Mutual labels:  custom
Kingcercode
单个输入框验证码样式
Stars: ✭ 216 (+1561.54%)
Mutual labels:  custom
time
The simplest but configurable online clock
Stars: ✭ 77 (+492.31%)
Mutual labels:  custom
imgbed
📒多接口/自定义接口的文件/图片上传
Stars: ✭ 38 (+192.31%)
Mutual labels:  custom
DEMOS TO MySelf Android
自己平时的一些积累,相当于自己的一个demo库,比较杂,后续会一个一个整理出来
Stars: ✭ 36 (+176.92%)
Mutual labels:  custom
Yi Hack Allwinner
Custom firmware for Yi 1080p camera based on Allwinner platform
Stars: ✭ 243 (+1769.23%)
Mutual labels:  custom
harmony-discord
Harmony theme for Discord
Stars: ✭ 12 (-7.69%)
Mutual labels:  custom
SPLarkController
Custom transition between controllers. Settings controller for your iOS app.
Stars: ✭ 967 (+7338.46%)
Mutual labels:  custom
React Native Perspective Image Cropper
Perform custom crop, resizing and perspective correction 📐🖼
Stars: ✭ 223 (+1615.38%)
Mutual labels:  custom
TrendingCustomAlert
You can use a ready-made custom alert controller.
Stars: ✭ 25 (+92.31%)
Mutual labels:  custom
Pinterestlayout
Custom collection view layout inspired by Pinterest layout. Written in Swift.
Stars: ✭ 219 (+1584.62%)
Mutual labels:  custom
Rocksmith-Diy-Realtone-Cable
diy realtone cable
Stars: ✭ 48 (+269.23%)
Mutual labels:  custom
mini-humidifier
Minimalistic humidifier card for Home Assistant Lovelace UI
Stars: ✭ 129 (+892.31%)
Mutual labels:  custom
react-eyedrop
Seamlessly integrate a static typed, fully-tested color-picking React component/hook!
Stars: ✭ 17 (+30.77%)
Mutual labels:  custom
liemoth
Development Kit For Ambarella Devices
Stars: ✭ 20 (+53.85%)
Mutual labels:  custom

KKRefreshLayout

Download

一个下拉刷新框架。已有很多开源刷新工具,但是还找到一个方便自定义,可扩展的。所以自己造个轮子。 还是先写个中文文档就好了. English Doc

  • 支持自定义下拉/上拉动画
  • 支持无数据时上拉显示"没有更多"(可自定义)
  • 支持显示满屏的加载动画(如首次没有数据的动画)
  • 支持滑动到底部,自动加载
  • 支持横向/纵向刷新

Set-up

Gradle:

compile 'net.z0kai:kkrefreshlayout:x.x.x'

or Maven:

<dependency>
  <groupId>net.z0kai</groupId>
  <artifactId>kkrefreshlayout</artifactId>
  <version>x.x.x</version>
  <type>pom</type>
</dependency>

Demo apk下载

目前遇到的使用案例大部分都会添加到demo中

  • 各种动画刷新
  • 第一次进入页面没数据需要一个加载动画
  • 横向弹性跳转更多页面
  • 页面上下拉弹性滑动(像iOS弹性效果)
  • 如微信各种中心也,一半图片下拉回弹效果

使用方式

推荐自己集成于KKRefreshLayout如下(全局使用),然后可以自定义刷新样式。若不继承则使用默认样式。

/**
 * Created by Z_0Kai on 16/9/30.
 * APP封装新控件,请尽量不要使用到原来刷新控件的接口,封装后方便替换
 */
public class AppRefreshLayout extends KKRefreshLayout {

    private AppRefreshLayoutListener mListener;
    
    // ... see demo
    
    public interface AppRefreshLayoutListener {
        void onRefresh();

        void onLoadMore();
    }

    public static class AppRefreshLayoutAdapter implements AppRefreshLayoutListener {
        public void onRefresh() {
        }

        public void onLoadMore() {
        }
    }

    public void setRefreshLayoutListener(AppRefreshLayoutListener listener) {
        mListener = listener;

        super.setRefreshListener(new KKRefreshListener() {
            @Override
            public void onRefresh() {
                if (mListener != null) {
                    mListener.onRefresh();
                }
            }

            @Override
            public void onLoadMore() {
                if (mListener != null) {
                    mListener.onLoadMore();
                }
            }
        });
    }

    /**
     * @hide
     * @deprecated
     */
    @Override
    public void setRefreshListener(KKRefreshListener listener) {
        super.setRefreshListener(listener);
    }
}
  • obtainHeaderView 自定义顶部刷新样式
  • obtainFooterView 自定义上拉样式
  • obtainPageView 自定义页面刷新样式(无默认)

也可以在界面create的时候单独设置

  • setHeadView 设置下拉刷新样式
  • setFooterView 设置上拉加载样式
  • setPageView 设置页面加载效果

布局

<net.z0kai.kkrefreshlayout.KKRefreshLayout
    android:id="@+id/refreshLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:rlLoadMoreEnable="true">
    // one child view
</net.z0kai.kkrefreshlayout.KKRefreshLayout>

布局中设置属性

  • app:rlOrientation="horizontal/vertical" 横向纵向刷新
  • app:rlRefreshEnable="true/false" 是否可下拉刷新
  • app:rlLoadMoreEnable="true/false" 是否加载更多

Listener

onRefresh()
onLoadMore()

贡献你的刷新样式

欢迎提交自定义的Header/Footer/PageView到demo中,添加class到 AppConfigs.java

使用本库的APP

Author

Z0Kai, @0kai on GitHub, blog-中文

License

MIT-licensed.

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].