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


Java SimpleDraweeView.setOnClickListener方法代碼示例

本文整理匯總了Java中com.facebook.drawee.view.SimpleDraweeView.setOnClickListener方法的典型用法代碼示例。如果您正苦於以下問題:Java SimpleDraweeView.setOnClickListener方法的具體用法?Java SimpleDraweeView.setOnClickListener怎麽用?Java SimpleDraweeView.setOnClickListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.facebook.drawee.view.SimpleDraweeView的用法示例。


在下文中一共展示了SimpleDraweeView.setOnClickListener方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onViewCreated

import com.facebook.drawee.view.SimpleDraweeView; //導入方法依賴的package包/類
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
  final SimpleDraweeView draweeView = (SimpleDraweeView) view.findViewById(R.id.drawee_view);
  draweeView.setActualImageResource(R.drawable.logo);
  draweeView.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      final RotateAnimation rotateAnimation = new RotateAnimation(
          0,
          360,
          Animation.RELATIVE_TO_SELF,
          0.5f,
          Animation.RELATIVE_TO_SELF,
          0.5f);
      rotateAnimation.setDuration(1000);
      rotateAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
      draweeView.startAnimation(rotateAnimation);
    }
  });

  final Button buttonGitHub = (Button) view.findViewById(R.id.button_github);
  setUriIntent(buttonGitHub, URL_GITHUB);

  final Button buttonDocumentation = (Button) view.findViewById(R.id.button_documentation);
  setUriIntent(buttonDocumentation, URL_DOCUMENTATION);
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:27,代碼來源:WelcomeFragment.java

示例2: onViewCreated

import com.facebook.drawee.view.SimpleDraweeView; //導入方法依賴的package包/類
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
  final ImageUriProvider imageUriProvider = ImageUriProvider.getInstance(getContext());
  final Uri imageUri = imageUriProvider.createSampleUri(ImageUriProvider.ImageSize.M);

  final SimpleDraweeView simpleDraweeView =
      (SimpleDraweeView) view.findViewById(R.id.drawee_view);
  // You have to enable legacy visibility handling for the start view in order for this to work
  simpleDraweeView.setLegacyVisibilityHandlingEnabled(true);
  simpleDraweeView.setImageURI(imageUri);
  simpleDraweeView.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      startTransition(v, imageUri);
    }
  });
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:18,代碼來源:DraweeTransitionFragment.java

示例3: createSimpleDraweeView

import com.facebook.drawee.view.SimpleDraweeView; //導入方法依賴的package包/類
private SimpleDraweeView createSimpleDraweeView() {
    SimpleDraweeView view = new SimpleDraweeView(itemView.getContext());
    GenericDraweeHierarchyBuilder builder =
            new GenericDraweeHierarchyBuilder(itemView.getContext().getResources());
    GenericDraweeHierarchy hierarchy = builder
            .setActualImageScaleType(ScalingUtils.ScaleType.CENTER_CROP)
            .setPlaceholderImage(R.color.loading_color)
            .setPlaceholderImageScaleType(ScalingUtils.ScaleType.FIT_CENTER)
            .setFailureImage(R.mipmap.ic_failed)
            .setFailureImageScaleType(ScalingUtils.ScaleType.CENTER)
            .build();
    view.setHierarchy(hierarchy);
    view.setTag(atomicInteger.getAndIncrement());
    view.setOnClickListener(this);
    return view;
}
 
開發者ID:mingdroid,項目名稱:tumbviewer,代碼行數:17,代碼來源:PhotoPostVH.java

示例4: populateThumb

import com.facebook.drawee.view.SimpleDraweeView; //導入方法依賴的package包/類
private void populateThumb(View rootView, @IdRes int viewId, final Size size) {
  final SimpleDraweeView draweeView = (SimpleDraweeView) rootView.findViewById(viewId);

  loadThumb(draweeView, size, ImageRequest.RequestLevel.DISK_CACHE);

  draweeView.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      loadThumb(draweeView, size, ImageRequest.RequestLevel.FULL_FETCH);
    }
  });
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:13,代碼來源:MediaVariationsFragment.java

示例5: populateMainImage

import com.facebook.drawee.view.SimpleDraweeView; //導入方法依賴的package包/類
private void populateMainImage(View rootView) {
  mMainImageDraweeView = (SimpleDraweeView) rootView.findViewById(R.id.img_main);
  loadMainImage();

  mMainImageDraweeView.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      loadMainImage();
    }
  });

  ResizableFrameLayout mainImageFrameLayout =
      (ResizableFrameLayout) rootView.findViewById(R.id.frame_main);
  mainImageFrameLayout.init(rootView.findViewById(R.id.btn_resize));
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:16,代碼來源:MediaVariationsFragment.java

示例6: PhotoViewHolder

