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


Java AsyncImageView.setResource方法代码示例

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


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

示例1: bindView

import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
@Override
protected void bindView(View v, int partition, List<Friend> data, int position) {
    super.bindView(v, partition, data, position);

    ViewHolder holder = (ViewHolder) v.getTag();
    TextView name = holder.name;
    AsyncImageView photo = holder.photo;

    Friend friend = data.get(position);
    name.setText(friend.getNickname());

    Resource res = new Resource(friend.getPortrait());

    photo.setDefaultDrawable(mContext.getResources().getDrawable(R.drawable.de_default_portrait));
    photo.setResource(res);

    String userId = friend.getUserId();
    holder.userId = userId;

}
 
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:21,代码来源:BlackMultiChoiceAdapter.java

示例2: bindView

import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
@Override
protected void bindView(View v, int partition, List<Friend> data, int position) {

    ViewHolder holder = (ViewHolder) v.getTag();
    TextView name = holder.name;
    AsyncImageView photo = holder.photo;
    TextView choice = holder.unreadnum;
    Friend friend = data.get(position);
    name.setText(friend.getNickname());

    Resource res = new Resource(friend.getPortrait());

    photo.setResource(res);

    photo.setTag(position);
    holder.friend = friend;

}
 
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:19,代码来源:BlackListAdapter.java

示例3: addMarker

import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
private void addMarker(LatLng latLng, String url) {
        AsyncImageView imageView = (AsyncImageView) LayoutInflater.from(this).inflate(R.layout.map_marker_view, null);
//        AsyncImageView imageView = (AsyncImageView) view.findViewById(R.id.icon);
        imageView.setResource(new Resource(url));

//        aMap.addMarker(new MarkerOptions().anchor(0.5f, 0.5f)
//                .position(new LatLng(30.679879, 104.064855)).title("成都市")
//                .snippet("成都市:30.679879, 104.064855").draggable(true));

        MarkerOptions markerOption = new MarkerOptions();
        markerOption.position(new LatLng(34.341568, 108.940174));
//        markerOption.title("西安市").snippet("西安市:34.341568, 108.940174");
//        markerOption.draggable(true);
//        markerOption.icon(BitmapDescriptorFactory.fromResource(R.drawable.rc_default_portrait));
        markerOption.icon(BitmapDescriptorFactory.fromView(imageView));
//        markerOption.icon(BitmapDescriptorFactory
//                .defaultMarker(BitmapDescriptorFactory.HUE_RED));


        Marker marker2 = aMap.addMarker(markerOption);
        // marker旋转90度
//        marker2.setRotateAngle(90);
    }
 
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:24,代码来源:ShareLocationActivity.java

示例4: initView

import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
protected void initView() {
        getSupportActionBar().setTitle(R.string.de_actionbar_myacc);

        mImgMyPortrait = (AsyncImageView) findViewById(R.id.img_my_portrait);
        mMyPortrait = (RelativeLayout) findViewById(R.id.rl_my_portrait);
        mMyUsername = (RelativeLayout) findViewById(R.id.rl_my_username);
        mTVUsername = (TextView) findViewById(R.id.tv_my_username);

        if (DemoContext.getInstance().getSharedPreferences() != null) {
//            String userId = DemoContext.getInstance().getSharedPreferences().getString("DEMO_USER_ID", null);
            mUserName = DemoContext.getInstance().getSharedPreferences().getString(Constants.APP_USER_NAME, null);
            String userPortrait = DemoContext.getInstance().getSharedPreferences().getString("DEMO_USER_PORTRAIT", null);
            mImgMyPortrait.setResource(new Resource(Uri.parse(userPortrait)));
            mTVUsername.setText(mUserName.toString());
        }

        mMyPortrait.setOnClickListener(this);
        mMyUsername.setOnClickListener(this);
//        mResourceHandler = new ResourceHandler.Builder().enableBitmapCache().build(this);


    }
 
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:23,代码来源:MyAccountActivity.java

示例5: onEventMainThread

import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
public void onEventMainThread(UserInfo userInfo) {
    if (targetId != null && targetId.equals(userInfo.getUserId())) {
        TextView userName = (TextView) mUserInfoContainer.findViewById(R.id.rc_voip_user_name);
        if (userInfo.getName() != null)
            userName.setText(userInfo.getName());
        AsyncImageView userPortrait = (AsyncImageView) mUserInfoContainer.findViewById(R.id.rc_voip_user_portrait);
        if (userPortrait != null && userInfo.getPortraitUri() != null) {
            userPortrait.setResource(userInfo.getPortraitUri().toString(), R.drawable.rc_default_portrait);
        }
    }
}
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:12,代码来源:SingleCallActivity.java

