本文整理汇总了Java中io.rong.imkit.RongContext类的典型用法代码示例。如果您正苦于以下问题:Java RongContext类的具体用法?Java RongContext怎么用?Java RongContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RongContext类属于io.rong.imkit包,在下文中一共展示了RongContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initAudioCallView
import io.rong.imkit.RongContext; //导入依赖的package包/类
private void initAudioCallView() {
mLPreviewContainer.removeAllViews();
mLPreviewContainer.setVisibility(View.GONE);
mSPreviewContainer.removeAllViews();
mSPreviewContainer.setVisibility(View.GONE);
findViewById(R.id.rc_voip_call_information).setBackgroundColor(getResources().getColor(R.color.rc_voip_background_color));
findViewById(R.id.rc_voip_audio_chat).setVisibility(View.GONE);
View userInfoView = inflater.inflate(R.layout.rc_voip_audio_call_user_info, null);
TextView timeView = (TextView) userInfoView.findViewById(R.id.rc_voip_call_remind_info);
setupTime(timeView);
mUserInfoContainer.removeAllViews();
mUserInfoContainer.addView(userInfoView);
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 (callSession.getMediaType().equals(RongCallCommon.CallMediaType.AUDIO)) {
AsyncImageView userPortrait = (AsyncImageView) mUserInfoContainer.findViewById(R.id.rc_voip_user_portrait);
if (userPortrait != null) {
userPortrait.setAvatar(userInfo.getPortraitUri().toString(), R.drawable.rc_default_portrait);
}
}
}
mUserInfoContainer.setVisibility(View.VISIBLE);
mUserInfoContainer.findViewById(R.id.rc_voip_call_minimize).setVisibility(View.VISIBLE);
View button = inflater.inflate(R.layout.rc_voip_call_bottom_connected_button_layout, null);
mButtonContainer.removeAllViews();
mButtonContainer.addView(button);
mButtonContainer.setVisibility(View.VISIBLE);
View handFreeV = mButtonContainer.findViewById(R.id.rc_voip_handfree);
handFreeV.setSelected(handFree);
if (pickupDetector != null) {
pickupDetector.register(this);
}
}
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:41,代码来源:SingleCallActivity.java
示例2: onCreate
import io.rong.imkit.RongContext; //导入依赖的package包/类
@Override
@TargetApi(23)
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.rc_voip_multi_video_call);
Intent intent = getIntent();
startForCheckPermissions = intent.getBooleanExtra("checkPermissions", false);
RongContext.getInstance().getEventBus().register(this);
if (!requestCallPermissions(RongCallCommon.CallMediaType.VIDEO, REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS)) {
return;
}
initViews();
setupIntent();
}
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:17,代码来源:MultiVideoCallActivity.java
示例3: addSingleRemoteView
import io.rong.imkit.RongContext; //导入依赖的package包/类
View addSingleRemoteView(String userId) {
View singleRemoteView = inflater.inflate(R.layout.rc_voip_viewlet_remote_user, null);
UserInfo userInfo = RongContext.getInstance().getUserInfoFromCache(userId);
singleRemoteView.setTag(userId + "view");
AsyncImageView userPortraitView = (AsyncImageView) singleRemoteView.findViewById(R.id.user_portrait);
if (userInfo != null) {
if (userInfo.getPortraitUri() != null) {
userPortraitView.setAvatar(userInfo.getPortraitUri().toString(), R.drawable.rc_default_portrait);
}
}
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(remoteUserViewWidth, remoteUserViewWidth);
params.setMargins(0, 0, 10, 0);
if (remoteViewContainer2.getChildCount() < 4) {
remoteViewContainer2.addView(singleRemoteView, params);
} else if (remoteViewContainer1.getChildCount() < 4) {
remoteViewContainer1.addView(singleRemoteView, params);
}
return singleRemoteView;
}
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:21,代码来源:MultiVideoCallActivity.java
示例4: onIncomingCallRinging
import io.rong.imkit.RongContext; //导入依赖的package包/类
public void onIncomingCallRinging() {
int ringerMode = NotificationUtil.getRingerMode(this);
if (ringerMode != AudioManager.RINGER_MODE_SILENT) {
if (ringerMode == AudioManager.RINGER_MODE_VIBRATE) {
mVibrator = (Vibrator) RongContext.getInstance().getSystemService(Context.VIBRATOR_SERVICE);
mVibrator.vibrate(new long[]{500, 1000}, 0);
} else {
Uri uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
mMediaPlayer = new MediaPlayer();
try {
mMediaPlayer.setDataSource(this, uri);
mMediaPlayer.setLooping(true);
mMediaPlayer.prepare();
mMediaPlayer.start();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:21,代码来源:BaseCallActivity.java
示例5: onCreate
import io.rong.imkit.RongContext; //导入依赖的package包/类
@Override
@TargetApi(23)
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.rc_voip_ac_muti_audio);
audioContainer = (LinearLayout) findViewById(R.id.rc_voip_container);
incomingLayout = (RelativeLayout) LayoutInflater.from(this).inflate(R.layout.rc_voip_item_incoming_maudio, null);
outgoingLayout = (RelativeLayout) LayoutInflater.from(this).inflate(R.layout.rc_voip_item_outgoing_maudio, null);
outgoingController = (FrameLayout) LayoutInflater.from(this).inflate(R.layout.rc_voip_call_bottom_connected_button_layout, null);
incomingController = (FrameLayout) LayoutInflater.from(this).inflate(R.layout.rc_voip_call_bottom_incoming_button_layout, null);
startForCheckPermissions = getIntent().getBooleanExtra("checkPermissions", false);
if (!requestCallPermissions(RongCallCommon.CallMediaType.AUDIO, REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS)) {
return;
}
RongContext.getInstance().getEventBus().register(this);
initView();
}
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:20,代码来源:MultiAudioCallActivity.java
示例6: onIncomingCallRinging
import io.rong.imkit.RongContext; //导入依赖的package包/类
public void onIncomingCallRinging() {
int ringerMode = NotificationUtil.getRingerMode(this);
if(ringerMode != AudioManager.RINGER_MODE_SILENT){
if(ringerMode == AudioManager.RINGER_MODE_VIBRATE){
mVibrator = (Vibrator) RongContext.getInstance().getSystemService(Context.VIBRATOR_SERVICE);
mVibrator.vibrate(new long[] {500, 1000}, 0);
} else {
Uri uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_RINGTONE);
mMediaPlayer = new MediaPlayer();
try {
mMediaPlayer.setDataSource(this, uri);
mMediaPlayer.setLooping(true);
mMediaPlayer.prepare();
mMediaPlayer.start();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
开发者ID:LanguidSheep,项目名称:sealtalk-android-master,代码行数:21,代码来源:BaseCallActivity.java
示例7: onCreate
import io.rong.imkit.RongContext; //导入依赖的package包/类
@Override
@TargetApi(23)
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.rc_voip_ac_muti_audio);
maudioContainer = (LinearLayout) findViewById(R.id.rc_voip_container);
incomingLayout = (RelativeLayout) LayoutInflater.from(this).inflate(R.layout.rc_voip_item_incoming_maudio, null);
outgoingLayout = (RelativeLayout) LayoutInflater.from(this).inflate(R.layout.rc_voip_item_outgoing_maudio, null);
outgoingController = (FrameLayout) LayoutInflater.from(this).inflate(R.layout.rc_voip_call_bottom_connected_button_layout, null);
incomingController = (FrameLayout) LayoutInflater.from(this).inflate(R.layout.rc_voip_call_bottom_incoming_button_layout, null);
startForCheckPermissions = getIntent().getBooleanExtra("checkPermissions", false);
if (!requestCallPermissions(RongCallCommon.CallMediaType.AUDIO, REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS)) {
return;
}
RongContext.getInstance().getEventBus().register(this);
initView();
}
开发者ID:LanguidSheep,项目名称:sealtalk-android-master,代码行数:20,代码来源:MultiAudioCallActivity.java
示例8: initPhoto
import io.rong.imkit.RongContext; //导入依赖的package包/类
public void initPhoto(final Uri uri) {
mUri = uri;
if(mUri == null)
return;
if (mUri.getScheme().equals("http")) {
RongContext.getInstance().executorBackground(new Runnable() {
@Override
public void run() {
if (ResourceHandler.getInstance().containsInDiskCache(new Resource(mUri))) {
mUri = Uri.fromFile(ResourceHandler.getInstance().getFile(new Resource(mUri)));
getHandler().obtainMessage(GET_PHOTO, mUri).sendToTarget();
} else {
getHandler().obtainMessage(REQ_PHOTO, mUri).sendToTarget();
}
}
});
} else {
mProcess = new ImageProcess();
mProcess.execute(mUri);
}
}
开发者ID:13120241790,项目名称:RongChat,代码行数:27,代码来源:PreviewFragment.java
示例9: onActivityResult
import io.rong.imkit.RongContext; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 29 && resultCode == ShareDefine.RONG_MESSAGE_REPLY) {
if (data != null && data.hasExtra("REPLY_NAME") && data.hasExtra("REPLY_ID")) {
String id = data.getStringExtra("REPLY_ID");
String name = data.getStringExtra("REPLY_NAME");
TextInputProvider textInputProvider = (TextInputProvider) RongContext.getInstance().getPrimaryInputProvider();
textInputProvider.setEditTextContent(mEditText + name + " ");
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
}
}
}
开发者ID:birdcopy,项目名称:Android-Birdcopy-Application,代码行数:17,代码来源:FlyingConversationActivity.java
示例10: initData
import io.rong.imkit.RongContext; //导入依赖的package包/类
@Override
protected void initData() {
if (RongContext.getInstance() != null)
RongContext.getInstance().getEventBus().register(this);
if (RongIM.getInstance() != null && RongIM.getInstance().getRongIMClient() != null) {
RongIM.getInstance().getRongIMClient().getConversation(getConversationType(), getTargetId(), new RongIMClient.ResultCallback<Conversation>() {
@Override
public void onSuccess(final Conversation conversation) {
if (conversation != null)
setSwitchBtnStatus(conversation.isTop());
}
@Override
public void onError(RongIMClient.ErrorCode e) {
}
});
}
}
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:23,代码来源:RongSetConversationToTopFragment.java
示例11: initData
import io.rong.imkit.RongContext; //导入依赖的package包/类
@Override
protected void initData() {
if (RongContext.getInstance() != null)
RongContext.getInstance().getEventBus().register(this);
if (RongIM.getInstance() != null && RongIM.getInstance().getRongIMClient() != null) {
RongIM.getInstance().getRongIMClient().getConversationNotificationStatus(getConversationType(), getTargetId(), new RongIMClient.ResultCallback<Conversation.ConversationNotificationStatus>() {
@Override
public void onSuccess(final Conversation.ConversationNotificationStatus notificationStatus) {
if (notificationStatus != null) {
setSwitchBtnStatus(notificationStatus == Conversation.ConversationNotificationStatus.DO_NOT_DISTURB ? false : true);
}
}
@Override
public void onError(RongIMClient.ErrorCode errorCode) {
setSwitchBtnStatus(!getSwitchBtnStatus());
}
});
}
}
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:26,代码来源:RongSetConversationNotificationFragment.java
示例12: onCreate
import io.rong.imkit.RongContext; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent;
RongContext.getInstance().getEventBus().register(this);
if (getActivity() != null) {
intent = getActivity().getIntent();
if (intent.getData() != null) {
mConversationType = Conversation.ConversationType
.valueOf(intent.getData().getLastPathSegment().toUpperCase());
mTargetId = intent.getData().getQueryParameter("targetId");
}
}
mAdapter = new RongConversationAddMemberAdapter(getActivity());
mAdapter.setDeleteIconListener(this);
if (RongIM.getInstance() != null && RongIM.getInstance().getRongIMClient() != null) {
initData();
}
}
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:27,代码来源:RongConversationAddMemberFragment.java
示例13: onItemClick
import io.rong.imkit.RongContext; //导入依赖的package包/类
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
UserInfo userInfo = mAdapter.getItem(position);
if (userInfo.getUserId().equals("RongDelBtn")) {
mAdapter.setDeleteState(true);
int count = mAdapter.getCount();
mAdapter.remove(count - 1);
mAdapter.remove(count - 2);
mAdapter.notifyDataSetChanged();
} else if (userInfo.getUserId().equals("RongAddBtn")) {
if (RongContext.getInstance().getMemberSelectListener() == null) {
throw new ExceptionInInitializerError("The OnMemberSelectListener hasn't been set!");
}
RongContext.getInstance().getMemberSelectListener().startSelectMember(getActivity(), mConversationType, mTargetId);
}
}
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:17,代码来源:RongConversationAddMemberFragment.java
示例14: onActivityResult
import io.rong.imkit.RongContext; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 29 && resultCode == Constants.MESSAGE_REPLY) {
if (data != null && data.hasExtra("REPLY_NAME") && data.hasExtra("REPLY_ID")) {
String id = data.getStringExtra("REPLY_ID");
String name = data.getStringExtra("REPLY_NAME");
TextInputProvider textInputProvider = (TextInputProvider) RongContext.getInstance().getPrimaryInputProvider();
textInputProvider.setEditTextContent(mEditText + name + " ");
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
}
}
}
开发者ID:yangyunfeng666,项目名称:demo-app-android-v2-2.3.9,代码行数:17,代码来源:ConversationActivity.java
示例15: getContentSummary
import io.rong.imkit.RongContext; //导入依赖的package包/类
@Override
public Spannable getContentSummary(CallSTerminateMessage data) {
RongCallCommon.CallMediaType mediaType = data.getMediaType();
if (mediaType.equals(RongCallCommon.CallMediaType.AUDIO)) {
return new SpannableString(RongContext.getInstance().getString(R.string.rc_voip_message_audio));
} else {
return new SpannableString(RongContext.getInstance().getString(R.string.rc_voip_message_video));
}
}
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:11,代码来源:CallEndMessageItemProvider.java
示例16: getView
import io.rong.imkit.RongContext; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
holder = new ViewHolder();
convertView = LayoutInflater.from(CallSelectMemberActivity.this).inflate(R.layout.rc_voip_listitem_select_member, null);
holder.checkbox = (ImageView) convertView.findViewById(R.id.rc_checkbox);
holder.portrait = (AsyncImageView) convertView.findViewById(R.id.rc_user_portrait);
holder.name = (TextView) convertView.findViewById(R.id.rc_user_name);
convertView.setTag(holder);
}
holder = (ViewHolder)convertView.getTag();
holder.checkbox.setTag(allMembers.get(position));
if (invitedMembers.contains(allMembers.get(position))) {
holder.checkbox.setClickable(false);
holder.checkbox.setEnabled(false);
holder.checkbox.setImageResource(R.drawable.rc_voip_icon_checkbox_checked);
} else {
if (selectedMember.contains(allMembers.get(position))) {
holder.checkbox.setImageResource(R.drawable.rc_voip_checkbox);
holder.checkbox.setSelected(true);
} else {
holder.checkbox.setImageResource(R.drawable.rc_voip_checkbox);
holder.checkbox.setSelected(false);
}
holder.checkbox.setClickable(true);
holder.checkbox.setEnabled(true);
}
UserInfo userInfo = RongContext.getInstance().getUserInfoFromCache(allMembers.get(position));
if (userInfo != null) {
holder.name.setText(userInfo.getName());
holder.portrait.setAvatar(userInfo.getPortraitUri());
} else {
holder.name.setText(allMembers.get(position));
holder.portrait.setAvatar(null);
}
return convertView;
}
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:41,代码来源:CallSelectMemberActivity.java
示例17: onDestroy
import io.rong.imkit.RongContext; //导入依赖的package包/类
@Override
protected void onDestroy() {
RongContext.getInstance().getEventBus().unregister(this);
stopRing();
if (wakeLock != null && wakeLock.isHeld()) {
wakeLock.setReferenceCounted(false);
wakeLock.release();
}
RLog.d(TAG, "SingleCallActivity onDestroy");
super.onDestroy();
}
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:12,代码来源:SingleCallActivity.java
示例18: onRemoteUserLeft
import io.rong.imkit.RongContext; //导入依赖的package包/类
@Override
public void onRemoteUserLeft(String userId, RongCallCommon.CallDisconnectedReason reason) {
//incoming状态,localViewUserId为空
if (localViewUserId == null)
return;
if (localViewUserId.equals(userId)) {
localViewContainer.removeAllViews();
String currentUserId = RongIMClient.getInstance().getCurrentUserId();
FrameLayout remoteVideoView = (FrameLayout) remoteViewContainer.findViewWithTag(currentUserId);
localView = (SurfaceView) remoteVideoView.getChildAt(0);
remoteVideoView.removeAllViews();
localViewContainer.addView(localView);
TextView topUserNameView = (TextView) topContainer.findViewById(R.id.rc_voip_user_name);
topUserNameView.setTag(currentUserId + "name");
UserInfo userInfo = RongContext.getInstance().getUserInfoFromCache(currentUserId);
if (userInfo != null) {
topUserNameView.setText(userInfo.getName());
} else {
topUserNameView.setText(currentUserId);
}
localViewUserId = currentUserId;
}
View singleRemoteView = remoteViewContainer.findViewWithTag(userId + "view");
if (singleRemoteView == null)
return;
LinearLayout container = (LinearLayout) singleRemoteView.getParent();
container.removeView(singleRemoteView);
if (container.equals(remoteViewContainer2)) {
if (remoteViewContainer1.getChildCount() > 0) {
View childView = remoteViewContainer1.getChildAt(0);
remoteViewContainer1.removeView(childView);
remoteViewContainer2.addView(childView);
}
}
}
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:39,代码来源:MultiVideoCallActivity.java
示例19: onCallDisconnected
import io.rong.imkit.RongContext; //导入依赖的package包/类
@Override
public void onCallDisconnected(RongCallSession callSession, RongCallCommon.CallDisconnectedReason reason) {
isFinishing = true;
if (reason == null || callSession == null) {
RLog.e(TAG, "onCallDisconnected. callSession is null!");
postRunnableDelay(new Runnable() {
@Override
public void run() {
finish();
}
});
return;
}
InformationNotificationMessage informationMessage;
if (reason.equals(RongCallCommon.CallDisconnectedReason.NO_RESPONSE)) {
informationMessage = InformationNotificationMessage.obtain(RongContext.getInstance().getString(R.string.rc_voip_video_no_response));
} else {
informationMessage = InformationNotificationMessage.obtain(RongContext.getInstance().getString(R.string.rc_voip_video_ended));
}
RongIM.getInstance().insertMessage(callSession.getConversationType(), callSession.getTargetId(), callSession.getCallerUserId(), informationMessage, null);
stopRing();
postRunnableDelay(new Runnable() {
@Override
public void run() {
finish();
}
});
super.onCallDisconnected(callSession, reason);
}
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:32,代码来源:MultiVideoCallActivity.java
示例20: onRestoreFloatBox
import io.rong.imkit.RongContext; //导入依赖的package包/类
@Override
public void onRestoreFloatBox(Bundle bundle) {
super.onRestoreFloatBox(bundle);
if (bundle != null) {
audioContainer.addView(outgoingLayout);
memberContainer = (CallUserGridView) audioContainer.findViewById(R.id.rc_voip_members_container);
FrameLayout controller = (FrameLayout) audioContainer.findViewById(R.id.rc_voip_control_layout);
controller.addView(outgoingController);
callSession = RongCallClient.getInstance().getCallSession();
if (callSession == null) {
setShouldShowFloat(false);
finish();
}
memberContainer.enableShowState(true);
List<CallUserProfile> participantProfiles = callSession.getParticipantProfileList();
for (CallUserProfile item : participantProfiles) {
if (!item.getUserId().equals(callSession.getSelfUserId())) {
if (item.getCallStatus().equals(RongCallCommon.CallStatus.CONNECTED))
memberContainer.addChild(item.getUserId(), RongContext.getInstance().getUserInfoFromCache(item.getUserId()));
else {
String state = getString(R.string.rc_voip_call_connecting);
memberContainer.addChild(item.getUserId(), RongContext.getInstance().getUserInfoFromCache(item.getUserId()), state);
}
}
}
onCallConnected(callSession, null);
}
}
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:30,代码来源:MultiAudioCallActivity.java
注:本文中的io.rong.imkit.RongContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论