本文整理匯總了Java中de.hdodenhof.circleimageview.CircleImageView.setVisibility方法的典型用法代碼示例。如果您正苦於以下問題:Java CircleImageView.setVisibility方法的具體用法?Java CircleImageView.setVisibility怎麽用?Java CircleImageView.setVisibility使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類de.hdodenhof.circleimageview.CircleImageView
的用法示例。
在下文中一共展示了CircleImageView.setVisibility方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setRoundCornerDefault
import de.hdodenhof.circleimageview.CircleImageView; //導入方法依賴的package包/類
/**
* Set the default image for this thread in the action bar.
* */
protected void setRoundCornerDefault(CircleImageView circleImageView, ImageView roundedCornerImageView, View.OnClickListener onClickListener){
circleImageView.setVisibility(View.INVISIBLE);
roundedCornerImageView.setVisibility(View.INVISIBLE);
if (thread.getTypeSafely() == BThread.Type.Public)
roundedCornerImageView.setImageResource(R.drawable.ic_users);
else if (thread.getUsers().size() < 3)
roundedCornerImageView.setImageResource(R.drawable.ic_profile);
else
roundedCornerImageView.setImageResource(R.drawable.ic_users);
roundedCornerImageView.setVisibility(View.VISIBLE);
roundedCornerImageView.bringToFront();
roundedCornerImageView.setOnClickListener(onClickListener);
}
示例2: convert
import de.hdodenhof.circleimageview.CircleImageView; //導入方法依賴的package包/類
@Override
protected void convert(BaseViewHolder helper, FriendInfo item) {
CircleImageView profileImg = helper.getView(R.id.friend_profile_list_item);
CircleImageView onlineImg = helper.getView(R.id.online_flag_img);
Utility.loadFriendProfileImg(mContext.getApplicationContext(), item.getUsername(), profileImg);
if (item.isOnline()) {
onlineImg.setVisibility(View.VISIBLE);
onlineImg.setImageResource(R.drawable.green);
} else {
onlineImg.setVisibility(View.INVISIBLE);
}
helper.setText(R.id.friend_name_list_item, item.getUsername());
helper.setText(R.id.friend_des_list_item,
String.format("今日跑步%d次 | 共跑步%d次", item.getNumToday(), item.getNumAll()));
}
示例3: initViews
import de.hdodenhof.circleimageview.CircleImageView; //導入方法依賴的package包/類
@Override
protected void initViews() {
StatusBarUtil.setPaddingSmart(this, findViewById(R.id.id_statusbar));
StatusBarUtil.immersive(this, ResouceUtil.getColor(R.color.gray));
mAutorTv = (TextView) findViewById(R.id.id_author_tv);
mAvatarIv = (CircleImageView) findViewById(R.id.id_avatar_iv);
mFollowTv = (TextView) findViewById(R.id.id_follow_tv);
mWebView = (UIWebView) findViewById(R.id.id_webview);
mAvatarIv.setVisibility(View.GONE);
mFollowTv.setVisibility(View.VISIBLE);
findViewById(R.id.id_back_iv).setOnClickListener(this);
mFollowTv.setOnClickListener(this);
mWebView.setOnKeyListener((v, keyCode, event) -> {
if (event.getAction() == KeyEvent.ACTION_DOWN) {
if (keyCode == KeyEvent.KEYCODE_BACK && mWebView.canGoBack()) { //表示按返回鍵
mWebView.goBack();
return true;
}
}
return false;
});
}
示例4: setThreadImage
import de.hdodenhof.circleimageview.CircleImageView; //導入方法依賴的package包/類
/**
* Setting the thread image in the action bar.
* */
protected boolean setThreadImage(final CircleImageView circleImageView, final ImageView imageView, final View.OnClickListener onClickListener){
final String imageUrl = thread.threadImageUrl();
if (circleImageView.getTag() == null || StringUtils.isEmpty(imageUrl) || !imageUrl.equals(circleImageView.getTag()))
{
if (StringUtils.isEmpty(imageUrl))
setRoundCornerDefault(circleImageView, imageView, onClickListener);
else
{
// Check if there is a image saved in the cahce for this thread.
// if (thread.getType()==BThread.Type.Private)
if (imageUrl.split(",").length > 1)
{
int size = getResources().getDimensionPixelSize(R.dimen.chat_sdk_chat_action_barcircle_image_view_size);
new MakeThreadImage(imageUrl.split(","), size, size, thread.getEntityID(), circleImageView);
circleImageView.setOnClickListener(onClickListener);
circleImageView.setVisibility(View.VISIBLE);
circleImageView.bringToFront();
}
else
VolleyUtils.getImageLoader().get(imageUrl, new ImageLoader.ImageListener() {
@Override
public void onResponse(ImageLoader.ImageContainer response, boolean isImmediate) {
if (response.getBitmap() != null) {
circleImageView.setTag(imageUrl);
circleImageView.setVisibility(View.INVISIBLE);
imageView.setVisibility(View.INVISIBLE);
circleImageView.setImageBitmap(response.getBitmap());
circleImageView.setVisibility(View.VISIBLE);
// setting the task description again so the thread image will be seeing.
setTaskDescription(response.getBitmap(), getTaskDescriptionLabel(), getTaskDescriptionColor());
circleImageView.setOnClickListener(onClickListener);
circleImageView.bringToFront();
}
}
@Override
public void onErrorResponse(VolleyError error) {
setRoundCornerDefault(circleImageView, imageView, onClickListener);
}
});
}
return true;
}
return false;
}