當前位置: 首頁>>代碼示例>>Java>>正文


Java PerfectClickListener類代碼示例

本文整理匯總了Java中com.example.jingbin.cloudreader.utils.PerfectClickListener的典型用法代碼示例。如果您正苦於以下問題:Java PerfectClickListener類的具體用法?Java PerfectClickListener怎麽用?Java PerfectClickListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PerfectClickListener類屬於com.example.jingbin.cloudreader.utils包,在下文中一共展示了PerfectClickListener類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onActivityCreated

import com.example.jingbin.cloudreader.utils.PerfectClickListener; //導入依賴的package包/類
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    mLlProgressBar = getView(R.id.ll_progress_bar);
    ImageView img = getView(R.id.img_progress);

    // 加載動畫
    mAnimationDrawable = (AnimationDrawable) img.getDrawable();
    // 默認進入頁麵就開啟動畫
    if (!mAnimationDrawable.isRunning()) {
        mAnimationDrawable.start();
    }
    mRefresh = getView(R.id.ll_error_refresh);
    // 點擊加載失敗布局
    mRefresh.setOnClickListener(new PerfectClickListener() {
        @Override
        protected void onNoDoubleClick(View v) {
            showLoading();
            onRefresh();
        }
    });
    bindingView.getRoot().setVisibility(View.GONE);

}
 
開發者ID:joelan,項目名稱:ClouldReader,代碼行數:25,代碼來源:BaseFragment.java

示例2: bindItem

import com.example.jingbin.cloudreader.utils.PerfectClickListener; //導入依賴的package包/類
private void bindItem(final BooksBean book, int position) {
            mBindBook.setBean(book);
            mBindBook.executePendingBindings();

            mBindBook.llItemTop.setOnClickListener(new PerfectClickListener() {
                @Override
                protected void onNoDoubleClick(View v) {
                    BookDetailActivity.start(context,book,mBindBook.ivTopPhoto);
                }
            });

//            ViewGroup.LayoutParams params=iVFilm.getLayoutParams();
//            int width= ScreenUtils.getScreenWidthDp(context);
//            int ivWidth=(width-ScreenUtils.dipToPx(context,80))/3;
//            params.width=ivWidth;
//            double height=(420.0/300.0)*ivWidth;
//            params.height=(int)height;
//            iVFilm.setLayoutParams(params);
        }
 
開發者ID:joelan,項目名稱:ClouldReader,代碼行數:20,代碼來源:BookAdapter.java

示例3: onCreate

import com.example.jingbin.cloudreader.utils.PerfectClickListener; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_nav_download);
    showContentView();

    setTitle("掃碼下載");
    String url = "https://fir.im/cloudreader";
    QRCodeUtil.showThreadImage(this, 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);
        }
    });
}
 
開發者ID:joelan,項目名稱:ClouldReader,代碼行數:17,代碼來源:NavDownloadActivity.java

示例4: setContentView

import com.example.jingbin.cloudreader.utils.PerfectClickListener; //導入依賴的package包/類
@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);
}
 
開發者ID:joelan,項目名稱:ClouldReader,代碼行數:38,代碼來源:BaseActivity.java

示例5: onBindViewHolder

import com.example.jingbin.cloudreader.utils.PerfectClickListener; //導入依賴的package包/類
@Override
public void onBindViewHolder(final PersonBean bean, int position) {
    binding.setPersonBean(bean);
    binding.llItem.setOnClickListener(new PerfectClickListener() {
        @Override
        protected void onNoDoubleClick(View v) {
            if (bean != null && !TextUtils.isEmpty(bean.getAlt())) {
                WebViewActivity.loadUrl(v.getContext(), bean.getAlt(), bean.getName());
            }
        }
    });
}
 
開發者ID:joelan,項目名稱:ClouldReader,代碼行數:13,代碼來源:MovieDetailAdapter.java

示例6: setAdapter

import com.example.jingbin.cloudreader.utils.PerfectClickListener; //導入依賴的package包/類
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;
    }
 
開發者ID:joelan,項目名稱:ClouldReader,代碼行數:36,代碼來源:OneFragment.java

示例7: onCreate

