本文整理汇总了Java中android.view.SurfaceView.getParent方法的典型用法代码示例。如果您正苦于以下问题:Java SurfaceView.getParent方法的具体用法?Java SurfaceView.getParent怎么用?Java SurfaceView.getParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.SurfaceView
的用法示例。
在下文中一共展示了SurfaceView.getParent方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addRemoteVideo
import android.view.SurfaceView; //导入方法依赖的package包/类
void addRemoteVideo(View singleRemoteView, SurfaceView video, String userId) {
if (singleRemoteView == null)
return;
FrameLayout remoteVideoView = (FrameLayout) singleRemoteView.findViewById(R.id.viewlet_remote_video_user);
remoteVideoView.removeAllViews();
if (video.getParent() != null) {
((ViewGroup) video.getParent()).removeView(video);
}
remoteVideoView.addView(video, new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
// TextView remoteNameTextView = new TextView(this);
// TextView tv = (TextView) singleRemoteView.findViewById(R.id.user_name);
// ViewGroup.LayoutParams params = tv.getLayoutParams();
// remoteNameTextView.setLayoutParams(params);
// remoteNameTextView.setTextAppearance(this, R.style.rc_voip_text_style_style);
// UserInfo userInfo = RongContext.getInstance().getUserInfoFromCache(userId);
// if (userInfo != null) {
// remoteNameTextView.setText(userInfo.getName());
// } else {
// remoteNameTextView.setText(userId);
// }
// remoteVideoView.addView(remoteNameTextView);
remoteVideoView.setVisibility(View.VISIBLE);
remoteVideoView.setTag(userId);
}
示例2: onVoiceChatClicked
import android.view.SurfaceView; //导入方法依赖的package包/类
public void onVoiceChatClicked(View view) {
log.info("onVoiceChatClicked " + view + " " + mUidsList.size() + " video_status: " + mVideoMuted + " audio_status: " + mAudioMuted);
if (mUidsList.size() == 0) {
return;
}
SurfaceView surfaceV = getLocalView();
ViewParent parent;
if (surfaceV == null || (parent = surfaceV.getParent()) == null) {
log.warn("onVoiceChatClicked " + view + " " + surfaceV);
return;
}
RtcEngine rtcEngine = rtcEngine();
mVideoMuted = !mVideoMuted;
if (mVideoMuted) {
rtcEngine.disableVideo();
} else {
rtcEngine.enableVideo();
}
ImageView iv = (ImageView) view;
iv.setImageResource(mVideoMuted ? R.drawable.btn_video : R.drawable.btn_voice);
hideLocalView(mVideoMuted);
if (mVideoMuted) {
resetToVideoDisabledUI();
} else {
resetToVideoEnabledUI();
}
}
示例3: addIntoLargeSizePreviewLayout
import android.view.SurfaceView; //导入方法依赖的package包/类
/**
* 添加surfaceview到largeSizePreviewLayout
*
* @param surfaceView
*/
private void addIntoLargeSizePreviewLayout(SurfaceView surfaceView) {
if (surfaceView.getParent() != null) {
((ViewGroup) surfaceView.getParent()).removeView(surfaceView);
}
largeSizePreviewLayout.addView(surfaceView);
surfaceView.setZOrderMediaOverlay(false);
if (manager.getCallingState() == CallStateEnum.VIDEO || manager.getCallingState() == CallStateEnum.OUTGOING_VIDEO_CALLING) {
largeSizePreviewCoverLayout.setVisibility(View.GONE);
}
}
示例4: addIntoSmallSizePreviewLayout
import android.view.SurfaceView; //导入方法依赖的package包/类
/**
* 添加surfaceview到smallSizePreviewLayout
*/
private void addIntoSmallSizePreviewLayout(SurfaceView surfaceView) {
smallSizePreviewCoverImg.setVisibility(View.GONE);
if (surfaceView.getParent() != null) {
((ViewGroup) surfaceView.getParent()).removeView(surfaceView);
}
smallSizePreviewLayout.addView(surfaceView);
surfaceView.setZOrderMediaOverlay(true);
smallSizePreviewLayout.setVisibility(View.VISIBLE);
}
示例5: stripView
import android.view.SurfaceView; //导入方法依赖的package包/类
public static void stripView(SurfaceView view) {
ViewParent parent = view.getParent();
if (parent != null) {
((FrameLayout) parent).removeView(view);
}
}
示例6: onRestoreFloatBox
import android.view.SurfaceView; //导入方法依赖的package包/类
@Override
public void onRestoreFloatBox(Bundle bundle) {
super.onRestoreFloatBox(bundle);
if (bundle == null)
return;
muted = bundle.getBoolean("muted");
handFree = bundle.getBoolean("handFree");
setShouldShowFloat(true);
callSession = RongCallClient.getInstance().getCallSession();
RongCallCommon.CallMediaType mediaType = callSession.getMediaType();
RongCallAction callAction = RongCallAction.valueOf(getIntent().getStringExtra("callAction"));
inflater = LayoutInflater.from(this);
initView(mediaType, callAction);
targetId = callSession.getTargetId();
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.setAvatar(userInfo.getPortraitUri().toString(), R.drawable.rc_default_portrait);
}
}
}
SurfaceView localVideo = null;
SurfaceView remoteVideo = null;
String remoteUserId = null;
for (CallUserProfile profile : callSession.getParticipantProfileList()) {
if (profile.getUserId().equals(RongIMClient.getInstance().getCurrentUserId())) {
localVideo = profile.getVideoView();
} else {
remoteVideo = profile.getVideoView();
remoteUserId = profile.getUserId();
}
}
if (localVideo != null && localVideo.getParent() != null) {
((ViewGroup) localVideo.getParent()).removeView(localVideo);
}
onCallOutgoing(callSession, localVideo);
onCallConnected(callSession, localVideo);
if (remoteVideo != null && remoteVideo.getParent() != null) {
((ViewGroup) remoteVideo.getParent()).removeView(remoteVideo);
}
onRemoteUserJoined(remoteUserId, mediaType, remoteVideo);
}
示例7: stripSurfaceView
import android.view.SurfaceView; //导入方法依赖的package包/类
protected final void stripSurfaceView(SurfaceView view) {
ViewParent parent = view.getParent();
if (parent != null) {
((FrameLayout) parent).removeView(view);
}
}