All Projects → scwang90 → Smartrefreshhorizontal

scwang90 / Smartrefreshhorizontal

Licence: apache-2.0
横向刷新、水平刷新、RefreshLayout、OverScroll,Horizontal,基于SmartRefreshLayout的水平智能刷新

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Smartrefreshhorizontal

Aosf
AOSF:全称为Android Open Source Framework,即Android优秀开源框架汇总。包含:网络请求okhttp,图片下载glide,数据库greenDAO,链式框架RxJava,组件路由ARouter,消息传递通信EventBus,热更新Tinker,插件化框架Replugin,文件下载FileDownloaer,图片选择PhotoPicker,图片滤镜/毛玻璃等特效处理,GIF图片展示控件,图片九宫格控件NineGridView,对话框Dialog,导航指示器ViewpagerIndicator,进度条ProgressWheel,下拉刷新SmartRefreshLayout,key-value高效数据存储MMKV等,应有尽有。
Stars: ✭ 601 (+67.41%)
Mutual labels:  framework, refresh
Objection
📱 objection - runtime mobile exploration
Stars: ✭ 4,404 (+1126.74%)
Mutual labels:  framework
Libterm
iOS sandboxed terminal with Python, Lua and Clang
Stars: ✭ 348 (-3.06%)
Mutual labels:  framework
Stoq
An open source framework for enterprise level automated analysis.
Stars: ✭ 352 (-1.95%)
Mutual labels:  framework
Wpemerge
A modern, MVC-powered WordPress as a CMS workflow. 🚀
Stars: ✭ 348 (-3.06%)
Mutual labels:  framework
Distortos
object-oriented C++ RTOS for microcontrollers
Stars: ✭ 354 (-1.39%)
Mutual labels:  framework
Sugar
A lightweight and powerful JavaScript MVVM library. Used for production or learning how to make a full MVVM.
Stars: ✭ 345 (-3.9%)
Mutual labels:  framework
Flask Assistant
Framework for Building Virtual Assistants with Dialogflow and python
Stars: ✭ 358 (-0.28%)
Mutual labels:  framework
Gzipswift
Swift framework that enables gzip/gunzip Data using zlib
Stars: ✭ 356 (-0.84%)
Mutual labels:  framework
Railt
⚡️ A PHP GraphQL Framework
Stars: ✭ 353 (-1.67%)
Mutual labels:  framework
Scaleapp
scaleApp is a JavaScript framework for scalable and maintainable One-Page-Applications
Stars: ✭ 353 (-1.67%)
Mutual labels:  framework
Eventhus
Go - CQRS / Event Sourcing made easy - Go
Stars: ✭ 350 (-2.51%)
Mutual labels:  framework
Freedomotic
Open IoT Framework
Stars: ✭ 354 (-1.39%)
Mutual labels:  framework
Lab
React UI component design tool
Stars: ✭ 349 (-2.79%)
Mutual labels:  framework
Fbt
A JavaScript Internationalization Framework
Stars: ✭ 3,668 (+921.73%)
Mutual labels:  framework
Cppwebframework
​The C++ Web Framework (CWF) is a MVC web framework, Open Source, under MIT License, using C++ with Qt to be used in the development of web applications.
Stars: ✭ 348 (-3.06%)
Mutual labels:  framework
Loopback Next
LoopBack makes it easy to build modern API applications that require complex integrations.
Stars: ✭ 3,972 (+1006.41%)
Mutual labels:  framework
Birdwatcher
Data analysis and OSINT framework for Twitter
Stars: ✭ 352 (-1.95%)
Mutual labels:  framework
Spikenail
A GraphQL Framework for Node.js
Stars: ✭ 358 (-0.28%)
Mutual labels:  framework
Goflow
A Golang based high performance, scalable and distributed workflow framework
Stars: ✭ 356 (-0.84%)
Mutual labels:  framework

Android横向智能刷新框架-SmartRefreshHorizontal

License MinSdk JCenter Author

English | 中文

SmartRefreshHorizontal 作为 SmartRefreshLayout 的扩展库,实现了横向刷新和加载的功能, 虽然是独立的开源库,但是并没有重复做实现, 而是对 SmartRefreshLayout 做了封装和转换,使其支持横向刷新。 所以 SmartRefreshHorizontal 继承了 SmartRefreshLayout 所有的特性,只是方向改成了横向。

