foot

public class Foot extends BaseFragment {

private RecyclerView two_recy;
private TextView text11;
private FootAdapter footAdapter;

@Override
protected int LayoutId() {
    return R.layout.foot_main;
}
@Override
protected void initView(View view) {
    two_recy = view.findViewById(R.id.two_recy);
    text11 = view.findViewById(R.id.text11);

}

@Override
protected void initData() {
    final DaoSession daoSession = App.daoSession;
    ThreeDao threeDao = daoSession.getThreeDao();
    List<Three> threes = threeDao.loadAll();
    if (!threes.isEmpty()){
        footAdapter = new FootAdapter(getActivity(),threes);
        two_recy.setAdapter(footAdapter);
        GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(),3);
        two_recy.setLayoutManager(gridLayoutManager);
    }
   /* text11.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            ThreeDao threeDao1 = daoSession.getThreeDao();
            threeDao1.deleteAll();
            footAdapter.notifyDataSetChanged();;
        }
    });*/
}

}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章