示例6: bindView

import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
@Override
protected void bindView(View v, int partition, List<Friend> data, int position) {
    super.bindView(v, partition, data, position);

    ViewHolder holder = (ViewHolder) v.getTag();
    TextView name = holder.name;
    AsyncImageView photo = holder.photo;

    Friend friend = data.get(position);
    name.setText(friend.getNickname());

    Resource res = new Resource(friend.getPortrait());

    photo.setDefaultDrawable(mContext.getResources().getDrawable(R.drawable.de_default_portrait));
    photo.setResource(res);

    String userId = friend.getUserId();
    holder.userId = userId;
    if (friend.isSelected()) {
        holder.choice.setButtonDrawable(mContext.getResources().getDrawable(R.drawable.de_ui_friend_checkbox_gray));
        holder.choice.setChecked(true);
        holder.choice.setEnabled(false);
    } else {
        holder.choice.setEnabled(true);
        holder.choice.setChecked(mChoiceFriendIds.contains(friend.getUserId()));
        holder.choice.setButtonDrawable(mContext.getResources().getDrawable(R.drawable.de_ui_friend_check_selector));
    }
}
 
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:29,代码来源:FriendMultiChoiceAdapter.java

示例7: bindView

import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
@Override
protected void bindView(View v, int partition, List<Friend> data, int position) {
    super.bindView(v, partition, data, position);

    ViewHolder holder = (ViewHolder) v.getTag();
    TextView name = holder.name;
    AsyncImageView photo = holder.photo;

    Friend friend = data.get(position);
    name.setText(friend.getNickname());

    Resource res = new Resource(friend.getPortrait());
    if(friend.getUserId().equals("★001")){
        photo.setDefaultDrawable(mContext.getResources().getDrawable(R.drawable.de_address_new_friend));
    }else if(friend.getUserId().equals("★002")){
        photo.setDefaultDrawable(mContext.getResources().getDrawable(R.drawable.de_address_group));
    }else if(friend.getUserId().equals("★003")){
        photo.setDefaultDrawable(mContext.getResources().getDrawable(R.drawable.de_address_public));
    }else{
        photo.setDefaultDrawable(mContext.getResources().getDrawable(R.drawable.de_default_portrait));
    }
    photo.setResource(res);

    String userId = friend.getUserId();
    holder.userId = userId;

}
 
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:28,代码来源:ContactsMultiChoiceAdapter.java

示例8: setupIntent

import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
private void setupIntent() {
        RongCallCommon.CallMediaType mediaType;
        Intent intent = getIntent();
        RongCallAction callAction = RongCallAction.valueOf(intent.getStringExtra("callAction"));
//        if (callAction.equals(RongCallAction.ACTION_RESUME_CALL)) {
//            return;
//        }
        if (callAction.equals(RongCallAction.ACTION_INCOMING_CALL)) {
            callSession = intent.getParcelableExtra("callSession");
            mediaType = callSession.getMediaType();
            targetId = callSession.getInviterUserId();
        } else if (callAction.equals(RongCallAction.ACTION_OUTGOING_CALL)) {
            if (intent.getAction().equals(RongVoIPIntent.RONG_INTENT_ACTION_VOIP_SINGLEAUDIO)) {
                mediaType = RongCallCommon.CallMediaType.AUDIO;
            } else {
                mediaType = RongCallCommon.CallMediaType.VIDEO;
            }
            Conversation.ConversationType conversationType = Conversation.ConversationType.valueOf(intent.getStringExtra("conversationType").toUpperCase(Locale.US));
            targetId = intent.getStringExtra("targetId");

            List<String> userIds = new ArrayList<>();
            userIds.add(targetId);
            RongCallClient.getInstance().startCall(conversationType, targetId, userIds, mediaType, null);
        } else { // resume call
            callSession = RongCallClient.getInstance().getCallSession();
            mediaType = callSession.getMediaType();
        }

        if (mediaType.equals(RongCallCommon.CallMediaType.AUDIO)) {
            handFree = false;
        } else if (mediaType.equals(RongCallCommon.CallMediaType.VIDEO)) {
            handFree = true;
        }

        UserInfo userInfo = RongContext.getInstance().getUserInfoFromCache(targetId);
        if (userInfo != null) {
            TextView userName = (TextView) mUserInfoContainer.findViewById(R.id.rc_voip_user_name);
            userName.setText(userInfo.getName());
            if (mediaType.equals(RongCallCommon.CallMediaType.AUDIO)) {
                AsyncImageView userPortrait = (AsyncImageView) mUserInfoContainer.findViewById(R.id.rc_voip_user_portrait);
                if (userPortrait != null && userInfo.getPortraitUri() != null) {
                    userPortrait.setResource(userInfo.getPortraitUri().toString(), R.drawable.rc_default_portrait);
                }
            }
        }

        createPowerManager();
        createPickupDetector();
    }
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:50,代码来源:SingleCallActivity.java

