● TimeClock.java——>自定义时钟View——>使用方法——>效果图
● LoadingView.java——>菊花进度——>使用方法——>效果图
● WordsNavigation.java——>联系人列表字母索引——>使用方法——>效果图
● BaseRecyclerAdapter.java——>RecyclerView适配器——>使用方法
public class MyAdapter extends BaseRecyclerAdapter<DataBean, BaseRecyclerAdapter.BaseViewHolder> {
public MyAdapter(int layoutResId, List<DataBean> data) {
super(layoutResId, data);
}
@Override
protected void bindTheData(BaseRecyclerAdapter.BaseViewHolder holder, DataBean data, int position) {
holder.setText(android.R.id.text1, data.getName());
}
}
MyAdapter adapter = new MyAdapter(android.R.layout.simple_list_item_1, list);
//添加头布局
adapter.addHeadView(R.layout.head_view);
//添加尾布局
adapter.addFootView(R.layout.foot_view);
recyclerView.setAdapter(adapter);
adapter.setClickListener(new BaseRecyclerAdapter.onItemClickListener() {
@Override
public void onItemClick(int position, View v) {
Toast.makeText(MainActivity.this, "点击 position = " + position, Toast.LENGTH_SHORT).show();
}
});
//添加文本改变监听
editeText.setListener(new AmountEditText.OnTextChangeListener() {
@Override
public void onTextChanged(String s) {
//回调
}
});