Search in sources :

Example 11 with PerfectClickListener

use of com.example.jingbin.cloudreader.utils.PerfectClickListener in project CloudReader by youlookwhat.

the class DouBanTopAdapter method bindView.

@Override
protected void bindView(BaseBindingHolder holder, SubjectsBean bean, ItemDoubanTopBinding binding, int position) {
    binding.setBean(bean);
    DensityUtil.setWidthHeight(binding.ivTopPhoto, width, 0.758f);
    binding.cvTopMovie.setOnClickListener(new PerfectClickListener() {

        @Override
        protected void onNoDoubleClick(View v) {
            if (listener != null) {
                listener.onClick(bean, binding.ivTopPhoto);
            }
        }
    });
    binding.cvTopMovie.setOnLongClickListener(new View.OnLongClickListener() {

        @Override
        public boolean onLongClick(View v) {
            String title = "Top" + (position + 1) + ": " + bean.getTitle();
            DialogBuild.showCustom(v, title, "查看详情", new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialog, int which) {
                    if (listener != null) {
                        listener.onClick(bean, binding.ivTopPhoto);
                    }
                }
            });
            return false;
        }
    });
}
Also used : DialogInterface(android.content.DialogInterface) PerfectClickListener(com.example.jingbin.cloudreader.utils.PerfectClickListener) ImageView(android.widget.ImageView) View(android.view.View)

Aggregations

View (android.view.View)11 PerfectClickListener (com.example.jingbin.cloudreader.utils.PerfectClickListener)11 ImageView (android.widget.ImageView)5 DialogInterface (android.content.DialogInterface)3 Handler (android.os.Handler)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 OvershootInterpolator (android.view.animation.OvershootInterpolator)1 RelativeLayout (android.widget.RelativeLayout)1 TextView (android.widget.TextView)1 RxBusBaseMessage (com.example.jingbin.cloudreader.http.rx.RxBusBaseMessage)1 Random (java.util.Random)1