當前位置: 首頁>>代碼示例>>Java>>正文


Java SurfaceView.setZOrderOnTop方法代碼示例

本文整理匯總了Java中android.view.SurfaceView.setZOrderOnTop方法的典型用法代碼示例。如果您正苦於以下問題:Java SurfaceView.setZOrderOnTop方法的具體用法?Java SurfaceView.setZOrderOnTop怎麽用?Java SurfaceView.setZOrderOnTop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.SurfaceView的用法示例。


在下文中一共展示了SurfaceView.setZOrderOnTop方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: switchToSmallVideoView

import android.view.SurfaceView; //導入方法依賴的package包/類
private void switchToSmallVideoView(int bigBgUid) {
    HashMap<Integer, SurfaceView> slice = new HashMap<>(1);
    slice.put(bigBgUid, mUidsList.get(bigBgUid));
    Iterator<SurfaceView> iterator = mUidsList.values().iterator();
    while (iterator.hasNext()) {
        SurfaceView s = iterator.next();
        s.setZOrderOnTop(true);
        s.setZOrderMediaOverlay(true);
    }

    mUidsList.get(bigBgUid).setZOrderOnTop(false);
    mUidsList.get(bigBgUid).setZOrderMediaOverlay(false);

    mGridVideoViewContainer.initViewContainer(this, bigBgUid, slice, mIsLandscape);

    bindToSmallVideoView(bigBgUid);

    mLayoutType = LAYOUT_TYPE_SMALL;

    requestRemoteStreamType(mUidsList.size());
}
 
開發者ID:AgoraIO,項目名稱:OpenVideoCall-Android,代碼行數:22,代碼來源:ChatActivity.java

示例2: initUIandEvent

import android.view.SurfaceView; //導入方法依賴的package包/類
@Override
protected void initUIandEvent() {
    event().addEventHandler(this);

    Intent i = getIntent();
    int cRole = i.getIntExtra(ConstantApp.ACTION_KEY_CROLE, 0);

    if (cRole == 0) {
        throw new RuntimeException("Should not reach here");
    }

    String roomName = i.getStringExtra(ConstantApp.ACTION_KEY_ROOM_NAME);

    doConfigEngine(cRole);

    mGridVideoViewContainer = (GridVideoViewContainer) findViewById(R.id.grid_video_view_container);
    mGridVideoViewContainer.setItemEventHandler(new VideoViewEventListener() {
        @Override
        public void onItemDoubleClick(View v, Object item) {
            log.debug("onItemDoubleClick " + v + " " + item);

            if (mUidsList.size() < 2) {
                return;
            }

            if (mViewType == VIEW_TYPE_DEFAULT)
                switchToSmallVideoView(((VideoStatusData) item).mUid);
            else
                switchToDefaultVideoView();
        }
    });

    ImageView button1 = (ImageView) findViewById(R.id.btn_1);
    ImageView button2 = (ImageView) findViewById(R.id.btn_2);
    ImageView button3 = (ImageView) findViewById(R.id.btn_3);

    if (isBroadcaster(cRole)) {
        SurfaceView surfaceV = RtcEngine.CreateRendererView(getApplicationContext());
        rtcEngine().setupLocalVideo(new VideoCanvas(surfaceV, VideoCanvas.RENDER_MODE_HIDDEN, 0));
        surfaceV.setZOrderOnTop(true);
        surfaceV.setZOrderMediaOverlay(true);

        mUidsList.put(0, surfaceV); // get first surface view

        mGridVideoViewContainer.initViewContainer(getApplicationContext(), 0, mUidsList); // first is now full view
        worker().preview(true, surfaceV, 0);
        broadcasterUI(button1, button2, button3);
    } else {
        audienceUI(button1, button2, button3);
    }

    worker().joinChannel(roomName, config().mUid);

    TextView textRoomName = (TextView) findViewById(R.id.room_name);
    textRoomName.setText(roomName);
}
 
開發者ID:AgoraIO,項目名稱:OpenLive-Android,代碼行數:57,代碼來源:LiveRoomActivity.java

示例3: onCreate

