[android-developers] How to properly overlay UI Widgets over SurfaceView?
I have one full screen surface view which renders the video in full screen and one 4:3 local camera preview which is overlaid on the full
screen surface view and which renders the local camera feed also one options layout to display the options.
Surface view which renders the local cam feed has an border around it.
This is my layout xml:
<RelativeLayout
xmlns:android="http://schemas.
android:orientation="vertical"
android:layout_width="fill_
android:layout_height="fill_
android:background="@drawable/
>
<SurfaceView
android:id="@+id/video_
android:layout_height="fill_
android:layout_width="fill_
android:layout_centerInParent=
<RelativeLayout
android:id="@+id/local_
android:layout_
android:layout_
android:layout_marginRight="
android:layout_marginBottom="
android:padding="10dp"
android:focusable="true"
android:clickable="true"
android:background="#fff"
android:layout_width="wrap_
android:layout_height="wrap_
android:gravity="center"
android:layout_gravity="
>
<SurfaceView
android:layout_height="wrap_
android:layout_width="wrap_
android:id="@+id/surface_view"
android:layout_centerInParent=
android:layout_alignLeft="@+
android:layout_alignTop="@+id/
android:layout_alignRight="@+
android:layout_alignBottom="@+
/>
<LinearLayout
android:id="@+id/video_off_bg_
android:layout_height="161dp"
android:layout_width="286dp"
android:layout_centerInParent=
android:background="#ffcc" />
<ImageView
android:layout_width="wrap_
android:layout_height="wrap_
android:id="@+id/no_vide_img"
android:src="@drawable/no_
android:layout_centerInParent=
</RelativeLayout>
<include
layout="@layout/options"
android:id="@+id/ptions_
android:layout_width="wrap_
android:layout_width="wrap_
android:layout_marginBottom="
android:layout_
android:layout_
</RelativeLayout>
I am facing following two problems with above layout:
1) I am setting the options layout to invisible after some time out and after detecting the user action i again set it to visible but i
am facing issue in this. After setting option layout as visible it is there on the screen but not visible, it react to touch/key/focus
actions properly but i am unable to see it on screen.
2) Second issue that i am facing is when i set the "local_preview" RelativeLayout as visible and invisible then it does not draw the
border around the local preview, initially when i display the this layout using "setContentView" it does display the border around
local_preview surface view, but when i set it as invisible and visible again then it does not draw the border around the surface view but i
am able to see the video.
I think Z-Order of the widgets is causing the problem, How do i setup
the Z-Order or priority?
I have tried this layout with FrameLayout also but it has the same
behavior.
I have also tried using "bring_to_front" for local preview and options
layout but it does not work.
What might be the cause and the possible solution to these problems.
What is the proper way of doing this.
Thanks,
Pradeep.
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home