use of pri.weiqiang.myjapanese.ui.adapter.RightMenuAdapter in project MyJapanese by 54wall.
the class LessonsFragment method setData.
@Override
public void setData(List<Book> data) {
// 来自initAdapter
mBookList = data;
leftAdapter = new LeftMenuAdapter(getActivity(), data);
rightAdapter = new RightMenuAdapter(getActivity(), data);
rightAdapter.setOnItemClickListener(new RightMenuAdapter.OnItemClickListener() {
@Override
public void onClick(Lesson item) {
Log.e(TAG, "lesson:" + item.getTitle());
SharedPreferenceManager.getInstance().putString(Constants.CURRENT_LESSON, item.getTitle());
((MainActivity) getActivity()).switchWords(item.getTitle());
}
});
mRightMenu.setAdapter(rightAdapter);
mRightMenu.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL));
mLeftMenu.setAdapter(leftAdapter);
leftAdapter.addItemSelectedListener(this);
initHeadView();
}
Aggregations