特点:

由来

SmartRefreshLayout 的设计灵活多样,扩展性高,我想这应该是它受欢迎的原因之一。 在 issue 区有不少人建议让 SmartRefreshLayout 支持横向刷新。 其实大家都知道横向刷新的库已经有了不少,我给他们的回复是使用其他现有的横向刷新库。 但这在 issue 引发热议,可能是那些横向刷新库的使用、功能、扩展与 SmartRefreshLayout有很大差距。 所以我自己认为要做横向刷新库也需要能够像 SmartRefreshLayout 一样的多功能与易扩展。 如果直接扩展 SmartRefreshLayout 的功能使其直接支持横向,将会增加代码量。 然而当此时它已经足够庞大,并且也有不少人抱怨它太大需要分包细化功能。所以一开始的时候我几乎没有开发横向刷新功能的想法。 因为用到横向刷新的应用场景比竖向刷新少很多,我自己也很少会用到这样的场景。 如果为了实现一个我自己不常用的功能库要花费我太多时间和精力实在划不来,仅仅实现一个简单的横向刷新又没有必要...

原理

终于!有一天我在开发旋转动画过程中,产生了一个奇妙的想法:如果把 SmartRefreshLayout 旋转90度会怎样? 然后开始做试验:把 SmartRefreshLayout 旋转90度,再把 Content 旋转-90度。结果竟然真的可以用!! 这样就不用让我花大量时间精力去做横向刷新代码实现,SmartRefreshLayout 原有的所有功能多可以直接使用, 之前设计的十多个 Header 和 Footer 也可以不用任何修改直接使用!这让我产生了开发横向刷新库的动力。 于是基于这个试验想法就诞生了这个 SmartRefreshHorizontal 库 !

明白了 SmartRefreshHorizontal 与 SmartRefreshLayout 的关系,那么大家在使用本库的使用同时也要依赖 SmartRefreshLayout,并且版本要大于 1.1.0-beta-1 ,否则会出现找不到类的错误。

传送门

Demo

下载 APK-Demo

效果演示

商品详情 ViewPager
数据演示

简单用例

1. 在 build.gradle 中添加依赖

    //2.x
    implementation 'com.scwang.smart:refresh-layout-horizontal:2.0.0'
    implementation 'com.scwang.smart:refresh-layout-kernel:2.0.1'
    implementation 'com.scwang.smart:refresh-header-classics:2.0.1'    //经典刷新头
    implementation 'com.scwang.smart:refresh-header-material:2.0.1'    //谷歌刷新头

    //1.x
    implementation 'com.scwang.smartrefresh:SmartRefreshHorizontal:1.1.2'
    implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.3' //必须依赖 版本 1.1.0 以上

    //androidx
    implementation 'com.scwang.smartrefresh:SmartRefreshHorizontal:1.1.2-x'
    implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.3' //必须依赖 版本 1.1.0 以上

2. 在XML布局文件中添加 SmartRefreshHorizontal

<?xml version="1.0" encoding="utf-8"?>
<com.scwang.smartrefresh.horizontal.SmartRefreshHorizontal xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/refreshLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <android.support.v7.widget.RecyclerView
        android:id="@+id/recyclerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:overScrollMode="never"
        android:orientation="horizontal"
        android:background="#fff" />
</com.scwang.smartrefresh.horizontal.SmartRefreshHorizontal>

3. 在 Activity 或者 Fragment 中添加代码

   RefreshLayout refreshLayout = root.findViewById(R.id.refreshLayout);
   refreshLayout.setRefreshHeader(new MaterialHeader(root.getContext()));
   refreshLayout.setRefreshFooter(new RefreshFooterWrapper(new MaterialHeader(root.getContext())), -1, -2);

混淆

SmartRefreshHorizontal 不需要添加混淆过滤代码,并且已经混淆测试通过,如果你在项目的使用中混淆之后出现问题,请及时通知我。

其他作品

MultiWaveHeader
SmartRefreshLayout
诗和远方

License

Copyright 2019 scwang90

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