0

I've created a good looking layout for my app, but I've used relative layouts inside linear layouts (According to my needs).

Is this ok? my team partner told me that this does not follow the android guidelines and this would make the app go down in the search.

So basically, Are there any limitations on how we should use the layouts and does Google monitor these codes when the app is in the play store.

Here is the code (Had to put it in after an edit)

           <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:id="@+id/bio2"
                    android:layout_below="@+id/bio1"
                    android:orientation="horizontal"
                    android:layout_marginTop="15dp">
                            <RelativeLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content">

                                        <TextView
                                            android:layout_width="wrap_content"
                                            android:layout_height="wrap_content"
                                            android:text="Sagar Vakkala"
                                            android:textStyle="bold"
                                            android:textColor="#000"
                                            android:id="@+id/namebio"
                                            android:layout_marginLeft="15sp"
                                            />
                                        <TextView
                                            android:layout_width="match_parent"
                                            android:layout_height="wrap_content"
                                            android:layout_below="@id/namebio"
                                            android:textStyle="normal"
                                            android:text="From Delhi to Chennai in a whiff :)"
                                            android:textColor="#000"
                                            android:layout_marginLeft="15dp"
                                            android:layout_marginTop="10dp"
                                            />


                            </RelativeLayout>




                </LinearLayout>

3 Answers3

0

No, there are no limitations on how many layouts you add-in nor are there any of limitations that you've to follow for building an Android App. However google does monitor your apps, put on PlayStore.

Shujath
  • 1
  • 1
  • 1
    google recommend using layouts as flat as possible, i.e. less hierarchical, but only for performance considerations, to make the app slightly faster. you can have 100 levels of layouts if you want and feel the activity is running sufficiently fast. see https://developer.android.com/training/improving-layouts/optimizing-layout.html – marmor Oct 25 '16 at 11:38
0

In your case, you can use ConstraintLayout instead.

Take a look in the documentation : https://developer.android.com/training/constraint-layout/index.html

Luiz Fernando Salvaterra
  • 4,192
  • 2
  • 24
  • 42
0

try to reduce nesting linear layouts inside another one or two level is fine , if you trying to comeup with a bit complex UI its better to extend android ViewGroup class and create your own view

Sajidh Zahir
  • 526
  • 4
  • 13