当前位置: 首页>>代码示例>>Java>>正文


Java CircleImageView.setImageResource方法代码示例

本文整理汇总了Java中de.hdodenhof.circleimageview.CircleImageView.setImageResource方法的典型用法代码示例。如果您正苦于以下问题:Java CircleImageView.setImageResource方法的具体用法?Java CircleImageView.setImageResource怎么用?Java CircleImageView.setImageResource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在de.hdodenhof.circleimageview.CircleImageView的用法示例。


在下文中一共展示了CircleImageView.setImageResource方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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()));
}
 
开发者ID:SailFlorve,项目名称:RunHDU,代码行数:17,代码来源:FriendRecyclerViewAdapter.java

示例2: ShadowImageView

import de.hdodenhof.circleimageview.CircleImageView; //导入方法依赖的package包/类
public ShadowImageView(@NonNull Context context, @Nullable AttributeSet attrs, @AttrRes int defStyleAttr) {
    super(context, attrs, defStyleAttr);
    setBackgroundColor(getResources().getColor(android.R.color.transparent));
    //获取自定义属性值
    TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ShadowImageView);
    if (attrs == null) return;
    try {
        mShadowOffsetX = a.getDimension(R.styleable.ShadowImageView_shadowOffsetX, 0.0f);
        mShadowOffsetY = a.getDimension(R.styleable.ShadowImageView_shadowOffsetY, 0.0f);
        mShadowRadius = a.getDimension(R.styleable.ShadowImageView_shadowRadius, 0.0f);
        mImgId = a.getResourceId(R.styleable.ShadowImageView_src, -1);
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        a.recycle();
    }
    mImageView = new CircleImageView(context);
    mImageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
    mImageView.setImageResource(mImgId);
    addView(mImageView);

    int xPadding = (int) (mShadowRadius + Math.abs(mShadowOffsetX));
    int yPadding = (int) (mShadowRadius + Math.abs(mShadowOffsetY));
    setPadding(xPadding, yPadding, xPadding, yPadding);
}
 
开发者ID:DingMouRen,项目名称:AnnularMenuView,代码行数:26,代码来源:ShadowImageView.java

示例3: fillDrawerLayoutInfo

import de.hdodenhof.circleimageview.CircleImageView; //导入方法依赖的package包/类
private void fillDrawerLayoutInfo() {
    //空指针异常
    drawerHead = (CircleImageView) findViewById(R.id.nav_head_image);
    drawerNickName = (TextView) findViewById(R.id.nav_head_nickname);
    drawerPhone = (TextView) findViewById(R.id.nav_head_phonenum);
    verifyLogo = (ImageView) findViewById(R.id.nav_head_verify_logo);

    if (isLogin) {
        curUser.readFromLocalDatabase();
        drawerHead.setImageBitmap(Utility.convertStringToBitmap(curUser.getHeadIcon()));
        drawerNickName.setText(curUser.getNickName());
        //////
        String phoneT = curUser.getPhoneNum();
        drawerPhone.setText(phoneT.substring(0, 3) + "****" + phoneT.substring(7));
        drawerHead.setOnClickListener(null);
        if (curUser.isVerified()) {
            verifyLogo.setImageResource(R.mipmap.icon_yes_verify);
        } else {
            verifyLogo.setImageResource(R.mipmap.icon_no_verify);
        }
    } else {
        curUser.setNullValue();
        drawerHead.setImageResource(R.drawable.login);
        drawerNickName.setText(curUser.getNickName());
        drawerPhone.setText(curUser.getPhoneNum());
        drawerHead.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(ClientMainActivity.this, LoginActivity.class));
                //finish();
            }
        });
        verifyLogo.setImageBitmap(null);
    }


}
 
开发者ID:838030195,项目名称:DaiGo,代码行数:38,代码来源:ClientMainActivity.java


注:本文中的de.hdodenhof.circleimageview.CircleImageView.setImageResource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。