import android.view.SurfaceView; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_multi_surface_test);

    // #1 is at the bottom; mark it as secure just for fun.  By default, this will use
    // the RGB565 color format.
    mSurfaceView1 = (SurfaceView) findViewById(R.id.multiSurfaceView1);
    mSurfaceView1.getHolder().addCallback(this);
    mSurfaceView1.setSecure(true);

    // #2 is above it, in the "media overlay"; must be translucent or we will totally
    // obscure #1 and it will be ignored by the compositor.  The addition of the alpha
    // plane should switch us to RGBA8888.
    mSurfaceView2 = (SurfaceView) findViewById(R.id.multiSurfaceView2);
    mSurfaceView2.getHolder().addCallback(this);
    mSurfaceView2.getHolder().setFormat(PixelFormat.TRANSLUCENT);
    mSurfaceView2.setZOrderMediaOverlay(true);

    // #3 is above everything, including the UI.  Also translucent.
    mSurfaceView3 = (SurfaceView) findViewById(R.id.multiSurfaceView3);
    mSurfaceView3.getHolder().addCallback(this);
    mSurfaceView3.getHolder().setFormat(PixelFormat.TRANSLUCENT);
    mSurfaceView3.setZOrderOnTop(true);
}
 
開發者ID:AndyZhu1991,項目名稱:grafika,代碼行數:26,代碼來源:MultiSurfaceActivity.java

示例4: onCreate

import android.view.SurfaceView; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    log("onCreate");

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_shoot);

    Intent intent = getIntent();
    settings = Settings.getFromIntent(intent);

    shotCount = 0;
    takingPicture = false;

    tvCount = (TextView) findViewById(R.id.tvCount);
    //tvInfo = (TextView) findViewById(R.id.tvInfo);

    reviewSurfaceView = (SurfaceView) findViewById(R.id.surfaceView);
    reviewSurfaceView.setZOrderOnTop(false);
    cameraSurfaceHolder = reviewSurfaceView.getHolder();
    cameraSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
 
開發者ID:jonasjuffinger,項目名稱:TimeLapse,代碼行數:22,代碼來源:ShootActivity.java

示例5: composeDataItem1

import android.view.SurfaceView; //導入方法依賴的package包/類
public static void composeDataItem1(final ArrayList<UserStatusData> users, HashMap<Integer, SurfaceView> uids, int localUid) {
    for (HashMap.Entry<Integer, SurfaceView> entry : uids.entrySet()) {
        if (DEBUG) {
            log.debug("composeDataItem1 " + (entry.getKey() & 0xFFFFFFFFL) + " " + (localUid & 0xFFFFFFFFL) + " " + users.size() + " " + entry.getValue());
        }
        SurfaceView surfaceV = entry.getValue();
        surfaceV.setZOrderOnTop(false);
        surfaceV.setZOrderMediaOverlay(false);
        searchUidsAndAppend(users, entry, localUid, UserStatusData.DEFAULT_STATUS, UserStatusData.DEFAULT_VOLUME, null);
    }

    removeNotExisted(users, uids, localUid);
}
 
開發者ID:AgoraIO,項目名稱:OpenVideoCall-Android,代碼行數:14,代碼來源:VideoViewAdapterUtil.java

示例6: onCreate

import android.view.SurfaceView; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    SimpleExoPlayerView playerView = findViewById(R.id.player_view);
    SimpleExoPlayerView previewPlayerView
            = findViewById(R.id.previewPlayerView);
    previewTimeBar = playerView.findViewById(R.id.exo_progress);
    previewTimeBarLayout = findViewById(R.id.previewSeekBarLayout);


    previewTimeBarLayout.setTintColorResource(R.color.colorPrimary);

    previewTimeBar.addOnPreviewChangeListener(this);
    exoPlayerManager = new ExoPlayerManager(playerView, previewPlayerView, previewTimeBarLayout);
    exoPlayerManager.play(Uri.parse(getString(R.string.url_hls)));
    previewTimeBarLayout.setup(exoPlayerManager);

    View view = previewPlayerView.getVideoSurfaceView();

    if (view instanceof SurfaceView) {
        SurfaceView surfaceView = (SurfaceView) view;
        surfaceView.setZOrderMediaOverlay(true);
        surfaceView.setZOrderOnTop(true);
        surfaceView.setVisibility(View.INVISIBLE);
    }

    requestFullScreenIfLandscape();
}
 
開發者ID:hongcwamazing,項目名稱:PreviewSeekBar-master,代碼行數:31,代碼來源:MainActivity.java

示例7: InitTouchPoint

import android.view.SurfaceView; //導入方法依賴的package包/類
private void InitTouchPoint() {
    trackpadTouchPoint = (SurfaceView) view.findViewById(R.id.trackpad_surfaceView);
    trackpadTouchPoint.setZOrderOnTop(true);
    holder = trackpadTouchPoint.getHolder();
    holder.setFormat(PixelFormat.TRANSPARENT);
    paint = new Paint();
    paint.setColor(getResources().getColor(R.color.touchpoint));
}
 
開發者ID:peter10110,項目名稱:Android-SteamVR-controller,代碼行數:9,代碼來源:ControllerFragment.java

示例8: example

