提交 17f7da73 编写于 作者: A amitshekhariitbhu

Add execute pending bindings

上级 f21f2ef4
...@@ -107,6 +107,12 @@ public class BlogAdapter extends RecyclerView.Adapter<BaseViewHolder> { ...@@ -107,6 +107,12 @@ public class BlogAdapter extends RecyclerView.Adapter<BaseViewHolder> {
mBinding.setViewModel(mBlogItemViewModel); mBinding.setViewModel(mBlogItemViewModel);
// Immediate Binding
// When a variable or observable changes, the binding will be scheduled to change before
// the next frame. There are times, however, when binding must be executed immediately.
// To force execution, use the executePendingBindings() method.
mBinding.executePendingBindings();
} }
} }
......
...@@ -105,6 +105,12 @@ public class OpenSourceAdapter extends RecyclerView.Adapter<BaseViewHolder> { ...@@ -105,6 +105,12 @@ public class OpenSourceAdapter extends RecyclerView.Adapter<BaseViewHolder> {
mOpenSourceItemViewModel = new OpenSourceItemViewModel(repo); mOpenSourceItemViewModel = new OpenSourceItemViewModel(repo);
mBinding.setViewModel(mOpenSourceItemViewModel); mBinding.setViewModel(mOpenSourceItemViewModel);
// Immediate Binding
// When a variable or observable changes, the binding will be scheduled to change before
// the next frame. There are times, however, when binding must be executed immediately.
// To force execution, use the executePendingBindings() method.
mBinding.executePendingBindings();
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册