import com.facebook.drawee.view.SimpleDraweeView; //導入方法依賴的package包/類
public PhotoViewHolder(View itemView) {
    super(itemView);
    photoView = (SimpleDraweeView) itemView.findViewById(R.id.photoView);
    checkView = (ImageView) itemView.findViewById(R.id.check_view);
    photoView.setOnClickListener(this);
    photoView.setOnLongClickListener(this);

    int margin = (int) (8 * itemView.getContext().getResources().getDisplayMetrics().density);
    DEFAULT_PHOTO_WIDTH = HALF_WIDTH - margin;
}
 
開發者ID:mingdroid,項目名稱:tumbviewer,代碼行數:11,代碼來源:PhotoFragment.java

示例7: onCreateView

import com.facebook.drawee.view.SimpleDraweeView; //導入方法依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstance) {
    View view = inflater.inflate(R.layout.fragment_profile_edit, container, false);

    sdvProfileAvatar = (SimpleDraweeView) view.findViewById(R.id.sdv_profile_avatar);
    sdvProfileAvatar.setOnClickListener(this);

    tilProfileFirstname = (DCTextInputLayout) view.findViewById(R.id.til_profile_firstname);
    tietProfileFirstname = (DCTextInputEditText) view.findViewById(R.id.tiet_profile_firstname);
    tietProfileFirstname.setOnFocusChangeListener(this);

    tilProfileLastname = (DCTextInputLayout) view.findViewById(R.id.til_profile_lastname);
    tietProfileLastname = (DCTextInputEditText) view.findViewById(R.id.tiet_profile_lastname);
    tietProfileLastname.setOnFocusChangeListener(this);

    tilProfileEmail = (DCTextInputLayout) view.findViewById(R.id.til_profile_email);
    tietProfileEmail = (DCTextInputEditText) view.findViewById(R.id.tiet_profile_email);

    tilProfilePassword = (DCTextInputLayout) view.findViewById(R.id.til_profile_password);
    tietProfilePassword = (DCTextInputEditText) view.findViewById(R.id.tiet_profile_password);
    tietProfilePassword.setOnFocusChangeListener(this);

    etProfileBirthday = (DCEditText) view.findViewById(R.id.et_profile_birthday);
    etProfileBirthday.setOnClickListener(this);

    etProfileLocation = (DCEditText) view.findViewById(R.id.et_profile_location);
    etProfileLocation.setOnClickListener(this);

    tilProfileZipcode = (DCTextInputLayout) view.findViewById(R.id.til_profile_zipcode);
    tietProfileZipcode = (DCTextInputEditText) view.findViewById(R.id.tiet_profile_zipcode);

    btnProfileMale = (DCButton) view.findViewById(R.id.btn_profile_male);
    btnProfileFemale = (DCButton) view.findViewById(R.id.btn_profile_female);
    btnProfileMale.setOnClickListener(this);
    btnProfileFemale.setOnClickListener(this);

    btnProfileUpdate = (DCButton) view.findViewById(R.id.btn_profile_update);
    btnProfileUpdate.setOnClickListener(this);

    ivProfileClose = (ImageView) view.findViewById(R.id.iv_profile_close);
    ivProfileClose.setOnClickListener(this);
    ivProfileClose.setVisibility(View.GONE);

    loadUser();
    return view;
}
 
開發者ID:Dentacoin,項目名稱:aftercare-app-android,代碼行數:47,代碼來源:DCProfileEditFragment.java

示例8: createImageView

import com.facebook.drawee.view.SimpleDraweeView; //導入方法依賴的package包/類
private ImageView createImageView(int position, final boolean isMultiImage) {
	ImageList imageList = imagesList.get(position);
	SimpleDraweeView simpleDraweeView = new SimpleDraweeView(getContext());
	if(isMultiImage){
		simpleDraweeView.setScaleType(ScaleType.CENTER_CROP);
		simpleDraweeView.setLayoutParams(position % MAX_PER_ROW_COUNT == 0 ?moreParaColumnFirst : morePara);
	}else {
		simpleDraweeView.setAdjustViewBounds(true);
		simpleDraweeView.setScaleType(ScaleType.CENTER_INSIDE);
		//imageView.setMaxHeight(pxOneMaxWandH);

           int expectW = imageList.getWidth();
           int expectH = imageList.getHeight();

           if(expectW == 0 || expectH == 0){
			simpleDraweeView.setLayoutParams(onePicPara);
           }else{
               int actualW = 0;
               int actualH = 0;
               float scale = ((float) expectH)/((float) expectW);
               if(expectW > pxOneMaxWandH){
                   actualW = pxOneMaxWandH;
                   actualH = (int)(actualW * scale);
               } else if(expectW < pxMoreWandH){
                   actualW = pxMoreWandH;
                   actualH = (int)(actualW * scale);
               }else{
                   actualW = expectW;
                   actualH = expectH;
               }
			simpleDraweeView.setLayoutParams(new LayoutParams(actualW, actualH));
           }
	}

	simpleDraweeView.setId(imageList.getUrl().hashCode());
	simpleDraweeView.setOnClickListener(new ImageOnClickListener(position));
	simpleDraweeView.setBackgroundResource(R.mipmap.list_default);
	simpleDraweeView.setImageURI(Uri.parse(imageList.getUrl()));

	return simpleDraweeView;
}
 
