use of util.OnDoubleClickListener in project GomoTest by suReZj.
the class MainActivity method setListener.
private void setListener() {
springView.setListener(new SpringView.OnFreshListener() {
@Override
public void onRefresh() {
}
@Override
public void onLoadmore() {
setImage(++page);
}
});
adapter.setOnItemClickLitener(new main_recycle_adapter.OnItemClickLitener() {
@Override
public void onItemClick(final View view, final int position) {
imageUrl = list.get(position);
// intent.putStringArrayListExtra("list", list);
DataSupport.saveAllAsync(showList).listen(new SaveCallback() {
@Override
public void onFinish(boolean success) {
Log.e("showList", showList.size() + "");
Intent intent = new Intent(MainActivity.this, ShowActivity.class);
intent.putExtra("position", position);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
startActivity(intent, ActivityOptions.makeSceneTransitionAnimation(MainActivity.this, view, "shareNames").toBundle());
} else {
startActivity(intent);
}
}
});
}
@Override
public void onItemLongClick(View view, int position) {
}
});
toolbar.setOnTouchListener(new OnDoubleClickListener(new OnDoubleClickListener.DoubleClickCallback() {
@Override
public void onDoubleClick() {
recyclerView.scrollToPosition(0);
}
}));
}
Aggregations