Widget Recent Post No.

header ads

Android Studio Tutorial - How to create Material Design Dashboard for Android App


 Step 1 main.xml

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout 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:background="@android:color/white"

    android:fitsSystemWindows="true"

    android:orientation="vertical"

    tools:context=".MainActivity">


    <com.google.android.material.appbar.AppBarLayout

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:theme="@style/Theme.AppCompat"

        app:elevation="0dp">


        <include layout="@layout/toolbar_main" />


    </com.google.android.material.appbar.AppBarLayout>






    <ScrollView

        android:layout_width="match_parent"

        android:layout_height="match_parent">


        <LinearLayout

            android:layout_width="fill_parent"

            android:layout_height="fill_parent"

            android:orientation="vertical"

            android:padding="8.0dip">


            <RelativeLayout

                android:layout_width="match_parent"

                android:layout_height="wrap_content"

                android:layout_gravity="center"

                android:gravity="center_vertical">


                <TextView

                    android:id="@+id/txte"

                    android:layout_width="wrap_content"

                    android:layout_height="20dp"

                    android:layout_marginLeft="10dp"

                    android:layout_marginRight="10dp"

                    android:gravity="center"

                    android:text="Enroll the best applicants, Deliver high-quality"

                    android:textColor="#000"

                    android:textSize="15dp"

                    android:textStyle="bold" />


                <TextView

                    android:layout_width="wrap_content"

                    android:layout_height="wrap_content"

                    android:layout_below="@+id/txte"

                    android:layout_marginLeft="10dp"

                    android:layout_marginRight="10dp"

                    android:gravity="center"

                    android:text="Develop reputation, Ensure financial stability"

                    android:textColor="#000"

                    android:textSize="10dp" />


            </RelativeLayout>



            <LinearLayout

                android:layout_marginTop="10dp"

                android:layout_width="match_parent"

                android:layout_height="wrap_content"

                android:baselineAligned="false"

                android:orientation="horizontal"

                android:weightSum="1">


                <androidx.cardview.widget.CardView

                    android:id="@+id/home_mRide"

                    android:layout_width="0dp"

                    android:layout_height="100dp"

                    android:layout_margin="10dp"

                    android:layout_marginLeft="5dp"

                    android:layout_weight="0.33"

                    android:clickable="true"

                    app:cardCornerRadius="10dp"

                    app:cardElevation="5dp">


                    <RelativeLayout

                        android:layout_width="match_parent"

                        android:layout_height="match_parent"

                        android:background="?attr/selectableItemBackground">


                        <ImageView

                            android:layout_width="90dp"

                            android:layout_height="90dp"

                            android:layout_above="@+id/textView3"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:padding="10dp"

                            android:scaleType="fitCenter"

                            android:src="@drawable/math" />


                        <TextView

                            android:id="@+id/textView3"

                            android:layout_width="wrap_content"

                            android:layout_height="wrap_content"

                            android:layout_alignParentBottom="true"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:maxLines="1"

                            android:text="Math"

                            android:textColor="#000"

                            android:textStyle="bold" />


                    </RelativeLayout>


                </androidx.cardview.widget.CardView>


                <androidx.cardview.widget.CardView

                    android:id="@+id/home_mSend"

                    android:layout_width="0dp"

                    android:layout_height="100dp"

                    android:layout_margin="10dp"

                    android:layout_marginLeft="5dp"

                    android:layout_weight="0.33"

                    android:clickable="true"

                    app:cardCornerRadius="10dp"

                    app:cardElevation="5dp">


                    <RelativeLayout

                        android:layout_width="match_parent"

                        android:layout_height="match_parent"

                        android:background="?attr/selectableItemBackground">


                        <ImageView

                            android:layout_width="90dp"

                            android:layout_height="90dp"

                            android:layout_above="@+id/textView2"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:padding="10dp"

                            android:scaleType="fitCenter"

                            android:src="@drawable/english" />


                        <TextView

                            android:id="@+id/textView2"

                            android:layout_width="wrap_content"

                            android:layout_height="wrap_content"

                            android:layout_alignParentBottom="true"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:maxLines="1"

                            android:text="English"

                            android:textColor="#000"

                            android:textStyle="bold" />


                    </RelativeLayout>


                </androidx.cardview.widget.CardView>


                <androidx.cardview.widget.CardView

                    android:id="@+id/home_mCar"

                    android:layout_width="0dp"

                    android:layout_height="100dp"

                    android:layout_margin="10dp"

                    android:layout_marginLeft="5dp"

                    android:layout_weight="0.33"

                    android:clickable="true"

                    app:cardCornerRadius="10dp"

                    app:cardElevation="5dp">


                    <RelativeLayout

                        android:layout_width="match_parent"

                        android:layout_height="match_parent"

                        android:background="?attr/selectableItemBackground">


                        <ImageView

                            android:layout_width="90dp"

                            android:layout_height="90dp"

                            android:layout_above="@+id/textView6"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:padding="10dp"

                            android:scaleType="fitCenter"

                            android:src="@drawable/science" />


                        <TextView

                            android:id="@+id/textView6"

                            android:layout_width="wrap_content"

                            android:layout_height="wrap_content"

                            android:layout_alignParentBottom="true"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:maxLines="1"

                            android:text="Science"

                            android:textColor="#000"

                            android:textSize="12sp"

                            android:textStyle="bold" />


                    </RelativeLayout>


                </androidx.cardview.widget.CardView>


            </LinearLayout>


            <LinearLayout

                android:layout_width="match_parent"

                android:layout_height="wrap_content"

                android:baselineAligned="false"

                android:orientation="horizontal"

                android:weightSum="1">


                <androidx.cardview.widget.CardView

                    android:layout_width="0dp"

                    android:layout_height="100dp"

                    android:layout_margin="10dp"

                    android:layout_marginLeft="5dp"

                    android:layout_marginTop="10dp"

                    android:layout_weight="0.33"

                    android:clickable="true"

                    app:cardCornerRadius="10dp"

                    app:cardElevation="5dp">


                    <RelativeLayout

                        android:layout_width="match_parent"

                        android:layout_height="match_parent"

                        android:background="?attr/selectableItemBackground">


                        <ImageView

                            android:layout_width="90dp"

                            android:layout_height="90dp"

                            android:layout_above="@+id/textView12"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:padding="10dp"

                            android:scaleType="fitCenter"

                            android:src="@drawable/history" />


                        <TextView

                            android:id="@+id/textView12"

                            android:layout_width="wrap_content"

                            android:layout_height="wrap_content"

                            android:layout_alignParentBottom="true"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:maxLines="1"

                            android:text="S.S.T"

                            android:textColor="#000"

                            android:textSize="12sp"

                            android:textStyle="bold" />


                    </RelativeLayout>


                </androidx.cardview.widget.CardView>


                <androidx.cardview.widget.CardView

                    android:layout_width="0dp"

                    android:layout_height="100dp"

                    android:layout_margin="10dp"

                    android:layout_weight="0.33"

                    android:background="?attr/selectableItemBackground"

                    android:clickable="true"

                    app:cardCornerRadius="10dp"

                    app:cardElevation="5dp">


                    <RelativeLayout

                        android:layout_width="match_parent"

                        android:layout_height="match_parent"

                        android:background="?attr/selectableItemBackground">


                        <ImageView

                            android:layout_width="90dp"

                            android:layout_height="90dp"

                            android:layout_above="@+id/textView18"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:padding="10dp"

                            android:scaleType="fitCenter"

                            android:src="@drawable/notebook" />


                        <TextView

                            android:id="@+id/textView18"

                            android:layout_width="wrap_content"

                            android:layout_height="wrap_content"

                            android:layout_alignParentBottom="true"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:maxLines="1"

                            android:text="Hindi"

                            android:textColor="#000"

                            android:textSize="12sp"

                            android:textStyle="bold" />


                    </RelativeLayout>


                </androidx.cardview.widget.CardView>


                <androidx.cardview.widget.CardView

                    android:layout_width="0dp"

                    android:layout_height="100dp"

                    android:layout_margin="10dp"

                    android:layout_marginLeft="5dp"

                    android:layout_weight="0.33"

                    android:background="?attr/selectableItemBackground"

                    android:clickable="true"

                    app:cardCornerRadius="10dp"

                    app:cardElevation="5dp">


                    <RelativeLayout

                        android:layout_width="match_parent"

                        android:layout_height="match_parent"

                        android:background="?attr/selectableItemBackground">


                        <ImageView

                            android:layout_width="90dp"

                            android:layout_height="90dp"

                            android:layout_above="@+id/textView0"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:padding="10dp"

                            android:scaleType="fitCenter"

                            android:src="@drawable/score" />


                        <TextView

                            android:id="@+id/textView0"

                            android:layout_width="wrap_content"

                            android:layout_height="wrap_content"

                            android:layout_alignParentBottom="true"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:maxLines="1"

                            android:text="Result"

                            android:textColor="#000"

                            android:textSize="12sp"

                            android:textStyle="bold" />


                    </RelativeLayout>


                </androidx.cardview.widget.CardView>


            </LinearLayout>


            <LinearLayout

                android:layout_width="match_parent"

                android:layout_height="wrap_content"

                android:baselineAligned="false"

                android:orientation="horizontal"

                android:weightSum="1">


                <androidx.cardview.widget.CardView

                    android:id="@+id/home_mFood"

                    android:layout_width="0dp"

                    android:layout_height="100dp"

                    android:layout_margin="10dp"

                    android:layout_marginLeft="5dp"

                    android:layout_marginTop="10dp"

                    android:layout_weight="0.33"

                    android:clickable="true"

                    app:cardCornerRadius="10dp"

                    app:cardElevation="5dp">


                    <RelativeLayout

                        android:layout_width="match_parent"

                        android:layout_height="match_parent"

                        android:background="?attr/selectableItemBackground">


                        <ImageView

                            android:layout_width="90dp"

                            android:layout_height="90dp"

                            android:layout_above="@+id/textView21"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:padding="10dp"

                            android:scaleType="fitCenter"

                            android:src="@drawable/question" />


                        <TextView

                            android:id="@+id/textView21"

                            android:layout_width="wrap_content"

                            android:layout_height="wrap_content"

                            android:layout_alignParentBottom="true"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:maxLines="1"

                            android:text="Ask to Question"

                            android:textColor="#000"

                            android:textSize="12sp"

                            android:textStyle="bold" />


                    </RelativeLayout>


                </androidx.cardview.widget.CardView>


                <androidx.cardview.widget.CardView

                    android:id="@+id/home_mLaundry"

                    android:layout_width="0dp"

                    android:layout_height="100dp"

                    android:layout_margin="10dp"

                    android:layout_weight="0.33"

                    android:background="?attr/selectableItemBackground"

                    android:clickable="true"

                    app:cardCornerRadius="10dp"

                    app:cardElevation="5dp">


                    <RelativeLayout

                        android:layout_width="match_parent"

                        android:layout_height="match_parent"

                        android:background="?attr/selectableItemBackground">


                        <ImageView

                            android:layout_width="90dp"

                            android:layout_height="90dp"

                            android:layout_above="@+id/textView23"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:padding="10dp"

                            android:scaleType="fitCenter"

                            android:src="@drawable/file" />


                        <TextView

                            android:id="@+id/textView23"

                            android:layout_width="wrap_content"

                            android:layout_height="wrap_content"

                            android:layout_alignParentBottom="true"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:maxLines="1"

                            android:text="More Details"

                            android:textColor="#000"

                            android:textSize="12sp"

                            android:textStyle="bold" />


                    </RelativeLayout>


                </androidx.cardview.widget.CardView>


                <androidx.cardview.widget.CardView

                    android:id="@+id/home_mBox"

                    android:layout_width="0dp"

                    android:layout_height="100dp"

                    android:layout_margin="10dp"

                    android:layout_marginLeft="5dp"

                    android:layout_weight="0.33"

                    android:background="?attr/selectableItemBackground"

                    android:clickable="true"

                    app:cardCornerRadius="10dp"

                    app:cardElevation="5dp">


                    <RelativeLayout

                        android:layout_width="match_parent"

                        android:layout_height="match_parent"

                        android:background="?attr/selectableItemBackground">


                        <ImageView

                            android:layout_width="90dp"

                            android:layout_height="90dp"

                            android:layout_above="@+id/textView15"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:padding="10dp"

                            android:scaleType="fitCenter"

                            android:src="@drawable/support" />


                        <TextView

                            android:id="@+id/textView15"

                            android:layout_width="wrap_content"

                            android:layout_height="wrap_content"

                            android:layout_alignParentBottom="true"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:maxLines="1"

                            android:text="24*7 Support"

                            android:textColor="#000"

                            android:textSize="12sp"

                            android:textStyle="bold" />


                    </RelativeLayout>


                </androidx.cardview.widget.CardView>


            </LinearLayout>


            <LinearLayout

                android:layout_width="match_parent"

                android:layout_height="wrap_content"

                android:baselineAligned="false"

                android:orientation="horizontal"

                android:weightSum="1">


                <androidx.cardview.widget.CardView

                    android:id="@+id/home_mFood1"

                    android:layout_width="0dp"

                    android:layout_height="100dp"

                    android:layout_margin="10dp"

                    android:layout_marginLeft="5dp"

                    android:layout_marginTop="10dp"

                    android:layout_weight="0.33"

                    android:clickable="true"

                    app:cardCornerRadius="10dp"

                    app:cardElevation="5dp">


                    <RelativeLayout

                        android:layout_width="match_parent"

                        android:layout_height="match_parent"

                        android:background="?attr/selectableItemBackground">


                        <ImageView

                            android:layout_width="90dp"

                            android:layout_height="90dp"

                            android:layout_above="@+id/textView22"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:padding="10dp"

                            android:scaleType="fitCenter"

                            android:src="@drawable/admission" />


                        <TextView

                            android:id="@+id/textView22"

                            android:layout_width="wrap_content"

                            android:layout_height="wrap_content"

                            android:layout_alignParentBottom="true"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:maxLines="1"

                            android:text="Admission status"

                            android:textColor="#000"

                            android:textSize="12sp"

                            android:textStyle="bold" />


                    </RelativeLayout>


                </androidx.cardview.widget.CardView>


                <androidx.cardview.widget.CardView

                    android:id="@+id/home_mLaundry1"

                    android:layout_width="0dp"

                    android:layout_height="100dp"

                    android:layout_margin="10dp"

                    android:layout_weight="0.33"

                    android:background="?attr/selectableItemBackground"

                    android:clickable="true"

                    app:cardCornerRadius="10dp"

                    app:cardElevation="5dp">


                    <RelativeLayout

                        android:layout_width="match_parent"

                        android:layout_height="match_parent"

                        android:background="?attr/selectableItemBackground">


                        <ImageView

                            android:layout_width="90dp"

                            android:layout_height="90dp"

                            android:layout_above="@+id/textView24"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:padding="10dp"

                            android:scaleType="fitCenter"

                            android:src="@drawable/exam" />


                        <TextView

                            android:id="@+id/textView24"

                            android:layout_width="wrap_content"

                            android:layout_height="wrap_content"

                            android:layout_alignParentBottom="true"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:maxLines="1"

                            android:text="Exam From Status"

                            android:textColor="#000"

                            android:textSize="12sp"

                            android:textStyle="bold" />


                    </RelativeLayout>


                </androidx.cardview.widget.CardView>


                <androidx.cardview.widget.CardView

                    android:id="@+id/home_mBox1"

                    android:layout_width="0dp"

                    android:layout_height="100dp"

                    android:layout_margin="10dp"

                    android:layout_marginLeft="5dp"

                    android:layout_weight="0.33"

                    android:background="?attr/selectableItemBackground"

                    android:clickable="true"

                    app:cardCornerRadius="10dp"

                    app:cardElevation="5dp">


                    <RelativeLayout

                        android:layout_width="match_parent"

                        android:layout_height="match_parent"

                        android:background="?attr/selectableItemBackground">


                        <ImageView

                            android:layout_width="90dp"

                            android:layout_height="90dp"

                            android:layout_above="@+id/textView16"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:padding="10dp"

                            android:scaleType="fitCenter"

                            android:src="@drawable/graduated" />


                        <TextView

                            android:id="@+id/textView16"

                            android:layout_width="wrap_content"

                            android:layout_height="wrap_content"

                            android:layout_alignParentBottom="true"

                            android:layout_centerHorizontal="true"

                            android:layout_marginBottom="5dp"

                            android:maxLines="1"

                            android:text="Student Status"

                            android:textColor="#000"

                            android:textSize="12sp"

                            android:textStyle="bold" />


                    </RelativeLayout>


                </androidx.cardview.widget.CardView>


            </LinearLayout>


        </LinearLayout>


    </ScrollView>

</LinearLayout>


Github : https://github.com/LearncodeWithRk/Dashboard-for-Android-App

Post a Comment

0 Comments