Layout performance probleme

T

tim1602

Neues Mitglied
0
Hi, ich bins wieder,

Ich hab massive Probleme mit der Performance meines Layouts:

Das Layout sieht wie folgt aus:

Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/hintergrundbild">

    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center_horizontal"
        android:layout_weight="4"></LinearLayout>

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

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

            <include
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                layout="@layout/getnormdata_dialog_layout_row" />
        </LinearLayout>

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

            <include
                layout="@layout/getnormdata_dialog_layout_row"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent" />
        </LinearLayout>

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

            <include
                layout="@layout/getnormdata_dialog_layout_row"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent" />
        </LinearLayout>
    </LinearLayout>
</LinearLayout>


Hier das Layout welches inkludiert wird:

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

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

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

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:text="Titel(se)"
                android:id="@+id/incTvTitle"
                android:layout_centerInParent="true" />
        </RelativeLayout>

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

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

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

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textAppearance="?android:attr/textAppearanceSmall"
                        android:text="Bohrungsgroesse (se)"
                        android:id="@+id/textView20"
                        android:layout_centerInParent="true" />
                </RelativeLayout>

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

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

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

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:text="Min (se)"
                                android:id="@+id/textView21"
                                android:layout_centerInParent="true" />
                        </RelativeLayout>

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

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:text="Max(se)"
                                android:id="@+id/textView22"
                                android:layout_centerInParent="true" />
                        </RelativeLayout>
                    </LinearLayout>

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

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

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:text="Small Text"
                                android:id="@+id/incTvBohrgrMin"
                                android:layout_centerInParent="true" />
                        </RelativeLayout>

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

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:text="Small Text"
                                android:id="@+id/incTvBohrgrMax"
                                android:layout_centerInParent="true" />
                        </RelativeLayout>
                    </LinearLayout>
                </LinearLayout>
            </LinearLayout>

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

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

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textAppearance="?android:attr/textAppearanceSmall"
                        android:text="Passung(se)"
                        android:id="@+id/textView25"
                        android:layout_centerInParent="true" />
                </RelativeLayout>

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

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

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

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:text="Spiel(se)"
                                android:id="@+id/textView26"
                                android:layout_centerInParent="true" />
                        </RelativeLayout>

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

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:text="Press (se)"
                                android:id="@+id/textView27"
                                android:layout_centerInParent="true" />
                        </RelativeLayout>
                    </LinearLayout>

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

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

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:text="Small Text"
                                android:id="@+id/incTvPassungSpiel"
                                android:layout_centerInParent="true" />
                        </RelativeLayout>

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

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:text="Small Text"
                                android:id="@+id/incTvPassungPress"
                                android:layout_centerInParent="true" />
                        </RelativeLayout>
                    </LinearLayout>
                </LinearLayout>
            </LinearLayout>
        </LinearLayout>
    </LinearLayout>
</LinearLayout>

Wäre super wenn jemand der Erfahrung mal drüberguckt warum das Layout so träge ist.

Danke im voraus!
 
Zuletzt bearbeitet von einem Moderator:
Hinweis des zuständigen Moderators: Bitte Code-Fragement in den Code-Tag packen, sonst ist es furchtbar zu lesen
 
@tim1602

Dein Problem liegt in der reichlichen Benutzung des Node android:layout_weight. Das muss alles berechnet und gezeichnet werden.

Sprich Dein Layout ist viel zu verschachtelt. Versuche ein einfacheres Layout zu benutzen
 
Schade, Hatte ich mir schon fast so gedacht....

Hättest du ne Idee wie ich das gleiche Layout, bzw nen ähnliches Layout, erzeugen kann so das es performanter ist?

Über nen relative Layout?

Jedoch sollten die Komponenten auf jedem Smartphone Bildschirm im Verhältnis gleich groß sein.

Danke auf jeden fall schon mal!
 

Ähnliche Themen

S
Antworten
4
Aufrufe
995
Sempervivum
S
R
Antworten
3
Aufrufe
1.632
Ritartet
R
L
Antworten
4
Aufrufe
1.337
lonnie9020
L
Zurück
Oben Unten