use of com.lzy.demo.base.DividerItemDecoration in project okhttp-OkGo by jeasonlzy.
the class OkHttpActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_recycler);
initToolBar(toolbar, true, "OkGo功能介绍");
initData();
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
recyclerView.setAdapter(new MainAdapter(this));
}
use of com.lzy.demo.base.DividerItemDecoration in project okhttp-OkGo by jeasonlzy.
the class RxActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_recycler);
initToolBar(toolbar, true, "OkRx使用示例");
initData();
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
recyclerView.setAdapter(new RxActivity.MainAdapter(this));
}
use of com.lzy.demo.base.DividerItemDecoration in project okhttp-OkGo by jeasonlzy.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initToolBar(toolbar, false, "");
initData();
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
recyclerView.setAdapter(new MainAdapter(this));
}
use of com.lzy.demo.base.DividerItemDecoration in project okhttp-OkGo by jeasonlzy.
the class DownloadActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_download);
initToolBar(toolbar, true, "下载管理");
initData();
downloadManager = DownloadService.getDownloadManager();
downloadManager.setTargetFolder(Environment.getExternalStorageDirectory().getAbsolutePath() + "/aaa/");
targetFolder.setText("下载路径: " + downloadManager.getTargetFolder());
sbCorePoolSize.setMax(5);
sbCorePoolSize.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
downloadManager.getThreadPool().setCorePoolSize(progress);
tvCorePoolSize.setText(String.valueOf(progress));
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
sbCorePoolSize.setProgress(3);
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.addItemDecoration(new DividerItemDecoration(this, LinearLayoutManager.VERTICAL));
adapter = new MainAdapter(this);
recyclerView.setAdapter(adapter);
openManager.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(getApplicationContext(), DownloadManagerActivity.class));
}
});
}
Aggregations