2017-08-05 2 views
1

Ich möchte nur ein Videoanruflayout machen und ich konfrontiert dieses Problem Ich möchte einige von ImageView und Button über SurfaceView für Swithc Kamera hinzufügen, stumm, Anruf beenden und einige Informationen und das ist mein Xmlandroid view über surfaceView hinzufügen

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
    > 


<org.webrtc.SurfaceViewRenderer 
    android:id="@+id/preview" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    /> 


<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 



<LinearLayout 
    android:id="@+id/rind" 
    android:orientation="horizontal" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
     <!-- here my ImageView and button --> 

    </LinearLayout> 



</RelativeLayout> 

SurfaceViewRenderer seine erweitern Surface

jetzt, wenn ich laufen diese i kippe se e meine Kamera in surfaceView und ich füge roten Hintergrund für meinen SurfaceViewRenderer hinzu und sein Erscheinen ohne meine Kameraanzeige ich suche nur und ich fand mySurfaceView.setZOrderOnTop(true); ich addiere sein und jetzt zeigt es die Anzeige der Kamera aber ich kann meine Ansicht nicht sehen (stumm, Ende nennen ...)

ich versuche auch

mySurfaceView.setZOrderMediaOverlay(true); 

    mySurfaceView.getHolder().setFormat(PixelFormat.TRANSPARENT); 

keine Wirkung

ich möchte nur das Layout wie diese

machen, bevor ich surfaceView verwenden habe ich versucht glsurfaceview bu t seine gleichen und ich lese ich kann es nicht tun (Blick über glsurfaceview hinzufügen) in glsurfaceview

enter image description here

Antwort

0

diese Hoffnung versuchen dies wird Ihnen helfen:

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" 
android:layout_width="match_parent" 
android:layout_height="match_parent"> 

<FrameLayout 
    android:clipChildren="false" 
    android:id="@+id/main_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

<!--local view--> 
<com.example.gwl.apprtc.PercentFrameLayout 
    android:id="@+id/local_video_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

<org.webrtc.SurfaceViewRenderer 
     android:id="@+id/local_video_view" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content"/> 
<!--remote View --> 
</com.example.gwl.apprtc.PercentFrameLayout> 
<com.example.gwl.apprtc.PercentFrameLayout 
    android:id="@+id/remote_video_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

<org.webrtc.SurfaceViewRenderer 
     android:id="@+id/remote_video_view" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content"/> 

</com.example.gwl.apprtc.PercentFrameLayout> 
<!----> 
</FrameLayout> 
<FrameLayout 
    android:id="@+id/buttons_call_container" 
    android:orientation="horizontal" 
    android:layout_marginBottom="@dimen/marginBottom_32dp" 
    android:layout_gravity="bottom|center" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"> 

<LinearLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal"> 

<ImageButton 
      android:id="@+id/button_call_disconnect" 
      android:background="@drawable/disconnect" 
      android:contentDescription="@string/disconnect_call" 
      android:layout_width="@dimen/layoutWidth_48dp" 
      android:layout_height="@dimen/layoutHeight_48dp"/> 

<ImageButton 
      android:id="@+id/button_call_toggle_mic" 
      android:background="@android:drawable/ic_btn_speak_now" 
      android:contentDescription="@string/toggle_mic" 
      android:layout_marginRight="@dimen/marginRight_10dp" 
      android:layout_width="@dimen/layoutWidth_48dp" 
      android:layout_height="@dimen/layoutHeight_48dp"/> 

<ImageButton 
      android:id="@+id/button_call_switch_camera" 
      android:background="@android:drawable/ic_menu_camera" 
      android:layout_marginEnd="8dp" 
      android:layout_width="48dp" 
      android:layout_height="48dp"/> 


</LinearLayout> 

</FrameLayout> 

</FrameLayout> 
Verwandte Themen