Search in sources :

Example 1 with PerfectClickListener

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

the class OneFragment method setAdapter.

private void setAdapter(HotMovieBean hotMovieBean) {
    LinearLayoutManager mLayoutManager = new LinearLayoutManager(getActivity());
    mLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
    bindingView.listOne.setLayoutManager(mLayoutManager);
    // 加上这两行代码,下拉出提示才不会产生出现刷新头的bug,不加拉不下来
    bindingView.listOne.setPullRefreshEnabled(false);
    bindingView.listOne.clearHeader();
    bindingView.listOne.setLoadingMoreEnabled(false);
    // 需加,不然滑动不流畅
    bindingView.listOne.setNestedScrollingEnabled(false);
    bindingView.listOne.setHasFixedSize(false);
    if (mHeaderView == null) {
        mHeaderView = View.inflate(getContext(), R.layout.header_item_one, null);
        View llMovieTop = mHeaderView.findViewById(R.id.ll_movie_top);
        ImageView ivImg = (ImageView) mHeaderView.findViewById(R.id.iv_img);
        ImgLoadUtil.displayRandom(3, ConstantsImageUrl.ONE_URL_01, ivImg);
        llMovieTop.setOnClickListener(new PerfectClickListener() {

            @Override
            protected void onNoDoubleClick(View v) {
                DoubanTopActivity.start(v.getContext());
            }
        });
    }
    bindingView.listOne.addHeaderView(mHeaderView);
    oneAdapter.clear();
    oneAdapter.addAll(hotMovieBean.getSubjects());
    bindingView.listOne.setAdapter(oneAdapter);
    oneAdapter.notifyDataSetChanged();
    isFirst = false;
}
Also used : PerfectClickListener(com.example.jingbin.cloudreader.utils.PerfectClickListener) ImageView(android.widget.ImageView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) ImageView(android.widget.ImageView) View(android.view.View)

Example 2 with PerfectClickListener

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

the class NavAboutActivity method initListener.

private void initListener() {
    bindingView.tvGankio.setOnClickListener(listener);
    bindingView.tvDouban.setOnClickListener(listener);
    bindingView.tvAboutStar.setOnClickListener(new PerfectClickListener() {

        @Override
        protected void onNoDoubleClick(View v) {
            BaseTools.openLink(v.getContext(), CommonUtils.getString(R.string.string_url_cloudreader));
        }
    });
    bindingView.tvFunction.setOnClickListener(new PerfectClickListener() {

        @Override
        protected void onNoDoubleClick(View v) {
            BaseTools.openLink(v.getContext(), string_url_update_log);
        }
    });
    bindingView.tvNewVersion.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            BaseTools.openLink(v.getContext(), CommonUtils.getString(R.string.string_url_new_version));
        }
    });
}
Also used : PerfectClickListener(com.example.jingbin.cloudreader.utils.PerfectClickListener) View(android.view.View)

Example 3 with PerfectClickListener

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

the class BaseActivity method setContentView.

@Override
public void setContentView(@LayoutRes int layoutResID) {
    mBaseBinding = DataBindingUtil.inflate(LayoutInflater.from(this), R.layout.activity_base, null, false);
    bindingView = DataBindingUtil.inflate(getLayoutInflater(), layoutResID, null, false);
    // content
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    bindingView.getRoot().setLayoutParams(params);
    RelativeLayout mContainer = (RelativeLayout) mBaseBinding.getRoot().findViewById(R.id.container);
    mContainer.addView(bindingView.getRoot());
    getWindow().setContentView(mBaseBinding.getRoot());
    // 设置透明状态栏
    StatusBarUtil.setColor(this, CommonUtils.getColor(R.color.colorTheme), 0);
    llProgressBar = getView(R.id.ll_progress_bar);
    refresh = getView(R.id.ll_error_refresh);
    ImageView img = getView(R.id.img_progress);
    // 加载动画
    mAnimationDrawable = (AnimationDrawable) img.getDrawable();
    // 默认进入页面就开启动画
    if (!mAnimationDrawable.isRunning()) {
        mAnimationDrawable.start();
    }
    setToolBar();
    // 点击加载失败布局
    refresh.setOnClickListener(new PerfectClickListener() {

        @Override
        protected void onNoDoubleClick(View v) {
            showLoading();
            onRefresh();
        }
    });
    bindingView.getRoot().setVisibility(View.GONE);
}
Also used : PerfectClickListener(com.example.jingbin.cloudreader.utils.PerfectClickListener) RelativeLayout(android.widget.RelativeLayout) ImageView(android.widget.ImageView) ImageView(android.widget.ImageView) View(android.view.View)

Example 4 with PerfectClickListener

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

the class EverydayAdapter method setOnClick.

private void setOnClick(final LinearLayout linearLayout, final AndroidBean bean) {
    linearLayout.setOnClickListener(new PerfectClickListener() {

        @Override
        protected void onNoDoubleClick(View v) {
            WebViewActivity.loadUrl(v.getContext(), bean.getUrl(), bean.getDesc());
        }
    });
    linearLayout.setOnLongClickListener(new View.OnLongClickListener() {

        @Override
        public boolean onLongClick(View v) {
            String title = TextUtils.isEmpty(bean.getType()) ? bean.getDesc() : bean.getType() + ":  " + bean.getDesc();
            DialogBuild.showCustom(v, title, "查看详情", new DialogInterface.OnClickListener() {

                @Override
                public void onClick(DialogInterface dialog, int which) {
                    WebViewActivity.loadUrl(linearLayout.getContext(), bean.getUrl(), bean.getDesc());
                }
            });
            return false;
        }
    });
}
Also used : DialogInterface(android.content.DialogInterface) PerfectClickListener(com.example.jingbin.cloudreader.utils.PerfectClickListener) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView)

Example 5 with PerfectClickListener

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

the class NavDownloadActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_nav_download);
    showContentView();
    setTitle("扫码下载");
    QRCodeUtil.showThreadImage(this, Constants.DOWNLOAD_URL, bindingView.ivErweima, R.drawable.ic_cloudreader_mip);
    bindingView.tvShare.setOnClickListener(new PerfectClickListener() {

        @Override
        protected void onNoDoubleClick(View v) {
            ShareUtils.share(v.getContext(), R.string.string_share_text);
        }
    });
}
Also used : PerfectClickListener(com.example.jingbin.cloudreader.utils.PerfectClickListener) 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