本文整理汇总了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);
}
示例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);
}
});
}
示例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;
}
示例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);
}
});
}
示例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));
}
示例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;
}
示例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;
}
示例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;
}
示例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");
}
});
}