import android.view.SurfaceView; //導入方法依賴的package包/類
private void example() {
    // Prevent window dimming
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    // Here we use the camera preview as below surface and rendering surface as upper one
    SurfaceView surfaceView = (SurfaceView) findViewById(R.id.surfaceView);
    surfaceView.setZOrderOnTop(false);

    // Rendering surface
    TextureView textureView = (TextureView) findViewById(R.id.textureView);
    // Enables support for alpha value in pixels (0 is transparent pixel)
    textureView.setOpaque(false);

    // Creates a new RenderScript context and enables our custom render holder
    mRS = RenderScript.create(this);

    // Enables surface callback to init the entire process.
    // When surface gets initialized, camera preview is enabled
    surfaceView.getHolder().addCallback(mSurfaceHolderCallback);

    textureView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            System.exit(0); // Terminates app when surface is clicked
        }
    });

}
 
開發者ID:csarron,項目名稱:renderscript_examples,代碼行數:29,代碼來源:MainActivity.java

示例9: fixZOrder

import android.view.SurfaceView; //導入方法依賴的package包/類
private void fixZOrder(SurfaceView video, SurfaceView preview) {
	video.setZOrderOnTop(false);
	preview.setZOrderOnTop(true);
	preview.setZOrderMediaOverlay(true); // Needed to be able to display control layout over
}
 
開發者ID:treasure-lau,項目名稱:Linphone4Android,代碼行數:6,代碼來源:CallVideoFragment.java

示例10: init

import android.view.SurfaceView; //導入方法依賴的package包/類
private void init() {
    mFaceSurface = (SurfaceView) findViewById(R.id.sfv_face);
    mFaceSurface.setZOrderOnTop(true);
    mFaceSurface.getHolder().setFormat(PixelFormat.TRANSLUCENT);
}
 
開發者ID:Yee-chen,項目名稱:seeta4Android,代碼行數:6,代碼來源:MainActivity.java

示例11: initUIandEvent

import android.view.SurfaceView; //導入方法依賴的package包/類
@Override
protected void initUIandEvent() {
    event().addEventHandler(this);

    Intent i = getIntent();

    String channelName = i.getStringExtra(ConstantApp.ACTION_KEY_CHANNEL_NAME);

    final String encryptionKey = getIntent().getStringExtra(ConstantApp.ACTION_KEY_ENCRYPTION_KEY);
    final String encryptionMode = getIntent().getStringExtra(ConstantApp.ACTION_KEY_ENCRYPTION_MODE);

    doConfigEngine(encryptionKey, encryptionMode);

    mGridVideoViewContainer = (GridVideoViewContainer) findViewById(R.id.grid_video_view_container);
    mGridVideoViewContainer.setItemEventHandler(new VideoViewEventListener() {
        @Override
        public void onItemDoubleClick(View v, Object item) {
            log.debug("onItemDoubleClick " + v + " " + item + " " + mLayoutType);

            if (mUidsList.size() < 2) {
                return;
            }

            UserStatusData user = (UserStatusData) item;
            int uid = (user.mUid == 0) ? config().mUid : user.mUid;

            if (mLayoutType == LAYOUT_TYPE_DEFAULT && mUidsList.size() != 1) {
                switchToSmallVideoView(uid);
            } else {
                switchToDefaultVideoView();
            }
        }
    });

    SurfaceView surfaceV = RtcEngine.CreateRendererView(getApplicationContext());
    rtcEngine().setupLocalVideo(new VideoCanvas(surfaceV, VideoCanvas.RENDER_MODE_HIDDEN, 0));
    surfaceV.setZOrderOnTop(false);
    surfaceV.setZOrderMediaOverlay(false);

    mUidsList.put(0, surfaceV); // get first surface view

    mGridVideoViewContainer.initViewContainer(this, 0, mUidsList, mIsLandscape); // first is now full view
    worker().preview(true, surfaceV, 0);

    worker().joinChannel(channelName, config().mUid);

    TextView textChannelName = (TextView) findViewById(R.id.channel_name);
    textChannelName.setText(channelName);

    optional();

    LinearLayout bottomContainer = (LinearLayout) findViewById(R.id.bottom_container);
    FrameLayout.MarginLayoutParams fmp = (FrameLayout.MarginLayoutParams) bottomContainer.getLayoutParams();
    fmp.bottomMargin = virtualKeyHeight() + 16;

    initMessageList();
}
 
開發者ID:AgoraIO,項目名稱:OpenVideoCall-Android,代碼行數:58,代碼來源:ChatActivity.java

示例12: onSwitchRemoteUsers

