Reduce components in an android layout











up vote
0
down vote

favorite












I would like to optimize this layout to improve rendering speed. How can I remove so much unnecessary components from the layout file below?



I heard I should use RelativeLayout rather than LinearLayout, but don't know how.



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

<FrameLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:id="@+id/ingameFrameLayout"
android:visibility="visible">

<com.kyunggi.sanggeoltopia2.InGameSurfaceView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/ingameSurfaceView"/>

<com.kyunggi.sanggeoltopia2.InGameViewOGL
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/ingameViewOGL"/>

<LinearLayout
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical"
android:visibility="visible">

<LinearLayout
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:orientation="horizontal"
android:layout_gravity="bottom|center_horizontal"
android:gravity="bottom|center_horizontal">

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

<ImageButton
android:layout_height="50dp"
android:layout_width="50dp"
android:src="@android:drawable/ic_menu_sort_by_size"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#000000"
android:id="@+id/ingameIBMenu"/>

<ImageButton
android:layout_height="50dp"
android:layout_width="50dp"
android:src="@drawable/tbxinxi"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:scaleType="fitXY"
android:background="#ED6FD7"
android:id="@+id/ingameIBStat"/>

<ImageButton
android:layout_height="50dp"
android:layout_width="50dp"
android:src="@android:drawable/ic_search_category_default"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#0E5DEE"
android:scaleType="fitXY"
android:id="@+id/ingameIBTech"/>

<ImageButton
android:layout_height="50dp"
android:layout_width="50dp"
android:src="@drawable/nextturn_btn"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:background="#2AF4D8"
android:id="@+id/ingameIBNextTurn"
android:scaleType="fitXY"/>

</LinearLayout>

</LinearLayout>

</LinearLayout>

<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="horizontal"
android:id="@+id/ingameLLCapture">

<ImageView
style="?android:attr/buttonBarButtonStyle"
android:layout_height="50dp"
android:layout_width="50dp"
android:src="@drawable/capture"/>

</LinearLayout>

<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_gravity="bottom|center_horizontal"
android:gravity="bottom|center_horizontal"
android:id="@+id/ingameLLDesc"
android:visibility="invisible">

<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_gravity="bottom|center_horizontal"
android:gravity="center_horizontal"
android:background="#000000"
android:id="@+id/ingameLLDescIn">

<ImageView
android:layout_height="52dp"
android:layout_width="50dp"
android:src="@drawable/burning"
android:id="@+id/ingameDescIvImg"
android:scaleType="fitXY"/>

<LinearLayout
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:orientation="vertical"
android:layout_weight="1.0">

<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Forest,Game"
android:id="@+id/ingameDescTvTitle"
android:layout_gravity="center"
android:textColor="#FFFFFF"/>

<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Tap here to extract"
android:id="@+id/ingameDescTvDetail"
android:layout_gravity="center"
android:textColor="#FFFFFF"/>

</LinearLayout>

<ImageButton
android:layout_height="52dp"
android:layout_width="52dp"
android:src="@drawable/x_btn"
android:id="@+id/ingameDescIbBack"
android:background="#000000"
android:scaleType="fitXY"/>

</LinearLayout>

<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_gravity="bottom|center_horizontal"
android:gravity="center_horizontal"
android:background="#000000"
android:id="@+id/ingameLLDescInBtns">

<ImageView
android:layout_height="52dp"
android:layout_width="50dp"
android:src="@drawable/burning"
android:id="@+id/ingameDescBtnsIvImg"
android:scaleType="fitXY"/>

<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="vertical">

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

<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Forest,Game"
android:id="@+id/ingameDescBtnsTvTitle"
android:layout_gravity="center"
android:textColor="#FFFFFF"/>

<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Tap here to extract"
android:id="@+id/ingameDescBtnsTvDetail"
android:layout_gravity="center"
android:textColor="#FFFFFF"/>

</LinearLayout>

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

<HorizontalScrollView
android:layout_height="wrap_content"
android:layout_width="wrap_content">

<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="horizontal"
android:id="@+id/ingameDescBtnsLL"/>

</HorizontalScrollView>

</LinearLayout>

</LinearLayout>

<ImageButton
android:layout_height="52dp"
android:layout_width="52dp"
android:src="@drawable/x_btn"
android:id="@+id/ingameDescBtnsIbBack"
android:background="#000000"
android:scaleType="fitXY"/>

</LinearLayout>

</LinearLayout>

</FrameLayout>

<FrameLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:id="@+id/ingameFrameLayoutMenu"
android:visibility="invisible"
android:elevation="10dp">

<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical"
android:gravity="center_horizontal"
android:background="#000000"
android:alpha="0.6">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Menu"
android:layout_marginTop="80dp"
android:textSize="26sp"
android:textColor="#FFFFFF"/>

<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Exit"
android:id="@+id/ingameBtExit"
android:elevation="11dp"
android:alpha="1.0"/>

</LinearLayout>

</FrameLayout>

<FrameLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:id="@+id/ingameFrameLayoutStat"
android:visibility="invisible">