import com.example.jingbin.cloudreader.utils.PerfectClickListener; //導入依賴的package包/類
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mBinding = DataBindingUtil.setContentView(this, R.layout.activity_transition);

        int i = new Random().nextInt(ConstantsImageUrl.TRANSITION_URLS.length);
        // 先顯示默認圖
        mBinding.ivDefultPic.setImageDrawable(CommonUtils.getDrawable(R.drawable.img_transition_default));
        Glide.with(this)
                .load(ConstantsImageUrl.TRANSITION_URLS[i])
                .placeholder(R.drawable.img_transition_default)
                .error(R.drawable.img_transition_default)
                .into(mBinding.ivPic);

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                mBinding.ivDefultPic.setVisibility(View.GONE);
            }
        }, 1500);

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                toMainActivity();
            }
        }, 2000);

//        Animation animation = AnimationUtils.loadAnimation(this, R.anim.transition_anim);
//        animation.setAnimationListener(animationListener);
//        mBinding.ivPic.startAnimation(animation);

        mBinding.tvJump.setOnClickListener(new PerfectClickListener() {
            @Override
            protected void onNoDoubleClick(View v) {
                toMainActivity();
//                animationEnd();
            }
        });
    }
 
開發者ID:joelan,項目名稱:ClouldReader,代碼行數:41,代碼來源:TransitionActivity.java

示例8: onCreate

import com.example.jingbin.cloudreader.utils.PerfectClickListener; //導入依賴的package包/類
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mBinding = DataBindingUtil.setContentView(this, R.layout.activity_transition);

        int i = new Random().nextInt(ConstantsImageUrl.TRANSITION_URLS.length);
        // 先顯示默認圖
        mBinding.ivDefultPic.setImageDrawable(CommonUtils.getDrawable(R.drawable.img_transition_default));
        Glide.with(this)
                .load(ConstantsImageUrl.TRANSITION_URLS[i])
                .placeholder(R.drawable.img_transition_default)
                .error(R.drawable.img_transition_default)
                .into(mBinding.ivPic);

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                mBinding.ivDefultPic.setVisibility(View.GONE);
            }
        }, 1500);

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                toMainActivity();
            }
        }, 3500);

//        Animation animation = AnimationUtils.loadAnimation(this, R.anim.transition_anim);
//        animation.setAnimationListener(animationListener);
//        mBinding.ivPic.startAnimation(animation);

        mBinding.tvJump.setOnClickListener(new PerfectClickListener() {
            @Override
            protected void onNoDoubleClick(View v) {
                toMainActivity();
//                animationEnd();
            }
        });
    }
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:41,代碼來源:TransitionActivity.java

示例9: setContentView

import com.example.jingbin.cloudreader.utils.PerfectClickListener; //導入依賴的package包/類
@Override
public void setContentView(@LayoutRes int layoutResID) {
    View ll = getLayoutInflater().inflate(R.layout.activity_header_base, null);

    // 內容
    bindingContentView = DataBindingUtil.inflate(getLayoutInflater(), layoutResID, null, false);
    // 頭部
    bindingHeaderView = DataBindingUtil.inflate(getLayoutInflater(), setHeaderLayout(), null, false);
    // 標題
    bindingTitleView = DataBindingUtil.inflate(getLayoutInflater(), R.layout.base_header_title_bar, null, false);

    // title (如自定義很強可以拿出去)
    RelativeLayout.LayoutParams titleParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    bindingTitleView.getRoot().setLayoutParams(titleParams);
    RelativeLayout mTitleContainer = (RelativeLayout) ll.findViewById(R.id.title_container);
    mTitleContainer.addView(bindingTitleView.getRoot());
    getWindow().setContentView(ll);

    // header
    RelativeLayout.LayoutParams headerParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    bindingHeaderView.getRoot().setLayoutParams(headerParams);
    RelativeLayout mHeaderContainer = (RelativeLayout) ll.findViewById(R.id.header_container);
    mHeaderContainer.addView(bindingHeaderView.getRoot());
    getWindow().setContentView(ll);

    // content
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    bindingContentView.getRoot().setLayoutParams(params);
    RelativeLayout mContainer = (RelativeLayout) ll.findViewById(R.id.container);
    mContainer.addView(bindingContentView.getRoot());
    getWindow().setContentView(ll);

    llProgressBar = getView(R.id.ll_progress_bar);
    refresh = getView(R.id.ll_error_refresh);

    // 設置自定義元素共享切換動畫
    setMotion(setHeaderPicView(),false);

    // 初始化滑動漸變
    initSlideShapeTheme(setHeaderImgUrl(), setHeaderImageView());

    // 設置toolbar
    setToolBar();

    ImageView img = getView(R.id.img_progress);

    // 加載動畫
    mAnimationDrawable = (AnimationDrawable) img.getDrawable();
    // 默認進入頁麵就開啟動畫
    if (!mAnimationDrawable.isRunning()) {
        mAnimationDrawable.start();
    }
    // 點擊加載失敗布局
    refresh.setOnClickListener(new PerfectClickListener() {
        @Override
        protected void onNoDoubleClick(View v) {
            showLoading();
            onRefresh();
        }
    });
    bindingContentView.getRoot().setVisibility(View.GONE);

}
 