示例9: setupIntent

import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
private void setupIntent() {
        RongCallCommon.CallMediaType mediaType;
        Intent intent = getIntent();
        RongCallAction callAction = RongCallAction.valueOf(intent.getStringExtra("callAction"));
//        if (callAction.equals(RongCallAction.ACTION_RESUME_CALL)) {
//            return;
//        }
        if (callAction.equals(RongCallAction.ACTION_INCOMING_CALL)) {
            callSession = intent.getParcelableExtra("callSession");
            mediaType = callSession.getMediaType();
            targetId = callSession.getInviterUserId();
        } else if (callAction.equals(RongCallAction.ACTION_OUTGOING_CALL)) {
            if (intent.getAction().equals(RongVoIPIntent.RONG_INTENT_ACTION_VOIP_SINGLEAUDIO)) {
                mediaType = RongCallCommon.CallMediaType.AUDIO;
            } else {
                mediaType = RongCallCommon.CallMediaType.VIDEO;
            }
            Conversation.ConversationType conversationType = Conversation.ConversationType.valueOf(intent.getStringExtra("conversationType").toUpperCase(Locale.getDefault()));
            targetId = intent.getStringExtra("targetId");

            List<String> userIds = new ArrayList<>();
            userIds.add(targetId);
            RongCallClient.getInstance().startCall(conversationType, targetId, userIds, mediaType, null);
        } else { // resume call
            callSession = RongCallClient.getInstance().getCallSession();
            mediaType = callSession.getMediaType();
        }

        if (mediaType.equals(RongCallCommon.CallMediaType.AUDIO)) {
            handFree = false;
        } else if (mediaType.equals(RongCallCommon.CallMediaType.VIDEO)) {
            handFree = true;
        }

        UserInfo userInfo = RongContext.getInstance().getUserInfoFromCache(targetId);
        if (userInfo != null) {
            TextView userName = (TextView) mUserInfoContainer.findViewById(R.id.rc_voip_user_name);
            userName.setText(userInfo.getName());
            if (mediaType.equals(RongCallCommon.CallMediaType.AUDIO)) {
                AsyncImageView userPortrait = (AsyncImageView) mUserInfoContainer.findViewById(R.id.rc_voip_user_portrait);
                if (userPortrait != null) {
                    userPortrait.setResource(userInfo.getPortraitUri().toString(), R.drawable.rc_default_portrait);
                }
            }
        }
    }
 
开发者ID:LanguidSheep,项目名称:sealtalk-android-master,代码行数:47,代码来源:SingleCallActivity.java

示例10: setupIntent

