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


Java SurfaceView.getParent方法代码示例

本文整理汇总了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);
    }
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:25,代码来源:MultiVideoCallActivity.java

示例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();
    }
}
 
开发者ID:AgoraIO,项目名称:OpenVideoCall-Android,代码行数:35,代码来源:ChatActivity.java

示例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);
    }
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:16,代码来源:AVChatSurface.java

示例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);
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:13,代码来源:AVChatSurface.java

示例5: stripView

import android.view.SurfaceView; //导入方法依赖的package包/类
public static void stripView(SurfaceView view) {
    ViewParent parent = view.getParent();
    if (parent != null) {
        ((FrameLayout) parent).removeView(view);
    }
}
 
开发者ID:AgoraIO,项目名称:OpenVideoCall-Android,代码行数:7,代码来源:VideoViewAdapterUtil.java

示例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);
}
 
开发者ID:hushengjun,项目名称:FastAndroid,代码行数:48,代码来源:SingleCallActivity.java

示例7: stripSurfaceView

import android.view.SurfaceView; //导入方法依赖的package包/类
protected final void stripSurfaceView(SurfaceView view) {
    ViewParent parent = view.getParent();
    if (parent != null) {
        ((FrameLayout) parent).removeView(view);
    }
}
 
开发者ID:AgoraIO,项目名称:OpenLive-Android,代码行数:7,代码来源:VideoViewAdapter.java


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