開發者ID:joelan,項目名稱:ClouldReader,代碼行數:64,代碼來源:BaseHeaderActivity.java

示例10: onBindViewHolder

import com.example.jingbin.cloudreader.utils.PerfectClickListener; //導入依賴的package包/類
@Override
        public void onBindViewHolder(final SubjectsBean positionData, final int position) {
            if (positionData != null) {
                binding.setSubjectsBean(positionData);
                // 圖片
//                ImgLoadUtil.displayEspImage(positionData.getImages().getLarge(), binding.ivOnePhoto,0);
                // 導演
//                binding.tvOneDirectors.setText(StringFormatUtil.formatName(positionData.getDirectors()));
                // 主演
//                binding.tvOneCasts.setText(StringFormatUtil.formatName(positionData.getCasts()));
                // 類型
//                binding.tvOneGenres.setText("類型:" + StringFormatUtil.formatGenres(positionData.getGenres()));
                // 評分
//                binding.tvOneRatingRate.setText("評分:" + String.valueOf(positionData.getRating().getAverage()));
                // 分割線顏色
                binding.viewColor.setBackgroundColor(CommonUtils.randomColor());

                ViewHelper.setScaleX(itemView,0.8f);
                ViewHelper.setScaleY(itemView,0.8f);
                ViewPropertyAnimator.animate(itemView).scaleX(1).setDuration(350).setInterpolator(new OvershootInterpolator()).start();
                ViewPropertyAnimator.animate(itemView).scaleY(1).setDuration(350).setInterpolator(new OvershootInterpolator()).start();

                binding.llOneItem.setOnClickListener(new PerfectClickListener() {
                    @Override
                    protected void onNoDoubleClick(View v) {

                        OneMovieDetailActivity.start(activity, positionData, binding.ivOnePhoto);

//                        if (position % 2 == 0) {

//                            SlideScrollViewActivity.start(activity, positionData, binding.ivOnePhoto);

//                            MovieDetailActivity.start(activity, positionData, binding.ivOnePhoto);
//                            OneMovieDetailActivity.start(activity, positionData, binding.ivOnePhoto);

//                            TestActivity.start(activity, positionData, binding.ivOnePhoto);
//                            activity.overridePendingTransition(R.anim.push_fade_out, R.anim.push_fade_in);
//                        } else {
//                            SlideScrollViewActivity.start(activity, positionData, binding.ivOnePhoto);
//                            SlideShadeViewActivity.start(activity, positionData, binding.ivOnePhoto);
//                            OneMovieDetailActivity.start(activity, positionData, binding.ivOnePhoto);
//                        }

                        // 這個可以
//                        SlideScrollViewActivity.start(activity, positionData, binding.ivOnePhoto);
//                        TestActivity.start(activity,positionData,binding.ivOnePhoto);
//                        v.getContext().startActivity(new Intent(v.getContext(), SlideScrollViewActivity.class));

//                        SlideShadeViewActivity.start(activity, positionData, binding.ivOnePhoto);

                    }
                });
            }
        }
 
開發者ID:joelan,項目名稱:ClouldReader,代碼行數:55,代碼來源:OneAdapter.java


注:本文中的com.example.jingbin.cloudreader.utils.PerfectClickListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。