Share this post on:

Linear Layout in Android is a View group which contains children in single direction. In Linear Layout there are two types of Orientation can be used either Vertical Or Horizontal.
Widgets using in this Design:
TextView
EditText
ImageView
FloationActionBar
LinearLayout
RelativeLayout
CircularImageView

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".Profile">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="200dp"
        android:background="@color/blue">

        <ImageView
            android:id="@+id/img_back"
            android:layout_width="14dp"
            android:layout_height="14dp"
            android:layout_alignParentLeft="true"
            android:layout_marginLeft="20dp"
            android:layout_marginTop="16dp"
            android:src="@drawable/ic_arrow_left" />


        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="16dp"
            android:layout_marginRight="40dp"
            android:gravity="center_horizontal"
            android:text=""
            android:textColor="@color/white"
            android:textSize="16sp" />


    </LinearLayout>


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

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginTop="120dp"
            android:background="@drawable/cardview_shape"
            android:orientation="vertical">


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


                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="30dp"
                    android:orientation="vertical"
                    android:padding="10dp">

                    <TextView
                        android:id="@+id/profile_name"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="20dp"
                        android:gravity="center"
                        android:text=""
                        android:textColor="@color/black"
                        android:textSize="22sp" />


                    <TextView
                        android:id="@+id/select_role_tv"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:text=""
                        android:textColor="@color/black"
                        android:textSize="15sp" />





                </LinearLayout>


                <androidx.cardview.widget.CardView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="20dp"
                    android:layout_marginBottom="2dp"
                    android:background="@color/white"
                    android:visibility="visible"
                    app:cardBackgroundColor="@android:color/white"
                    app:cardCornerRadius="20dp"
                    >

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="#F7F7F7"
                        android:orientation="vertical"
                        android:padding="16dp">


                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_margin="12dp"
                            android:orientation="horizontal">


                            <com.google.android.material.floatingactionbutton.FloatingActionButton
                                android:layout_width="50dp"
                                android:layout_height="50dp"
                                android:src="@drawable/firstname"
                                android:background="#feecd1"
                                android:backgroundTint="#feecd1"
                                app:elevation="1dp"
                                app:borderWidth="0dp"
                                app:fabCustomSize="50dp">
                            </com.google.android.material.floatingactionbutton.FloatingActionButton>



                            <TextView
                                android:id="@+id/name_tv"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center"
                                android:layout_marginLeft="14dp"
                                android:text="Himanshu Kumar"
                                android:textColor="@color/black"
                                android:visibility="visible" />

                        </LinearLayout>

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_margin="12dp"
                            android:orientation="horizontal"
                            >

                            <com.google.android.material.floatingactionbutton.FloatingActionButton
                                android:layout_width="50dp"
                                android:layout_height="50dp"
                                android:src="@drawable/mail"
                                android:background="#feecd1"
                                android:backgroundTint="#feecd1"
                                app:elevation="1dp"
                                app:borderWidth="0dp"
                                app:fabCustomSize="50dp">
                            </com.google.android.material.floatingactionbutton.FloatingActionButton>

                            <TextView
                                android:id="@+id/gmail_tv"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center"
                                android:layout_marginLeft="14dp"
                                android:text="[email protected]"
                                android:textColor="@color/black"
                                android:textSize="15sp"
                                android:visibility="visible" />

                        </LinearLayout>

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_margin="12dp"
                            android:orientation="horizontal">


                            <com.google.android.material.floatingactionbutton.FloatingActionButton
                                android:layout_width="50dp"
                                android:layout_height="50dp"
                                android:src="@drawable/mobile"
                                android:background="#feecd1"
                                android:backgroundTint="#feecd1"
                                app:elevation="1dp"
                                app:borderWidth="0dp"
                                app:fabCustomSize="50dp">
                            </com.google.android.material.floatingactionbutton.FloatingActionButton>



                            <TextView
                                android:id="@+id/mobileno_tv"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center"
                                android:layout_marginLeft="14dp"
                                android:text="+91 0123456789"
                                android:textColor="@color/black"
                                android:textSize="15sp"
                                android:visibility="visible" />

                        </LinearLayout>
                        <TextView
                            android:id="@+id/logout"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:text="Logout"
                            android:layout_marginTop="10dp"
                            android:textColor="@color/organge"
                            android:textSize="15sp"
                            android:textStyle="bold"
                            android:visibility="visible" />
                    </LinearLayout>


                </androidx.cardview.widget.CardView>


            </LinearLayout>


        </LinearLayout>


        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="70dp">

            <de.hdodenhof.circleimageview.CircleImageView
                xmlns:app="http://schemas.android.com/apk/res-auto"
                android:id="@+id/profile_image"
                android:layout_width="110dp"
                android:layout_height="110dp"
                android:src="@drawable/userprofileimage"
                android:layout_centerHorizontal="true"
                android:elevation="1dp"/>

        </RelativeLayout>

    </RelativeLayout>


</RelativeLayout>

Output:

 
Linear Layout
Share this post on:
Avatar Raiyan

Author: Raiyan

Hi, I guess you're here because you want to know a bit about me. huh? I am not so good on talking about myself but I'll give a short about me.

My Name is Raiyan. I am a Professional Application Developer and a Blogger.
I started this website to Share my Knowledge. Here I provide all my knowledge whatever I earned till now.

Leave a Comment

Your email address will not be published. Required fields are marked *