<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical"
android:gravity="center_horizontal"
android:background="#000000">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Game mode"
android:layout_marginTop="80dp"
android:id="@+id/ingameStatTVTitle"
android:textColor="#FFFFFF"/>

<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Text"
android:id="@+id/ingameStatTVContent"/>

<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Back"
android:layout_margin="10dp"
android:id="@+id/ingameBtStatBack"/>

</LinearLayout>

</FrameLayout>

<FrameLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:id="@+id/ingameFrameLayoutTech"
android:visibility="invisible"
android:background="#FFFFFF">

<ScrollView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:background="#FFFFFF"
android:layout_marginTop="40dp">

<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical"
android:id="@+id/ingameLLTechContainer"/>

</ScrollView>

</FrameLayout>

<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical"
android:id="@+id/ingamellVictory"
android:gravity="top|center"
android:background="#000000">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="VICTORY!!!"
android:textSize="40sp"
android:textColor="#FFFFFF"
android:layout_marginTop="87dp"/>

<ImageView
android:layout_height="100dp"
android:layout_width="100dp"
android:src="@drawable/capture"
android:scaleType="fitXY"/>

<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="DONE"
android:background="#83DBFF"
android:textColor="#FFFFFF"
android:layout_marginTop="100dp"
android:id="@+id/ingameBtDone"/>

</LinearLayout>

<LinearLayout
android:layout_height="match_parent"
android:layout_width="match_parent"
android:orientation="vertical"
android:gravity="top">

<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="horizontal"
android:gravity="center_horizontal"
android:layout_gravity="center_horizontal">

<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="vertical"
android:layout_weight="1.0"
android:layout_marginRight="28dp"
android:layout_marginLeft="26dp">

<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="Score"
android:textColor="#FFFFFF"
android:shadowColor="#000000"
android:shadowRadius="40"
android:background="#000000"/>

<ImageView
android:layout_height="35dp"
android:layout_width="35dp"
android:src="@android:drawable/ic_menu_myplaces"
android:background="#F1F137"/>

<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="500"
android:textColor="#FFFFFF"
android:gravity="center"
android:id="@+id/ingameTvScore"
android:shadowColor="#000000"
android:shadowRadius="1.0"
android:background="#000000"/>

</LinearLayout>

<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="vertical"
android:layout_weight="1.0"
android:layout_marginRight="28dp"
android:layout_marginLeft="26dp">

<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="Stars"
android:gravity="center"
android:textColor="#FFFFFF"
android:shadowColor="#000000"
android:shadowRadius="2"
android:background="#000000"/>

<ImageView
android:layout_height="35dp"
android:layout_width="35dp"
android:src="@android:drawable/star_on"
android:scaleType="fitXY"
android:background="#F00808"/>

<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="5"
android:textColor="#FFFFFF"
android:gravity="center"
android:id="@+id/ingameTvStars"
android:shadowColor="#000000"
android:shadowRadius="2"
android:background="#000000"/>

</LinearLayout>

<LinearLayout
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:orientation="vertical"
android:layout_weight="1.0"
android:layout_marginRight="28dp"
android:layout_marginLeft="26dp">

<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="Turn"
android:gravity="center"
android:textColor="#FFFFFF"
android:shadowColor="#000000"
android:shadowRadius="2"
android:background="#000000"/>

<ImageView
android:layout_height="35dp"
android:layout_width="35dp"
android:src="@android:drawable/ic_menu_recent_history"
android:background="#55F80C"/>

<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:text="0"
android:textColor="#FFFFFF"
android:gravity="center"
android:id="@+id/ingameTvTurns"
android:shadowColor="#000000"
android:shadowRadius="2"
android:background="#000000"/>

</LinearLayout>

</LinearLayout>

</LinearLayout>

<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="vertical"
android:id="@+id/ingameLLToast"/>

</FrameLayout>


Thanks!