開發者ID:BaoBaoJianqiang,項目名稱:CustomListView,代碼行數:42,代碼來源:NineImageView.java

示例9: prepareUI

import com.facebook.drawee.view.SimpleDraweeView; //導入方法依賴的package包/類
/**
     * 準備UI
     */
    private void prepareUI() {
        mTopBar = findViewById(R.id.v_cell_news_detail_top_bar);
        mContentView = (ViewGroup) findViewById(R.id.activity_news_detail);
        mProgressBar = (ProgressBar) findViewById(R.id.pb_news_detail_progressbar);
        mScrollView = (ScrollView) findViewById(R.id.bsv_news_detail_scrollview);
        mContentWebView = (WebView) findViewById(R.id.wv_news_detail_webview);
        mShareQQButton = findViewById(R.id.ll_article_content_share_qq);
        mShareWxButton = findViewById(R.id.ll_article_content_share_weixin);
        mSharePyqButton = findViewById(R.id.ll_article_content_share_pyq);
        mBackButton = (ImageButton) findViewById(R.id.ib_news_detail_bottom_bar_back);
        mEditButton = (ImageButton) findViewById(R.id.ib_news_detail_bottom_bar_edit);
        mFontButton = (ImageButton) findViewById(R.id.ib_news_detail_bottom_bar_font);
        mCollectionButton = (ImageButton) findViewById(R.id.ib_news_detail_bottom_bar_collection);
        mShareButton = (ImageButton) findViewById(R.id.ib_news_detail_bottom_bar_share);
        mLinkLayout = (LinearLayout) findViewById(R.id.ll_news_detail_links);
        mLinkRecyclerView = (RecyclerView) findViewById(R.id.rv_news_detail_links_recyclerview);
        mCommentLayout = (LinearLayout) findViewById(R.id.ll_news_detail_comment);
        mCommentRecyclerView = (RecyclerView) findViewById(R.id.rv_news_detail_comment_recyclerview);
        mMoreCommentButton = (Button) findViewById(R.id.btn_news_detail_comment_more);
        mAdImageView = (SimpleDraweeView) findViewById(R.id.iv_news_detail_ad_image);
        mAdTextView = (TextView) findViewById(R.id.tv_news_detail_ad_text);

        // 如果未能修改掉狀態欄的顏色,就修改狀態欄的背景顏色
        if (!isStatusChanged) {
            mTopBar.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
            mTopBar.setAlpha(1);
        }

        // 新聞正文
        WebSettings webSettings = mContentWebView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        // 開啟硬件加速後,webView內容太大會crash 還在尋求最終解決辦法
//        mContentWebView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
        mContentWebView.addJavascriptInterface(new ArticleJavascriptInterface(), "ARTICLE");
        mContentWebView.setWebChromeClient(new WebChromeClient() {
        });
        mContentWebView.setWebViewClient(new WebViewClient() {

            @Override
            public void onPageFinished(WebView view, String url) {
                super.onPageFinished(view, url);
                // 隱藏加載進度條
                mProgressBar.setVisibility(View.INVISIBLE);
                // 網頁加載完成才去加載其他UI
                setupDetailData();
                // 加載網頁緩存圖片
                getImageFromDownloaderOrDiskByImageUrlArray();
                // 頁麵滑動到頂部
                mScrollView.fullScroll(ScrollView.FOCUS_UP);
            }

        });

        // 底部工具條按鈕點擊事件
        mBackButton.setOnClickListener(this);
        mEditButton.setOnClickListener(this);
        mFontButton.setOnClickListener(this);
        mCollectionButton.setOnClickListener(this);
        mShareButton.setOnClickListener(this);
        mShareQQButton.setOnClickListener(this);
        mShareWxButton.setOnClickListener(this);
        mSharePyqButton.setOnClickListener(this);
        mAdImageView.setOnClickListener(this);

        // 更多評論
        mMoreCommentButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                // 跳轉到評論列表
                CommentListActivity.start(mContext, classid, id, commentBeanList, "news");
            }
        });

    }
 
開發者ID:6ag,項目名稱:LiuAGeAndroid,代碼行數:78,代碼來源:NewsDetailActivity.java


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