Skip to content

Commit e966c6d

Browse files
committed
添加一个 仿微信 交互的demo(补充)
1 parent adcde27 commit e966c6d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

demo/src/main/java/me/yokeyword/sample/demo_wechat/ui/fragment/second/FirstPagerFragment.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
5353
}
5454

5555
private void initView(View view) {
56+
EventBus.getDefault().register(this);
57+
5658
mRecy = (RecyclerView) view.findViewById(R.id.recy);
5759
mRefreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.refresh_layout);
5860

@@ -122,4 +124,10 @@ public void onTabSelectedEvent(TabSelectedEvent event) {
122124
private void scrollToTop() {
123125
mRecy.smoothScrollToPosition(0);
124126
}
127+
128+
@Override
129+
public void onDestroyView() {
130+
super.onDestroyView();
131+
EventBus.getDefault().unregister(this);
132+
}
125133
}

0 commit comments

Comments
 (0)