Skip to content

Commit

Permalink
1.更新部分代码
Browse files Browse the repository at this point in the history
Former-commit-id: 7921e40
Former-commit-id: 28f3ac7
  • Loading branch information
afkT committed Dec 15, 2021
1 parent ea463ef commit 53e8b69
Show file tree
Hide file tree
Showing 2 changed files with 686 additions and 1 deletion.
20 changes: 19 additions & 1 deletion lib/DevAssist/src/main/java/dev/adapter/DevDataAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,25 @@ public DevDataAdapter<T, VH> bindAdapter(RecyclerView recyclerView) {
public DevDataAdapter<T, VH> bindAdapter(
RecyclerView recyclerView,
boolean set
) {
initialize(recyclerView, set);
if (recyclerView != null) {
recyclerView.setAdapter(this);
}
return this;
}

// =========
// = 初始化 =
// =========

public DevDataAdapter<T, VH> initialize(RecyclerView recyclerView) {
return initialize(recyclerView, true);
}

public DevDataAdapter<T, VH> initialize(
RecyclerView recyclerView,
boolean set
) {
if (recyclerView != null) {
// 进行设置 Context、Activity
Expand All @@ -143,7 +162,6 @@ public DevDataAdapter<T, VH> bindAdapter(
if (mActivity == null) {
mActivity = ActivityUtils.getActivity(recyclerView.getContext());
}
recyclerView.setAdapter(this);
}
if (set) setRecyclerView(recyclerView);
return this;
Expand Down
Loading

0 comments on commit 53e8b69

Please sign in to comment.