import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
private void setupIntent () {
    RongCallCommon.CallMediaType mediaType;
    Intent intent = getIntent();
    RongCallAction callAction = RongCallAction.valueOf(intent.getStringExtra("callAction"));
    if (callAction == null || callAction.equals(RongCallAction.ACTION_RESUME_CALL)) {
        return;
    }
    if (callAction.equals(RongCallAction.ACTION_INCOMING_CALL)) {
        callSession = intent.getParcelableExtra("callSession");
        mediaType = callSession.getMediaType();
        targetId = callSession.getInviterUserId();
    } else if (callAction.equals(RongCallAction.ACTION_OUTGOING_CALL)) {
        if (intent.getAction().equals(RongVoIPIntent.RONG_INTENT_ACTION_VOIP_SINGLEAUDIO)) {
            mediaType = RongCallCommon.CallMediaType.AUDIO;
        } else {
            mediaType = RongCallCommon.CallMediaType.VIDEO;
        }
        Conversation.ConversationType conversationType = Conversation.ConversationType.valueOf(intent.getStringExtra("conversationType").toUpperCase(Locale.getDefault()));
        targetId = intent.getStringExtra("targetId");

        List<String> userIds = new ArrayList<>();
        userIds.add(targetId);
        RongCallClient.getInstance().startCall(conversationType, targetId, userIds, mediaType, null);
    } else {
        callSession = RongCallClient.getInstance().getCallSession();
        mediaType = callSession.getMediaType();
    }

    if (mediaType.equals(RongCallCommon.CallMediaType.AUDIO)) {
        handFree = false;
    } else if (mediaType.equals(RongCallCommon.CallMediaType.VIDEO)) {
        handFree = true;
    }

    UserInfo userInfo = RongContext.getInstance().getUserInfoFromCache(targetId);
    if (userInfo != null) {
        TextView userName = (TextView) mUserInfoContainer.findViewById(R.id.rc_voip_user_name);
        userName.setText(userInfo.getName());
        if (mediaType.equals(RongCallCommon.CallMediaType.AUDIO)) {
            AsyncImageView userPortrait = (AsyncImageView) mUserInfoContainer.findViewById(R.id.rc_voip_user_portrait);
            if (userPortrait != null) {
                userPortrait.setResource(userInfo.getPortraitUri().toString(), R.drawable.rc_default_portrait);
            }
        }
    }
}
 
开发者ID:rongcloud,项目名称:callkit-android,代码行数:47,代码来源:SingleCallActivity.java

示例11: bindView

import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
@Override
protected void bindView(View v, int partition, List<Friend> data, int position) {

    ViewHolder holder = (ViewHolder) v.getTag();
    TextView name = holder.name;
    AsyncImageView photo = holder.photo;
    CheckBox choice = holder.choice;
    Friend friend = data.get(position);

    name.setText(friend.getNickname());

    Resource res = new Resource(friend.getPortrait());

    photo.setResource(res);

    photo.setTag(position);

    holder.friend = friend;

}
 
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:21,代码来源:FriendListAdapter.java

示例12: bindView

import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
@Override
protected void bindView(View v, int partition, List<Friend> data, int position) {

    ViewHolder holder = (ViewHolder) v.getTag();
    TextView name = holder.name;
    AsyncImageView photo = holder.photo;
    TextView choice = holder.unreadnum;
    Friend friend = data.get(position);
    name.setText(friend.getNickname());

    Resource res = new Resource(friend.getPortrait());

    photo.setResource(res);

    photo.setTag(position);

    holder.friend = friend;


}
 
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:21,代码来源:ContactsAdapter.java

示例13: addMarker

import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
public void addMarker(LatLng latLng, final UserInfo userInfo) {

        final String url = userInfo.getPortraitUri().toString();

        final MarkerOptions markerOption = new MarkerOptions();

        markerOption.position(latLng);

        View view = LayoutInflater.from(this).inflate(R.layout.rc_icon_rt_location_marker, null);
        AsyncImageView imageView = (AsyncImageView) view.findViewById(android.R.id.icon);
        ImageView locImageView = (ImageView) view.findViewById(android.R.id.icon1);

        if (userInfo.getUserId().equals(RongIMClient.getInstance().getCurrentUserId())) {
            locImageView.setImageResource(R.drawable.rc_rt_loc_myself);
        } else {
            locImageView.setImageResource(R.drawable.rc_rt_loc_other);
        }

        imageView.setResource(new Resource(url));

        markerOption.anchor(0.5f, 0.5f).icon(BitmapDescriptorFactory.fromView(view));

        Marker marker = getaMap().addMarker(markerOption);
        marker.setObject(userInfo.getUserId());

    }
 
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:27,代码来源:LocationMapActivity.java

示例14: addUserToView

import io.rong.imkit.widget.AsyncImageView; //导入方法依赖的package包/类
public void addUserToView(UserInfo userInfo) {
    RLog.e(this, "RealTimeLocationHorizontalScrollView", "addUserToView:---" + userInfo.getUserId());

    View view = mInflater.inflate(R.layout.item_horizontal_scroll_view, null);
    AsyncImageView imageView = (AsyncImageView) view.findViewById(android.R.id.icon);

    if (null != userInfo.getPortraitUri())
        imageView.setResource(new Resource(userInfo.getPortraitUri()));

    view.setTag(userInfo.getUserId());

    addLayoutChildView(view);
}
 
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:14,代码来源:RealTimeLocationHorizontalScrollView.java


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