Skip to content

Latest commit

 

History

History
102 lines (71 loc) · 6.27 KB

README_ZH.md

File metadata and controls

102 lines (71 loc) · 6.27 KB

LoadingStateView

English | 中文

License

LoadingStateView 是一个深度解耦缺省页和标题栏的工具,核心功能的实现代码只有一个 200 多行的 Kotlin 文件。不仅能在请求网络数据时显示加载中、加载成功、加载失败、无数据的视图或自定义视图,还可以对标题栏进行解耦。

重大更新:结合 Kotlin 语法特性能快速将所有功能集成到基类,不会影响已有代码。移除了 ViewHolder,整体用法得到进一步简化,建议升级!

  • 无需在布局添加视图代码
  • 支持快速集成到基类,并且不影响有代码(仅 Kotlin)
  • 支持 Activity、Fragment、列表或指定的 View
  • 支持显示自定义视图
  • 支持添加多个头部控件
  • 支持设置重新请求数据的事件
  • 支持动态更新视图样式
  • 可结合绝大部分第三方控件使用

示例

点击或者扫描二维码下载

QR code

动态添加加载状态的布局:

Activity(error) View(placeholder) ViewPager(timeout) RecyclerView(cool loading)

动态添加标题栏或装饰容器:

SpecialHeader(custom) MultipleHeader(search) SpecialDecorView(scrolling) BottomDecorView(editor)

用法

📝 >> 使用文档 <<

Gradle

在根目录的 build.gradle 添加:

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

在模块的 build.gradle 添加依赖:

dependencies {
    // java
    implementation 'com.github.DylanCaiCoding.LoadingStateView:loadingstateview:4.1.0'

    // kotlin
    implementation 'com.github.DylanCaiCoding.LoadingStateView:loadingstateview-ktx:4.1.0'
}

更新日志

Releases

作者其它的库

简介
Longan 可能是最好用的 Kotlin 工具库
ViewBindingKTX 最全面的 ViewBinding 工具
MMKV-KTX 最灵活易用的 MMKV 工具
Tracker 基于西瓜视频的责任链埋点思路实现的轻量级埋点框架

感谢

License

Copyright (C) 2019. Dylan Cai

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.