Commit 4568e1a6aaccf3ba2cc41c1415d601f31967b722

Authored by 朱显松
1 parent dc5d62db

DataBindingAdapter Update

cnlive/build.gradle
@@ -75,7 +75,7 @@ ext { @@ -75,7 +75,7 @@ ext {
75 siteUrl = 'http://bj.gitlab.cnlive.com/cnlive-team/CNVideoDemo' 75 siteUrl = 'http://bj.gitlab.cnlive.com/cnlive-team/CNVideoDemo'
76 gitUrl = 'http://bj.gitlab.cnlive.com/cnlive-team/CNVideoDemo.git' 76 gitUrl = 'http://bj.gitlab.cnlive.com/cnlive-team/CNVideoDemo.git'
77 77
78 - libraryVersion = '0.2.2' 78 + libraryVersion = '0.2.4'
79 79
80 developerId = 'CNlive' 80 developerId = 'CNlive'
81 developerName = 'Granzon' 81 developerName = 'Granzon'
cnlive/src/main/java/com/cnlive/libs/base/frame/adapter/DataBindingRecyclerAdapter.java
@@ -62,6 +62,12 @@ public abstract class DataBindingRecyclerAdapter<D, T extends ViewDataBinding> e @@ -62,6 +62,12 @@ public abstract class DataBindingRecyclerAdapter<D, T extends ViewDataBinding> e
62 return getList() == null ? 0 : getList().size(); 62 return getList() == null ? 0 : getList().size();
63 } 63 }
64 64
  65 + public void addItem(int position, D item) {
  66 + if (item == null) return;
  67 + getList().add(position, item);
  68 + notifyItemInserted(position);
  69 + }
  70 +
65 public void addItem(D item) { 71 public void addItem(D item) {
66 if (item == null) return; 72 if (item == null) return;
67 getList().add(getList().size(), item); 73 getList().add(getList().size(), item);