Commit f8fe5b61a2e8ee3193f8a953ef334fac8d53c597
1 parent
0a7f60e4
click event change
Showing
2 changed files
with
5 additions
and
4 deletions
cnlive/build.gradle
| ... | ... | @@ -78,7 +78,7 @@ ext { |
| 78 | 78 | siteUrl = 'http://bj.gitlab.cnlive.com/cnlive-team/CNVideoDemo' |
| 79 | 79 | gitUrl = 'http://bj.gitlab.cnlive.com/cnlive-team/CNVideoDemo.git' |
| 80 | 80 | |
| 81 | - libraryVersion = '0.2.7' | |
| 81 | + libraryVersion = '0.2.8' | |
| 82 | 82 | |
| 83 | 83 | developerId = 'CNlive' |
| 84 | 84 | developerName = 'Granzon' | ... | ... |
cnlive/src/main/java/com/cnlive/libs/base/frame/adapter/DataBindingRecyclerAdapter.java
| ... | ... | @@ -63,13 +63,14 @@ public abstract class DataBindingRecyclerAdapter<D, T extends ViewDataBinding> e |
| 63 | 63 | |
| 64 | 64 | @Override |
| 65 | 65 | public void onBindViewHolder(DataBindingViewHolder holder, int position) { |
| 66 | - ReflectUtil.invoke(holder.binding, "setData", getList().get(position)); | |
| 67 | - ReflectUtil.invoke(holder.binding, "setClick", new Click(position) { | |
| 66 | + View.OnClickListener click = new Click(position) { | |
| 68 | 67 | @Override |
| 69 | 68 | public void onClick(View v) { |
| 70 | 69 | if (listener != null) listener.onItemClick(getList().get(position)); |
| 71 | 70 | } |
| 72 | - }); | |
| 71 | + }; | |
| 72 | + ReflectUtil.invoke(holder.binding, "setData", getList().get(position)); | |
| 73 | + ReflectUtil.invoke(holder.binding, "setClick", click); | |
| 73 | 74 | holder.binding.executePendingBindings(); |
| 74 | 75 | } |
| 75 | 76 | ... | ... |