Tuesday 5 June 2012

xml for image target.java


<?xml version="1.0" encoding="utf-8"?>
<!--
    In FrameLayout children are drawn in a stack, with the most recently
    added child on top.
   
    Due to a strange bug in Android, the z-order of the views does not seem to
    be guaranteed. For example, if we add the camera preview layer and the
    GLView here, first of all GLView has to be added to the layout BEFORE
    CameraPreview to be on top instead of vice versa due to a strange reason.  
    This works upon a fresh start, and the camera view sits underneath
    the GL view. However, upon pressing the HOME button and returning,
    the order of the layers gets swapped and stays wrong (or vice versa: if
    started with a wrong order, it gets correct).
   
    Apparently the current version of the framework makes no guarantees about
    what order the 2 SurfaceViews would be placed in the window manager, it is
    just happenstance, and could change based on various conditions that may or
    may not have the same result in the future...
   
    Calling the functions (available after Android 2.0)
    glView.setZOrderMediaOverlay(true) or using glView.bringToFront()
    doesn't seem to fix the problem either.
   
    To overcome this problem, we just construct the views dynamically upon
    calling onResume to guarantee the correct order and therefore leave the
    layout empty now.
























-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/fl"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

    <RelativeLayout
        android:id="@+id/combined"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <FrameLayout
            android:id="@+id/frame"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent" >
        </FrameLayout>

        <LinearLayout
            android:id="@+id/textlayout"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerVertical="true"
            android:gravity="center"
            android:orientation="horizontal"
            android:layout_centerInParent="true" >

            <LinearLayout
                android:id="@+id/layoutleft1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="left"
                android:gravity="left"
                android:orientation="vertical" >

                <TextView
                    android:id="@+id/left1"
                    android:layout_width="75dp"
                    android:layout_height="wrap_content" />

                <ImageView
                    android:id="@+id/imageleft1"
                    android:layout_width="72dp"
                    android:layout_height="72dp"
                     />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/layoutleft2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="left"
                android:gravity="left"
                android:orientation="vertical"
                android:paddingLeft="20dp" >

                <TextView
                    android:id="@+id/left2"
                    android:layout_width="75dp"
                    android:layout_height="wrap_content"
                     />

                <ImageView
                    android:id="@+id/imageleft2"
                    android:layout_width="72dp"
                    android:layout_height="72dp"
                     />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/layoutcenter"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:gravity="center_horizontal"
                android:orientation="vertical" >

                <TextView
                    android:id="@+id/tv"
                    android:layout_width="75dp"
                    android:layout_height="wrap_content" />

                <ImageView
                    android:id="@+id/imagecenter"
                    android:layout_width="72dp"
                    android:layout_height="72dp" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/layoutright2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:gravity="right"
                android:orientation="vertical" >

                <TextView
                    android:id="@+id/right2"
                    android:layout_width="75dp"
                    android:layout_height="wrap_content" />

                <ImageView
                    android:id="@+id/imageright2"
                    android:layout_width="72dp"
                    android:layout_height="72dp" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/layoutright1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="right"
                android:gravity="right"
                android:orientation="vertical"
                android:paddingRight="20dp" >

                <TextView
                    android:id="@+id/right1"
                    android:layout_width="75dp"
                    android:layout_height="wrap_content"
                    />

                <ImageView
                    android:id="@+id/imageright1"
                    android:layout_width="72dp"
                    android:layout_height="72dp" />
            </LinearLayout>
        </LinearLayout>
    </RelativeLayout>

</FrameLayout>

No comments:

Post a Comment