I am working on a special interface in Android-Sandwich, a small GalleryView on GLSurfaceView (with transparent areas) on top of the background view (LinearLayout + some widgets). This is how I am going to configure it:
<User>
TOP View
--- GalleryView
|
--- GLSurfaceView (with transparent areas)
|
--- LinearLayout (with widgets)
BOTTOM View
In normal mode, GLSurfaceView has a black background on transparent areas, so I donβt see the bottom layer, but when I use setZOrderOnTop (true); I see the bottom layer, but the top layer (gallery) also follows the Glsurface view. How can I fulfill the required representation, as in the diagram?
XML Mannequin Example (using AnalogClock instead of GalleryView):
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/RelativeLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#920000" android:orientation="vertical" > <LinearLayout android:id="@+id/LinearLayout1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|right" > <AnalogClock android:id="@+id/analogClock2" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> <com.test.CustomGlView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gl_view" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <AnalogClock android:id="@+id/Gallery_dummyview" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </RelativeLayout>
source share