import android.view.SurfaceView; //導入方法依賴的package包/類
public void onSwitchRemoteUsers(View view) {
    String from = (String) view.getTag();
    if (from == null)
        return;
    String to = (String) localView.getTag();
    FrameLayout layout = (FrameLayout) view;
    SurfaceView fromView = (SurfaceView) layout.getChildAt(0);
    SurfaceView toView = localView;

    localViewContainer.removeAllViews();
    layout.removeAllViews();

    View singleRemoteView = remoteViewContainer.findViewWithTag(from + "view");
    UserInfo toUserInfo = RongContext.getInstance().getUserInfoFromCache(to);
    UserInfo fromUserInfo = RongContext.getInstance().getUserInfoFromCache(from);

    AsyncImageView userPortraitView = (AsyncImageView) singleRemoteView.findViewById(R.id.user_portrait);
    TextView backUserNameView = (TextView) singleRemoteView.findViewById(R.id.user_name);

    if (toUserInfo != null) {
        if (toUserInfo.getPortraitUri() != null) {
            userPortraitView.setAvatar(toUserInfo.getPortraitUri().toString(), R.drawable.rc_default_portrait);
        }
        backUserNameView.setText(toUserInfo.getName());
    } else {
        backUserNameView.setText(to);
    }
    singleRemoteView.setTag(to + "view");
    fromView.setZOrderOnTop(false);
    fromView.setZOrderMediaOverlay(false);
    localViewContainer.addView(fromView);
    toView.setZOrderOnTop(true);
    toView.setZOrderMediaOverlay(true);
    layout.addView(toView);

    TextView topUserNameView = (TextView) topContainer.findViewById(R.id.rc_voip_user_name);
    topUserNameView.setTag(from + "name");
    if (fromUserInfo != null) {
        topUserNameView.setText(fromUserInfo.getName());
    } else {
        topUserNameView.setText(from);
    }
    layout.setTag(to);
    localView = fromView;
    localView.setTag(from);
    localViewUserId = from;
}
 
開發者ID:hushengjun,項目名稱:FastAndroid,代碼行數:48,代碼來源:MultiVideoCallActivity.java

示例13: initUIandEvent

import android.view.SurfaceView; //導入方法依賴的package包/類
@Override
protected void initUIandEvent() {
    event().addEventHandler(this);

    Intent i = getIntent();

    String channelName = i.getStringExtra(ConstantApp.ACTION_KEY_CHANNEL_NAME);

    final String encryptionKey = getIntent().getStringExtra(ConstantApp.ACTION_KEY_ENCRYPTION_KEY);

    final String encryptionMode = getIntent().getStringExtra(ConstantApp.ACTION_KEY_ENCRYPTION_MODE);

    doConfigEngine(encryptionKey, encryptionMode);

    mGridVideoViewContainer = (GridVideoViewContainer) findViewById(R.id.grid_video_view_container);
    mGridVideoViewContainer.setItemEventHandler(new VideoViewEventListener() {
        @Override
        public void onItemDoubleClick(View v, Object item) {
            log.debug("onItemDoubleClick " + v + " " + item + " " + mLayoutType);

            if (mUidsList.size() < 2) {
                return;
            }

            UserStatusData user = (UserStatusData) item;
            int uid = (user.mUid == 0) ? config().mUid : user.mUid;

            if (mLayoutType == LAYOUT_TYPE_DEFAULT && mUidsList.size() != 1) {
                switchToSmallVideoView(uid);
            } else {
                switchToDefaultVideoView();
            }
        }
    });

    SurfaceView surfaceV = RtcEngine.CreateRendererView(getApplicationContext());
    rtcEngine().setupLocalVideo(new VideoCanvas(surfaceV, VideoCanvas.RENDER_MODE_HIDDEN, 0));
    surfaceV.setZOrderOnTop(false);
    surfaceV.setZOrderMediaOverlay(false);

    mUidsList.put(0, surfaceV); // get first surface view

    mGridVideoViewContainer.initViewContainer(getApplicationContext(), 0, mUidsList); // first is now full view
    worker().preview(true, surfaceV, 0);
    config().mUid = AGApplication.uid;
    String channelKey = AGApplication.channelKey;
    worker().joinChannel(channelName, config().mUid,channelKey);

    TextView textChannelName = (TextView) findViewById(R.id.channel_name);
    textChannelName.setText(channelName);

    optional();

    LinearLayout bottomContainer = (LinearLayout) findViewById(R.id.bottom_container);
    FrameLayout.MarginLayoutParams fmp = (FrameLayout.MarginLayoutParams) bottomContainer.getLayoutParams();
    fmp.bottomMargin = virtualKeyHeight() + 16;

    initMessageList();
}
 
開發者ID:huangjingqiang,項目名稱:SWDemo,代碼行數:60,代碼來源:ChatActivity.java


注:本文中的android.view.SurfaceView.setZOrderOnTop方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。