From d15ca69ecf80da4ad3069ae02bcf1f2ab920ce24 Mon Sep 17 00:00:00 2001 From: free46000 Date: Tue, 25 Apr 2017 00:55:53 +0800 Subject: [PATCH] =?UTF-8?q?docs(0.9.6):=20=E5=A2=9E=E5=8A=A0=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E5=92=8C=E6=9B=B4=E6=96=B0README=E4=B8=AD=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: free46000 --- README.md | 7 ++++++- .../com/freelib/multiitem/demo/EmptyAndErrorActivity.java | 5 +++++ .../java/com/freelib/multiitem/demo/UserInfoActivity.java | 8 -------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f3a6ea3..3036e61 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,15 @@ - `RecyclerView Adapter`零编码,解放了复杂的`Adapter`类 - 支持`DataBinding`,让你清爽的编写列表代码 - 支持Form表单录入,懒加载易复用,支持`DataBinding`、隐藏域、输入内容验证及是否变化 +- 支持业务详情页展示 +- 支持空白、错误等状态页的展示 ## 系列文章 - **用法与详解(详见下文)** - **[MultiItem进阶 实现Head Foot和加载更多](https://juejin.im/post/58da77ed1b69e6006bc7fffa)** - **[MultiItem进阶 使用DataBinding让RecyclerView代码更简洁清爽](https://juejin.im/post/58ea5e88b123db1ad0636295)** - **[MultiItem进阶 用RecyclerView实现Form表单](https://juejin.im/post/58ea5e88b123db1ad0636295)** +- **[MultiItem进阶 用RecyclerView实现错误和空白状态页 附加详情实践](https://juejin.im/post/58fe298d8d6d810058a0f2a5)** - **[仿任务面板 跨RecyclerView的Item拖动 支持缩小后拖动](https://juejin.im/post/58e37dae0ce46300583b4ab0)** ![chat](https://github.com/free46000/cloud/raw/master/multiitem/chat.png) @@ -18,6 +21,8 @@ ![fullspan](https://user-gold-cdn.xitu.io/2017/3/29/59b465977da7c11b455a9998143e5e2a.png ) ![loadmore](https://user-gold-cdn.xitu.io/2017/3/29/7b50786340f253d2f8e5f7966cfd7fc1.png ) ![数据绑定效果](https://user-gold-cdn.xitu.io/2017/4/8/909aaf58179acc6abb55d79ae188f09e.png) +![详情页效果](https://github.com/free46000/cloud/raw/master/multiitem/user_info.png) +![空白错误页](https://github.com/free46000/cloud/raw/master/multiitem/empty_error.gif) ![跨Recycler拖动](https://github.com/free46000/cloud/raw/master/multiitem/panel_drag.gif ) ![缩放后跨Recycler拖动](https://github.com/free46000/cloud/raw/master/multiitem/panel_drag_scale.gif) @@ -40,7 +45,7 @@ allprojects { 在`Module`中添加: ``` dependencies { - compile 'com.github.free46000:MultiItem:0.9.5' + compile 'com.github.free46000:MultiItem:0.9.6' } ``` diff --git a/demo/src/main/java/com/freelib/multiitem/demo/EmptyAndErrorActivity.java b/demo/src/main/java/com/freelib/multiitem/demo/EmptyAndErrorActivity.java index cd6de86..4a6ca3e 100644 --- a/demo/src/main/java/com/freelib/multiitem/demo/EmptyAndErrorActivity.java +++ b/demo/src/main/java/com/freelib/multiitem/demo/EmptyAndErrorActivity.java @@ -69,8 +69,11 @@ protected void initViews() { * @return StateViewHelper */ private StateViewHelper newStateViewHelper(String message) { + //初始化状态Item BaseItemState stateItem = new ItemEmptyAndError(message); + //初始化辅助类,需要一个BaseItemState StateViewHelper stateViewHelper = new StateViewHelper(recyclerView, stateItem); + //设置状态页按钮的点击事件监听,处理状态页隐藏 stateItem.setOnStateClickListener(() -> errorViewHelper.hide()); return stateViewHelper; } @@ -84,9 +87,11 @@ private void setOnItemClickListener(BaseItemAdapter adapter) { public void onItemClick(BaseViewHolder viewHolder) { switch (viewHolder.getItemPosition()) { case 0: + //展示空白页 emptyViewHelper.show(); break; case 1: + //展示错误页 errorViewHelper.show(); break; } diff --git a/demo/src/main/java/com/freelib/multiitem/demo/UserInfoActivity.java b/demo/src/main/java/com/freelib/multiitem/demo/UserInfoActivity.java index 80ca845..9452540 100644 --- a/demo/src/main/java/com/freelib/multiitem/demo/UserInfoActivity.java +++ b/demo/src/main/java/com/freelib/multiitem/demo/UserInfoActivity.java @@ -1,22 +1,14 @@ package com.freelib.multiitem.demo; import android.content.Context; -import android.databinding.ViewDataBinding; -import android.icu.text.UnicodeSet; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import com.freelib.multiitem.adapter.BaseItemAdapter; import com.freelib.multiitem.adapter.holder.DataBindViewHolderManager; -import com.freelib.multiitem.demo.bean.ImageBean; -import com.freelib.multiitem.demo.bean.ImageTextBean; import com.freelib.multiitem.demo.bean.ItemInfo; -import com.freelib.multiitem.demo.bean.TextBean; import com.freelib.multiitem.demo.bean.UserBean; -import com.freelib.multiitem.demo.viewholder.ImageAndTextManager; -import com.freelib.multiitem.demo.viewholder.ImageViewManager; -import com.freelib.multiitem.demo.viewholder.TextViewManager; import org.androidannotations.annotations.AfterViews; import org.androidannotations.annotations.EActivity;