share|improve this question


























    up vote
    0
    down vote

    favorite












    I would like to optimize this layout to improve rendering speed. How can I remove so much unnecessary components from the layout file below?



    I heard I should use RelativeLayout rather than LinearLayout, but don't know how.



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

    <FrameLayout
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:id="@+id/ingameFrameLayout"
    android:visibility="visible">

    <com.kyunggi.sanggeoltopia2.InGameSurfaceView
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/ingameSurfaceView"/>

    <com.kyunggi.sanggeoltopia2.InGameViewOGL
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/ingameViewOGL"/>

    <LinearLayout
    android:layout_height="fill_parent"
    android:layout_width="fill_parent"
    android:orientation="vertical"
    android:visibility="visible">

    <LinearLayout
    android:layout_height="match_parent"
    android:layout_width="wrap_content"
    android:orientation="horizontal"
    android:layout_gravity="bottom|center_horizontal"
    android:gravity="bottom|center_horizontal">

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

    <ImageButton
    android:layout_height="50dp"
    android:layout_width="50dp"
    android:src="@android:drawable/ic_menu_sort_by_size"
    android:layout_marginLeft="20dp"
    android:layout_marginRight="20dp"
    android:background="#000000"
    android:id="@+id/ingameIBMenu"/>

    <ImageButton
    android:layout_height="50dp"
    android:layout_width="50dp"
    android:src="@drawable/tbxinxi"
    android:layout_marginLeft="20dp"
    android:layout_marginRight="20dp"
    android:scaleType="fitXY"
    android:background="#ED6FD7"
    android:id="@+id/ingameIBStat"/>

    <ImageButton
    android:layout_height="50dp"
    android:layout_width="50dp"
    android:src="@android:drawable/ic_search_category_default"
    android:layout_marginLeft="20dp"
    android:layout_marginRight="20dp"
    android:background="#0E5DEE"
    android:scaleType="fitXY"
    android:id="@+id/ingameIBTech"/>

    <ImageButton
    android:layout_height="50dp"
    android:layout_width="50dp"
    android:src="@drawable/nextturn_btn"
    android:layout_marginLeft="20dp"
    android:layout_marginRight="20dp"
    android:background="#2AF4D8"
    android:id="@+id/ingameIBNextTurn"
    android:scaleType="fitXY"/>

    </LinearLayout>

    </LinearLayout>

    </LinearLayout>

    <LinearLayout
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:orientation="horizontal"
    android:id="@+id/ingameLLCapture">

    <ImageView
    style="?android:attr/buttonBarButtonStyle"
    android:layout_height="50dp"
    android:layout_width="50dp"
    android:src="@drawable/capture"/>

    </LinearLayout>

    <LinearLayout
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:orientation="horizontal"
    android:layout_gravity="bottom|center_horizontal"
    android:gravity="bottom|center_horizontal"
    android:id="@+id/ingameLLDesc"
    android:visibility="invisible">

    <LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:orientation="horizontal"
    android:layout_gravity="bottom|center_horizontal"
    android:gravity="center_horizontal"
    android:background="#000000"
    android:id="@+id/ingameLLDescIn">

    <ImageView
    android:layout_height="52dp"
    android:layout_width="50dp"
    android:src="@drawable/burning"
    android:id="@+id/ingameDescIvImg"
    android:scaleType="fitXY"/>

    <LinearLayout
    android:layout_height="match_parent"
    android:layout_width="wrap_content"
    android:orientation="vertical"
    android:layout_weight="1.0">

    <TextView
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:text="Forest,Game"
    android:id="@+id/ingameDescTvTitle"
    android:layout_gravity="center"
    android:textColor="#FFFFFF"/>

    <TextView
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:text="Tap here to extract"
    android:id="@+id/ingameDescTvDetail"
    android:layout_gravity="center"
    android:textColor="#FFFFFF"/>

    </LinearLayout>

    <ImageButton
    android:layout_height="52dp"
    android:layout_width="52dp"
    android:src="@drawable/x_btn"
    android:id="@+id/ingameDescIbBack"
    android:background="#000000"
    android:scaleType="fitXY"/>

    </LinearLayout>

    <LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:orientation="horizontal"
    android:layout_gravity="bottom|center_horizontal"
    android:gravity="center_horizontal"
    android:background="#000000"
    android:id="@+id/ingameLLDescInBtns">

    <ImageView
    android:layout_height="52dp"
    android:layout_width="50dp"
    android:src="@drawable/burning"
    android:id="@+id/ingameDescBtnsIvImg"
    android:scaleType="fitXY"/>

    <LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:orientation="vertical">

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

    <TextView
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:text="Forest,Game"
    android:id="@+id/ingameDescBtnsTvTitle"
    android:layout_gravity="center"
    android:textColor="#FFFFFF"/>

    <TextView
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:text="Tap here to extract"
    android:id="@+id/ingameDescBtnsTvDetail"
    android:layout_gravity="center"
    android:textColor="#FFFFFF"/>

    </LinearLayout>

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

    <HorizontalScrollView
    android:layout_height="wrap_content"
    android:layout_width="wrap_content">

    <LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:orientation="horizontal"
    android:id="@+id/ingameDescBtnsLL"/>

    </HorizontalScrollView>

    </LinearLayout>

    </LinearLayout>

    <ImageButton
    android:layout_height="52dp"
    android:layout_width="52dp"
    android:src="@drawable/x_btn"
    android:id="@+id/ingameDescBtnsIbBack"
    android:background="#000000"
    android:scaleType="fitXY"/>

    </LinearLayout>

    </LinearLayout>

    </FrameLayout>

    <FrameLayout
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:id="@+id/ingameFrameLayoutMenu"
    android:visibility="invisible"
    android:elevation="10dp">

    <LinearLayout
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:gravity="center_horizontal"
    android:background="#000000"
    android:alpha="0.6">

    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="Menu"
    android:layout_marginTop="80dp"
    android:textSize="26sp"
    android:textColor="#FFFFFF"/>

    <Button
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:text="Exit"
    android:id="@+id/ingameBtExit"
    android:elevation="11dp"
    android:alpha="1.0"/>

    </LinearLayout>

    </FrameLayout>

    <FrameLayout
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:id="@+id/ingameFrameLayoutStat"
    android:visibility="invisible">

    <LinearLayout
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:gravity="center_horizontal"
    android:background="#000000">

    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="Game mode"
    android:layout_marginTop="80dp"
    android:id="@+id/ingameStatTVTitle"
    android:textColor="#FFFFFF"/>

    <TextView
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:text="Text"
    android:id="@+id/ingameStatTVContent"/>

    <Button
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:text="Back"
    android:layout_margin="10dp"
    android:id="@+id/ingameBtStatBack"/>

    </LinearLayout>

    </FrameLayout>

    <FrameLayout
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:id="@+id/ingameFrameLayoutTech"
    android:visibility="invisible"
    android:background="#FFFFFF">

    <ScrollView
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:background="#FFFFFF"
    android:layout_marginTop="40dp">

    <LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:id="@+id/ingameLLTechContainer"/>

    </ScrollView>

    </FrameLayout>

    <LinearLayout
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:id="@+id/ingamellVictory"
    android:gravity="top|center"
    android:background="#000000">

    <TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="VICTORY!!!"
    android:textSize="40sp"
    android:textColor="#FFFFFF"
    android:layout_marginTop="87dp"/>

    <ImageView
    android:layout_height="100dp"
    android:layout_width="100dp"
    android:src="@drawable/capture"
    android:scaleType="fitXY"/>

    <Button
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:text="DONE"
    android:background="#83DBFF"
    android:textColor="#FFFFFF"
    android:layout_marginTop="100dp"
    android:id="@+id/ingameBtDone"/>

    </LinearLayout>

    <LinearLayout
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:gravity="top">

    <LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:orientation="horizontal"
    android:gravity="center_horizontal"
    android:layout_gravity="center_horizontal">

    <LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:orientation="vertical"
    android:layout_weight="1.0"
    android:layout_marginRight="28dp"
    android:layout_marginLeft="26dp">

    <TextView
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:text="Score"
    android:textColor="#FFFFFF"
    android:shadowColor="#000000"
    android:shadowRadius="40"
    android:background="#000000"/>

    <ImageView
    android:layout_height="35dp"
    android:layout_width="35dp"
    android:src="@android:drawable/ic_menu_myplaces"
    android:background="#F1F137"/>

    <TextView
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:text="500"
    android:textColor="#FFFFFF"
    android:gravity="center"
    android:id="@+id/ingameTvScore"
    android:shadowColor="#000000"
    android:shadowRadius="1.0"
    android:background="#000000"/>

    </LinearLayout>

    <LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:orientation="vertical"
    android:layout_weight="1.0"
    android:layout_marginRight="28dp"
    android:layout_marginLeft="26dp">

    <TextView
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:text="Stars"
    android:gravity="center"
    android:textColor="#FFFFFF"
    android:shadowColor="#000000"
    android:shadowRadius="2"
    android:background="#000000"/>

    <ImageView
    android:layout_height="35dp"
    android:layout_width="35dp"
    android:src="@android:drawable/star_on"
    android:scaleType="fitXY"
    android:background="#F00808"/>

    <TextView
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:text="5"
    android:textColor="#FFFFFF"
    android:gravity="center"
    android:id="@+id/ingameTvStars"
    android:shadowColor="#000000"
    android:shadowRadius="2"
    android:background="#000000"/>

    </LinearLayout>

    <LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:orientation="vertical"
    android:layout_weight="1.0"
    android:layout_marginRight="28dp"
    android:layout_marginLeft="26dp">

    <TextView
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:text="Turn"
    android:gravity="center"
    android:textColor="#FFFFFF"
    android:shadowColor="#000000"
    android:shadowRadius="2"
    android:background="#000000"/>

    <ImageView
    android:layout_height="35dp"
    android:layout_width="35dp"
    android:src="@android:drawable/ic_menu_recent_history"
    android:background="#55F80C"/>

    <TextView
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:text="0"
    android:textColor="#FFFFFF"
    android:gravity="center"
    android:id="@+id/ingameTvTurns"
    android:shadowColor="#000000"
    android:shadowRadius="2"
    android:background="#000000"/>

    </LinearLayout>

    </LinearLayout>

    </LinearLayout>

    <LinearLayout
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:id="@+id/ingameLLToast"/>

    </FrameLayout>


    Thanks!










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I would like to optimize this layout to improve rendering speed. How can I remove so much unnecessary components from the layout file below?



      I heard I should use RelativeLayout rather than LinearLayout, but don't know how.



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

      <FrameLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:id="@+id/ingameFrameLayout"
      android:visibility="visible">

      <com.kyunggi.sanggeoltopia2.InGameSurfaceView
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:id="@+id/ingameSurfaceView"/>

      <com.kyunggi.sanggeoltopia2.InGameViewOGL
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:id="@+id/ingameViewOGL"/>

      <LinearLayout
      android:layout_height="fill_parent"
      android:layout_width="fill_parent"
      android:orientation="vertical"
      android:visibility="visible">

      <LinearLayout
      android:layout_height="match_parent"
      android:layout_width="wrap_content"
      android:orientation="horizontal"
      android:layout_gravity="bottom|center_horizontal"
      android:gravity="bottom|center_horizontal">

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

      <ImageButton
      android:layout_height="50dp"
      android:layout_width="50dp"
      android:src="@android:drawable/ic_menu_sort_by_size"
      android:layout_marginLeft="20dp"
      android:layout_marginRight="20dp"
      android:background="#000000"
      android:id="@+id/ingameIBMenu"/>

      <ImageButton
      android:layout_height="50dp"
      android:layout_width="50dp"
      android:src="@drawable/tbxinxi"
      android:layout_marginLeft="20dp"
      android:layout_marginRight="20dp"
      android:scaleType="fitXY"
      android:background="#ED6FD7"
      android:id="@+id/ingameIBStat"/>

      <ImageButton
      android:layout_height="50dp"
      android:layout_width="50dp"
      android:src="@android:drawable/ic_search_category_default"
      android:layout_marginLeft="20dp"
      android:layout_marginRight="20dp"
      android:background="#0E5DEE"
      android:scaleType="fitXY"
      android:id="@+id/ingameIBTech"/>

      <ImageButton
      android:layout_height="50dp"
      android:layout_width="50dp"
      android:src="@drawable/nextturn_btn"
      android:layout_marginLeft="20dp"
      android:layout_marginRight="20dp"
      android:background="#2AF4D8"
      android:id="@+id/ingameIBNextTurn"
      android:scaleType="fitXY"/>

      </LinearLayout>

      </LinearLayout>

      </LinearLayout>

      <LinearLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:orientation="horizontal"
      android:id="@+id/ingameLLCapture">

      <ImageView
      style="?android:attr/buttonBarButtonStyle"
      android:layout_height="50dp"
      android:layout_width="50dp"
      android:src="@drawable/capture"/>

      </LinearLayout>

      <LinearLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:orientation="horizontal"
      android:layout_gravity="bottom|center_horizontal"
      android:gravity="bottom|center_horizontal"
      android:id="@+id/ingameLLDesc"
      android:visibility="invisible">

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:orientation="horizontal"
      android:layout_gravity="bottom|center_horizontal"
      android:gravity="center_horizontal"
      android:background="#000000"
      android:id="@+id/ingameLLDescIn">

      <ImageView
      android:layout_height="52dp"
      android:layout_width="50dp"
      android:src="@drawable/burning"
      android:id="@+id/ingameDescIvImg"
      android:scaleType="fitXY"/>

      <LinearLayout
      android:layout_height="match_parent"
      android:layout_width="wrap_content"
      android:orientation="vertical"
      android:layout_weight="1.0">

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="Forest,Game"
      android:id="@+id/ingameDescTvTitle"
      android:layout_gravity="center"
      android:textColor="#FFFFFF"/>

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="Tap here to extract"
      android:id="@+id/ingameDescTvDetail"
      android:layout_gravity="center"
      android:textColor="#FFFFFF"/>

      </LinearLayout>

      <ImageButton
      android:layout_height="52dp"
      android:layout_width="52dp"
      android:src="@drawable/x_btn"
      android:id="@+id/ingameDescIbBack"
      android:background="#000000"
      android:scaleType="fitXY"/>

      </LinearLayout>

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:orientation="horizontal"
      android:layout_gravity="bottom|center_horizontal"
      android:gravity="center_horizontal"
      android:background="#000000"
      android:id="@+id/ingameLLDescInBtns">

      <ImageView
      android:layout_height="52dp"
      android:layout_width="50dp"
      android:src="@drawable/burning"
      android:id="@+id/ingameDescBtnsIvImg"
      android:scaleType="fitXY"/>

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:orientation="vertical">

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

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="Forest,Game"
      android:id="@+id/ingameDescBtnsTvTitle"
      android:layout_gravity="center"
      android:textColor="#FFFFFF"/>

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="Tap here to extract"
      android:id="@+id/ingameDescBtnsTvDetail"
      android:layout_gravity="center"
      android:textColor="#FFFFFF"/>

      </LinearLayout>

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

      <HorizontalScrollView
      android:layout_height="wrap_content"
      android:layout_width="wrap_content">

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:orientation="horizontal"
      android:id="@+id/ingameDescBtnsLL"/>

      </HorizontalScrollView>

      </LinearLayout>

      </LinearLayout>

      <ImageButton
      android:layout_height="52dp"
      android:layout_width="52dp"
      android:src="@drawable/x_btn"
      android:id="@+id/ingameDescBtnsIbBack"
      android:background="#000000"
      android:scaleType="fitXY"/>

      </LinearLayout>

      </LinearLayout>

      </FrameLayout>

      <FrameLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:id="@+id/ingameFrameLayoutMenu"
      android:visibility="invisible"
      android:elevation="10dp">

      <LinearLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:orientation="vertical"
      android:gravity="center_horizontal"
      android:background="#000000"
      android:alpha="0.6">

      <TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceLarge"
      android:text="Menu"
      android:layout_marginTop="80dp"
      android:textSize="26sp"
      android:textColor="#FFFFFF"/>

      <Button
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="Exit"
      android:id="@+id/ingameBtExit"
      android:elevation="11dp"
      android:alpha="1.0"/>

      </LinearLayout>

      </FrameLayout>

      <FrameLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:id="@+id/ingameFrameLayoutStat"
      android:visibility="invisible">

      <LinearLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:orientation="vertical"
      android:gravity="center_horizontal"
      android:background="#000000">

      <TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceLarge"
      android:text="Game mode"
      android:layout_marginTop="80dp"
      android:id="@+id/ingameStatTVTitle"
      android:textColor="#FFFFFF"/>

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="Text"
      android:id="@+id/ingameStatTVContent"/>

      <Button
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="Back"
      android:layout_margin="10dp"
      android:id="@+id/ingameBtStatBack"/>

      </LinearLayout>

      </FrameLayout>

      <FrameLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:id="@+id/ingameFrameLayoutTech"
      android:visibility="invisible"
      android:background="#FFFFFF">

      <ScrollView
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:background="#FFFFFF"
      android:layout_marginTop="40dp">

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:orientation="vertical"
      android:id="@+id/ingameLLTechContainer"/>

      </ScrollView>

      </FrameLayout>

      <LinearLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:orientation="vertical"
      android:id="@+id/ingamellVictory"
      android:gravity="top|center"
      android:background="#000000">

      <TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceLarge"
      android:text="VICTORY!!!"
      android:textSize="40sp"
      android:textColor="#FFFFFF"
      android:layout_marginTop="87dp"/>

      <ImageView
      android:layout_height="100dp"
      android:layout_width="100dp"
      android:src="@drawable/capture"
      android:scaleType="fitXY"/>

      <Button
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="DONE"
      android:background="#83DBFF"
      android:textColor="#FFFFFF"
      android:layout_marginTop="100dp"
      android:id="@+id/ingameBtDone"/>

      </LinearLayout>

      <LinearLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:orientation="vertical"
      android:gravity="top">

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:orientation="horizontal"
      android:gravity="center_horizontal"
      android:layout_gravity="center_horizontal">

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:orientation="vertical"
      android:layout_weight="1.0"
      android:layout_marginRight="28dp"
      android:layout_marginLeft="26dp">

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="Score"
      android:textColor="#FFFFFF"
      android:shadowColor="#000000"
      android:shadowRadius="40"
      android:background="#000000"/>

      <ImageView
      android:layout_height="35dp"
      android:layout_width="35dp"
      android:src="@android:drawable/ic_menu_myplaces"
      android:background="#F1F137"/>

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:text="500"
      android:textColor="#FFFFFF"
      android:gravity="center"
      android:id="@+id/ingameTvScore"
      android:shadowColor="#000000"
      android:shadowRadius="1.0"
      android:background="#000000"/>

      </LinearLayout>

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:orientation="vertical"
      android:layout_weight="1.0"
      android:layout_marginRight="28dp"
      android:layout_marginLeft="26dp">

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:text="Stars"
      android:gravity="center"
      android:textColor="#FFFFFF"
      android:shadowColor="#000000"
      android:shadowRadius="2"
      android:background="#000000"/>

      <ImageView
      android:layout_height="35dp"
      android:layout_width="35dp"
      android:src="@android:drawable/star_on"
      android:scaleType="fitXY"
      android:background="#F00808"/>

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:text="5"
      android:textColor="#FFFFFF"
      android:gravity="center"
      android:id="@+id/ingameTvStars"
      android:shadowColor="#000000"
      android:shadowRadius="2"
      android:background="#000000"/>

      </LinearLayout>

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:orientation="vertical"
      android:layout_weight="1.0"
      android:layout_marginRight="28dp"
      android:layout_marginLeft="26dp">

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:text="Turn"
      android:gravity="center"
      android:textColor="#FFFFFF"
      android:shadowColor="#000000"
      android:shadowRadius="2"
      android:background="#000000"/>

      <ImageView
      android:layout_height="35dp"
      android:layout_width="35dp"
      android:src="@android:drawable/ic_menu_recent_history"
      android:background="#55F80C"/>

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:text="0"
      android:textColor="#FFFFFF"
      android:gravity="center"
      android:id="@+id/ingameTvTurns"
      android:shadowColor="#000000"
      android:shadowRadius="2"
      android:background="#000000"/>

      </LinearLayout>

      </LinearLayout>

      </LinearLayout>

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:orientation="vertical"
      android:id="@+id/ingameLLToast"/>

      </FrameLayout>


      Thanks!










      share|improve this question













      I would like to optimize this layout to improve rendering speed. How can I remove so much unnecessary components from the layout file below?



      I heard I should use RelativeLayout rather than LinearLayout, but don't know how.



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

      <FrameLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:id="@+id/ingameFrameLayout"
      android:visibility="visible">

      <com.kyunggi.sanggeoltopia2.InGameSurfaceView
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:id="@+id/ingameSurfaceView"/>

      <com.kyunggi.sanggeoltopia2.InGameViewOGL
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:id="@+id/ingameViewOGL"/>

      <LinearLayout
      android:layout_height="fill_parent"
      android:layout_width="fill_parent"
      android:orientation="vertical"
      android:visibility="visible">

      <LinearLayout
      android:layout_height="match_parent"
      android:layout_width="wrap_content"
      android:orientation="horizontal"
      android:layout_gravity="bottom|center_horizontal"
      android:gravity="bottom|center_horizontal">

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

      <ImageButton
      android:layout_height="50dp"
      android:layout_width="50dp"
      android:src="@android:drawable/ic_menu_sort_by_size"
      android:layout_marginLeft="20dp"
      android:layout_marginRight="20dp"
      android:background="#000000"
      android:id="@+id/ingameIBMenu"/>

      <ImageButton
      android:layout_height="50dp"
      android:layout_width="50dp"
      android:src="@drawable/tbxinxi"
      android:layout_marginLeft="20dp"
      android:layout_marginRight="20dp"
      android:scaleType="fitXY"
      android:background="#ED6FD7"
      android:id="@+id/ingameIBStat"/>

      <ImageButton
      android:layout_height="50dp"
      android:layout_width="50dp"
      android:src="@android:drawable/ic_search_category_default"
      android:layout_marginLeft="20dp"
      android:layout_marginRight="20dp"
      android:background="#0E5DEE"
      android:scaleType="fitXY"
      android:id="@+id/ingameIBTech"/>

      <ImageButton
      android:layout_height="50dp"
      android:layout_width="50dp"
      android:src="@drawable/nextturn_btn"
      android:layout_marginLeft="20dp"
      android:layout_marginRight="20dp"
      android:background="#2AF4D8"
      android:id="@+id/ingameIBNextTurn"
      android:scaleType="fitXY"/>

      </LinearLayout>

      </LinearLayout>

      </LinearLayout>

      <LinearLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:orientation="horizontal"
      android:id="@+id/ingameLLCapture">

      <ImageView
      style="?android:attr/buttonBarButtonStyle"
      android:layout_height="50dp"
      android:layout_width="50dp"
      android:src="@drawable/capture"/>

      </LinearLayout>

      <LinearLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:orientation="horizontal"
      android:layout_gravity="bottom|center_horizontal"
      android:gravity="bottom|center_horizontal"
      android:id="@+id/ingameLLDesc"
      android:visibility="invisible">

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:orientation="horizontal"
      android:layout_gravity="bottom|center_horizontal"
      android:gravity="center_horizontal"
      android:background="#000000"
      android:id="@+id/ingameLLDescIn">

      <ImageView
      android:layout_height="52dp"
      android:layout_width="50dp"
      android:src="@drawable/burning"
      android:id="@+id/ingameDescIvImg"
      android:scaleType="fitXY"/>

      <LinearLayout
      android:layout_height="match_parent"
      android:layout_width="wrap_content"
      android:orientation="vertical"
      android:layout_weight="1.0">

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="Forest,Game"
      android:id="@+id/ingameDescTvTitle"
      android:layout_gravity="center"
      android:textColor="#FFFFFF"/>

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="Tap here to extract"
      android:id="@+id/ingameDescTvDetail"
      android:layout_gravity="center"
      android:textColor="#FFFFFF"/>

      </LinearLayout>

      <ImageButton
      android:layout_height="52dp"
      android:layout_width="52dp"
      android:src="@drawable/x_btn"
      android:id="@+id/ingameDescIbBack"
      android:background="#000000"
      android:scaleType="fitXY"/>

      </LinearLayout>

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:orientation="horizontal"
      android:layout_gravity="bottom|center_horizontal"
      android:gravity="center_horizontal"
      android:background="#000000"
      android:id="@+id/ingameLLDescInBtns">

      <ImageView
      android:layout_height="52dp"
      android:layout_width="50dp"
      android:src="@drawable/burning"
      android:id="@+id/ingameDescBtnsIvImg"
      android:scaleType="fitXY"/>

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:orientation="vertical">

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

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="Forest,Game"
      android:id="@+id/ingameDescBtnsTvTitle"
      android:layout_gravity="center"
      android:textColor="#FFFFFF"/>

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="Tap here to extract"
      android:id="@+id/ingameDescBtnsTvDetail"
      android:layout_gravity="center"
      android:textColor="#FFFFFF"/>

      </LinearLayout>

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

      <HorizontalScrollView
      android:layout_height="wrap_content"
      android:layout_width="wrap_content">

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:orientation="horizontal"
      android:id="@+id/ingameDescBtnsLL"/>

      </HorizontalScrollView>

      </LinearLayout>

      </LinearLayout>

      <ImageButton
      android:layout_height="52dp"
      android:layout_width="52dp"
      android:src="@drawable/x_btn"
      android:id="@+id/ingameDescBtnsIbBack"
      android:background="#000000"
      android:scaleType="fitXY"/>

      </LinearLayout>

      </LinearLayout>

      </FrameLayout>

      <FrameLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:id="@+id/ingameFrameLayoutMenu"
      android:visibility="invisible"
      android:elevation="10dp">

      <LinearLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:orientation="vertical"
      android:gravity="center_horizontal"
      android:background="#000000"
      android:alpha="0.6">

      <TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceLarge"
      android:text="Menu"
      android:layout_marginTop="80dp"
      android:textSize="26sp"
      android:textColor="#FFFFFF"/>

      <Button
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="Exit"
      android:id="@+id/ingameBtExit"
      android:elevation="11dp"
      android:alpha="1.0"/>

      </LinearLayout>

      </FrameLayout>

      <FrameLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:id="@+id/ingameFrameLayoutStat"
      android:visibility="invisible">

      <LinearLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:orientation="vertical"
      android:gravity="center_horizontal"
      android:background="#000000">

      <TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceLarge"
      android:text="Game mode"
      android:layout_marginTop="80dp"
      android:id="@+id/ingameStatTVTitle"
      android:textColor="#FFFFFF"/>

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="Text"
      android:id="@+id/ingameStatTVContent"/>

      <Button
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="Back"
      android:layout_margin="10dp"
      android:id="@+id/ingameBtStatBack"/>

      </LinearLayout>

      </FrameLayout>

      <FrameLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:id="@+id/ingameFrameLayoutTech"
      android:visibility="invisible"
      android:background="#FFFFFF">

      <ScrollView
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:background="#FFFFFF"
      android:layout_marginTop="40dp">

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:orientation="vertical"
      android:id="@+id/ingameLLTechContainer"/>

      </ScrollView>

      </FrameLayout>

      <LinearLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:orientation="vertical"
      android:id="@+id/ingamellVictory"
      android:gravity="top|center"
      android:background="#000000">

      <TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceLarge"
      android:text="VICTORY!!!"
      android:textSize="40sp"
      android:textColor="#FFFFFF"
      android:layout_marginTop="87dp"/>

      <ImageView
      android:layout_height="100dp"
      android:layout_width="100dp"
      android:src="@drawable/capture"
      android:scaleType="fitXY"/>

      <Button
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="DONE"
      android:background="#83DBFF"
      android:textColor="#FFFFFF"
      android:layout_marginTop="100dp"
      android:id="@+id/ingameBtDone"/>

      </LinearLayout>

      <LinearLayout
      android:layout_height="match_parent"
      android:layout_width="match_parent"
      android:orientation="vertical"
      android:gravity="top">

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:orientation="horizontal"
      android:gravity="center_horizontal"
      android:layout_gravity="center_horizontal">

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:orientation="vertical"
      android:layout_weight="1.0"
      android:layout_marginRight="28dp"
      android:layout_marginLeft="26dp">

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="Score"
      android:textColor="#FFFFFF"
      android:shadowColor="#000000"
      android:shadowRadius="40"
      android:background="#000000"/>

      <ImageView
      android:layout_height="35dp"
      android:layout_width="35dp"
      android:src="@android:drawable/ic_menu_myplaces"
      android:background="#F1F137"/>

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:text="500"
      android:textColor="#FFFFFF"
      android:gravity="center"
      android:id="@+id/ingameTvScore"
      android:shadowColor="#000000"
      android:shadowRadius="1.0"
      android:background="#000000"/>

      </LinearLayout>

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:orientation="vertical"
      android:layout_weight="1.0"
      android:layout_marginRight="28dp"
      android:layout_marginLeft="26dp">

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:text="Stars"
      android:gravity="center"
      android:textColor="#FFFFFF"
      android:shadowColor="#000000"
      android:shadowRadius="2"
      android:background="#000000"/>

      <ImageView
      android:layout_height="35dp"
      android:layout_width="35dp"
      android:src="@android:drawable/star_on"
      android:scaleType="fitXY"
      android:background="#F00808"/>

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:text="5"
      android:textColor="#FFFFFF"
      android:gravity="center"
      android:id="@+id/ingameTvStars"
      android:shadowColor="#000000"
      android:shadowRadius="2"
      android:background="#000000"/>

      </LinearLayout>

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:orientation="vertical"
      android:layout_weight="1.0"
      android:layout_marginRight="28dp"
      android:layout_marginLeft="26dp">

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:text="Turn"
      android:gravity="center"
      android:textColor="#FFFFFF"
      android:shadowColor="#000000"
      android:shadowRadius="2"
      android:background="#000000"/>

      <ImageView
      android:layout_height="35dp"
      android:layout_width="35dp"
      android:src="@android:drawable/ic_menu_recent_history"
      android:background="#55F80C"/>

      <TextView
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:text="0"
      android:textColor="#FFFFFF"
      android:gravity="center"
      android:id="@+id/ingameTvTurns"
      android:shadowColor="#000000"
      android:shadowRadius="2"
      android:background="#000000"/>

      </LinearLayout>

      </LinearLayout>

      </LinearLayout>

      <LinearLayout
      android:layout_height="wrap_content"
      android:layout_width="match_parent"
      android:orientation="vertical"
      android:id="@+id/ingameLLToast"/>

      </FrameLayout>


      Thanks!







      android layout






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 10 mins ago









      KYHSGeekCode

      2067




      2067



























          active

          oldest

          votes











          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "196"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f208804%2freduce-components-in-an-android-layout%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Code Review Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f208804%2freduce-components-in-an-android-layout%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          404 Error Contact Form 7 ajax form submitting

          How to know if a Active Directory user can login interactively

          Refactoring coordinates for Minecraft Pi buildings written in Python