Search in sources :

Example 1 with OnDoubleClickListener

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);
        }
    }));
}
Also used : adapter.main_recycle_adapter(adapter.main_recycle_adapter) OnDoubleClickListener(util.OnDoubleClickListener) SaveCallback(org.litepal.crud.callback.SaveCallback) Intent(android.content.Intent) View(android.view.View) SpringView(com.liaoinstan.springview.widget.SpringView) RecyclerView(android.support.v7.widget.RecyclerView) SpringView(com.liaoinstan.springview.widget.SpringView)

Aggregations

adapter.main_recycle_adapter (adapter.main_recycle_adapter)1 Intent (android.content.Intent)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 SpringView (com.liaoinstan.springview.widget.SpringView)1 SaveCallback (org.litepal.crud.callback.SaveCallback)1 OnDoubleClickListener (util.OnDoubleClickListener)1