Android Learning

Design Stylish Home Dashboard UI In Android

A Cool Dashboard For your Home Activity Must be Cool so that it will attract your users. You can design your own home dashboard activity in any existing android studio project or in new one easily after getting this tutorial.

A Cool Dashboard For your Home Activity Must be Cool so that it will attract your users. A Stylish Home Activity UI Will Catch More New Users toward your Android App and Easily you will get A Number of Downloads of your app. You can design your own home dashboard activity in any existing android studio project or in new one easily after getting this tutorial.

First of all, Create A new Android Studio Project if you don’t know how to create first app in android studio Click Here to Learn

After successful sync you will see MainActivity.java and activity_main.xml, First of all, create 2 drawable button: as shown in the below screenshot:

Create Drawable Buttons

Name it as border then add below code into this:

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <corners
        android:topLeftRadius="30dp"
        android:topRightRadius="0dp"
        android:bottomRightRadius="30dp"
        android:bottomLeftRadius="0dp" />
    <stroke
        android:width="5dp"
        android:color="@color/purple_500" />
</shape>

Then create another drawable and name it as button and then add the below code into this:

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <corners
        android:topLeftRadius="0dp"
        android:topRightRadius="30dp"
        android:bottomRightRadius="0dp"
        android:bottomLeftRadius="30dp" />
    <stroke
        android:width="5dp"
        android:color="#0091EA" />
</shape>

Then these 2 drawable button will look like below screenshot:

Create Drawable

Then Add Below code into you activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_gravity="center"
    android:gravity="center"
    android:padding="20sp">
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Choose Dashboard UI"
        android:gravity="center_horizontal"
        android:paddingTop="25sp"
        android:textColor="#F40909"
        android:textStyle="bold"
        android:paddingBottom="20sp"
        android:textSize="25sp" />
        <LinearLayout
            android:orientation="vertical"
            android:background="@drawable/border"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="20sp">
            <Button
                android:id="@+id/dashoardBlack"
                android:text="Black  Home"
                android:textSize="20sp"
                android:background="@drawable/border"
                android:layout_marginTop="20sp"
                android:layout_gravity="center"
                android:layout_width="250dp"
                android:layout_height="60dp"/>

            <Button
                android:id="@+id/dashboardLite"
                android:text="Lite  Home"
                android:textSize="20sp"
                android:background="@drawable/button"
                android:layout_marginTop="20sp"
                android:layout_gravity="center"
                android:layout_width="250dp"
                android:layout_marginBottom="20dp"
                android:layout_height="60dp"/>
        </LinearLayout>
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:textColor="@color/black"
        android:layout_marginTop="10dp"
        android:gravity="center"
        android:id="@+id/login_instructions"
        android:text="Download more free source code : \n www.nulledsourcecode.com" />

</LinearLayout>

finally activity_main.xml will look like the below screenshot:

Button Activity

Then add the below code into your MainActivity.java file

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

/*
Created By: https://nulledsourcecode.com/
Contact us for Android App Reskin, Customization, Making Nulled, Server Setup, web hosting  etc.
 */
public class MainActivity extends AppCompatActivity{

        @Override
        protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.activity_main);

                Button dl = (Button) findViewById(R.id.dashboardLite);
                Button db = (Button) findViewById(R.id.dashoardBlack);
                db.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {
                                Toast.makeText(MainActivity.this, "Dashboard Black Successful", Toast.LENGTH_SHORT).show();
                                Intent intent = new Intent(MainActivity.this, DashboardActivityBlack.class);
                                startActivity(intent);
                        }
                });
                dl.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {
                                Toast.makeText(MainActivity.this, "Dashboard Lite Successful", Toast.LENGTH_SHORT).show();
                                Intent intent = new Intent(MainActivity.this, DashboardLite.class);
                                startActivity(intent);
                        }
                });
        }
/*
Created By: https://nulleds45ourcecode.com/
Contact us for Android App Reskin, Customization, Making Nulled, Server Setup etc.
 */
}

Now you Main Activity is configured Successfully.

Now goto File Menu > New > Activity > Empty Activity

Name it DashboardLite then add the below code into your activity_dashboard_lite.xml file:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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="#0091EA"
    tools:context=".MainActivity">

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

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Cool Lite Home UI"
            android:fontFamily="@font/sans_bold"
            android:textSize="24sp"
            android:textColor="@color/white"
            android:layout_margin="5dp"/>


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

            <LinearLayout
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:gravity="center">

                <androidx.cardview.widget.CardView
                    android:id="@+id/profile"
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="150dp"
                    app:cardCornerRadius="12dp"
                    app:cardElevation="5dp"
                    app:cardBackgroundColor="@color/white"
                    android:layout_margin="10dp">

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

                        <ImageView
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:src="@drawable/ic_profile"
                            android:layout_marginTop="18dp"/>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="My Profile"
                            android:fontFamily="@font/sans_bold"
                            android:textSize="18sp"
                            android:textColor="@color/red"
                            android:layout_marginTop="20dp"/>

                    </LinearLayout>

                </androidx.cardview.widget.CardView>

                <androidx.cardview.widget.CardView
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="150dp"
                    app:cardCornerRadius="12dp"
                    app:cardElevation="5dp"
                    app:cardBackgroundColor="@color/white"
                    android:layout_margin="10dp">

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

                        <ImageView
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:src="@drawable/ic_coins"
                            android:layout_marginTop="18dp"/>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="My Earning"
                            android:fontFamily="@font/sans_bold"
                            android:textSize="18sp"
                            android:textColor="@color/red"
                            android:layout_marginTop="20dp"/>

                    </LinearLayout>

                </androidx.cardview.widget.CardView>
            </LinearLayout>
            <LinearLayout
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:gravity="center">
                <androidx.cardview.widget.CardView
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="150dp"
                    app:cardCornerRadius="12dp"
                    app:cardElevation="5dp"
                    app:cardBackgroundColor="@color/white"
                    android:layout_margin="10dp">

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

                        <ImageView
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:src="@drawable/ic_gift"
                            android:layout_marginTop="18dp"/>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="Reward"
                            android:fontFamily="@font/sans_bold"
                            android:textSize="18sp"
                            android:textColor="@color/red"
                            android:layout_marginTop="20dp"/>

                    </LinearLayout>

                </androidx.cardview.widget.CardView>

                <androidx.cardview.widget.CardView
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="150dp"
                    app:cardCornerRadius="12dp"
                    app:cardElevation="5dp"
                    app:cardBackgroundColor="@color/white"
                    android:layout_margin="10dp">

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

                        <ImageView
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:src="@drawable/ic_tips"
                            android:layout_marginTop="18dp"/>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="Tips"
                            android:fontFamily="@font/sans_bold"
                            android:textSize="18sp"
                            android:textColor="@color/red"
                            android:layout_marginTop="20dp"/>

                    </LinearLayout>

                </androidx.cardview.widget.CardView>
            </LinearLayout>
            <LinearLayout
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:gravity="center">
                <androidx.cardview.widget.CardView
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="150dp"
                    app:cardCornerRadius="12dp"
                    app:cardElevation="5dp"
                    app:cardBackgroundColor="@color/white"
                    android:layout_margin="10dp">

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

                        <ImageView
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:src="@drawable/ic_videos"
                            android:layout_marginTop="18dp"/>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="Videos"
                            android:fontFamily="@font/sans_bold"
                            android:textSize="18sp"
                            android:textColor="@color/red"
                            android:layout_marginTop="20dp"/>

                    </LinearLayout>

                </androidx.cardview.widget.CardView>

                <androidx.cardview.widget.CardView
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="150dp"
                    app:cardCornerRadius="12dp"
                    app:cardElevation="5dp"
                    app:cardBackgroundColor="@color/white"
                    android:layout_margin="10dp">

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

                        <ImageView
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:src="@drawable/ic_download"
                            android:layout_marginTop="18dp"/>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="Downloads"
                            android:fontFamily="@font/sans_bold"
                            android:textSize="18sp"
                            android:textColor="@color/red"
                            android:layout_marginTop="20dp"/>

                    </LinearLayout>

                </androidx.cardview.widget.CardView>
            </LinearLayout>
            <LinearLayout
                android:orientation="horizontal"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_weight="1"
                android:gravity="center">

                <androidx.cardview.widget.CardView
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="150dp"
                    app:cardCornerRadius="12dp"
                    app:cardElevation="5dp"
                    app:cardBackgroundColor="@color/white"
                    android:layout_margin="10dp">

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

                        <ImageView
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:src="@drawable/ic_settings"
                            android:layout_marginTop="18dp"/>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="Settings"
                            android:fontFamily="@font/sans_bold"
                            android:textSize="18sp"
                            android:textColor="@color/red"
                            android:layout_marginTop="20dp"/>

                    </LinearLayout>

                </androidx.cardview.widget.CardView>

                <androidx.cardview.widget.CardView
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="150dp"
                    app:cardCornerRadius="12dp"
                    app:cardElevation="5dp"
                    app:cardBackgroundColor="@color/white"
                    android:layout_margin="10dp">

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

                        <ImageView
                            android:layout_width="70dp"
                            android:layout_height="70dp"
                            android:src="@drawable/ic_baseline_stars_24"
                            android:layout_marginTop="18dp"/>

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="Rate us"
                            android:fontFamily="@font/sans_bold"
                            android:textSize="18sp"
                            android:textColor="@color/red"
                            android:layout_marginTop="20dp"/>

                    </LinearLayout>

                </androidx.cardview.widget.CardView>
            </LinearLayout>

        </LinearLayout>
        
    </LinearLayout>
</ScrollView>

It will look like the below screenshot:

Lite Dasboard Activity

For you Next Activity Please add the below java code into your DashboardLite.java:

import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

public class DashboardLite extends AppCompatActivity {
        private CardView profile;

/*
Created By: https://nulledsourcecode.com/
Contact us for Android App Reskin, Customization, Making Nulled, Server Setup etc.
*/
        @Override
        protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.activity_dashboard_lite);
                profile = findViewById(R.id.profile);
                profile.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {
                                Toast.makeText(DashboardLite.this, "Profile Loading...", Toast.LENGTH_SHORT).show();
                                Intent intent = new Intent(DashboardLite.this, ProfileActivity.class);
                                startActivity(intent);
                        }
                });
        }
}

Now your Dashboard Lite Activity is fully created.

Now create Dashboard Black Theme Activity, To Create New Empty Activity you may go to: File Menu > New > Activity > Empty Activity and name it as DashboardActivityBlack

Add the below code into your DashboardActivityBlack.java

import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

public class DashboardActivityBlack extends AppCompatActivity {
        private CardView profile;

/*
Created By: https://nulledsourcecode.com/
Contact us for Android App Reskin, Customization, Making Nulled, Server Setup, web hosting etc.
*/

        @Override
        protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.activity_dashboard_black);
                profile = findViewById(R.id.profile);
                profile.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View view) {
                                Toast.makeText(DashboardActivityBlack.this, "Profile Loading...", Toast.LENGTH_SHORT).show();
                                Intent intent = new Intent(DashboardActivityBlack.this, ProfileActivity.class);
                                startActivity(intent);
                        }
                });
        }
}

Now add the below code into your activity_dashboard_black.xml file:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView 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="@color/black"
    tools:context=".MainActivity">

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

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Cool Black Home UI"
            android:fontFamily="@font/sans_bold"
            android:textSize="24sp"
            android:textColor="@color/white"
            android:layout_margin="5dp"/>

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

           <LinearLayout
               android:orientation="horizontal"
               android:layout_width="match_parent"
               android:layout_height="0dp"
               android:layout_weight="1"
               android:gravity="center">

            <androidx.cardview.widget.CardView
                android:id="@+id/profile"
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="150dp"
                app:cardCornerRadius="12dp"
                app:cardElevation="5dp"
                app:cardBackgroundColor="@color/gray"
                android:layout_margin="10dp">

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

                    <ImageView
                        android:layout_width="70dp"
                        android:layout_height="70dp"
                        android:src="@drawable/ic_profile"
                        android:layout_marginTop="18dp"/>

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="My Profile"
                        android:fontFamily="@font/sans_bold"
                        android:textSize="18sp"
                        android:textColor="@color/white"
                        android:layout_marginTop="20dp"/>

                </LinearLayout>

            </androidx.cardview.widget.CardView>

            <androidx.cardview.widget.CardView
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="150dp"
                app:cardCornerRadius="12dp"
                app:cardElevation="5dp"
                app:cardBackgroundColor="@color/gray"
                android:layout_margin="10dp">

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

                    <ImageView
                        android:layout_width="70dp"
                        android:layout_height="70dp"
                        android:src="@drawable/ic_coins"
                        android:layout_marginTop="18dp"/>

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="My Earning"
                        android:fontFamily="@font/sans_bold"
                        android:textSize="18sp"
                        android:textColor="@color/white"
                        android:layout_marginTop="20dp"/>

                </LinearLayout>

            </androidx.cardview.widget.CardView>
           </LinearLayout>
           <LinearLayout
               android:orientation="horizontal"
               android:layout_width="match_parent"
               android:layout_height="0dp"
               android:layout_weight="1"
               android:gravity="center">
            <androidx.cardview.widget.CardView
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="150dp"
                app:cardCornerRadius="12dp"
                app:cardElevation="5dp"
                app:cardBackgroundColor="@color/gray"
                android:layout_margin="10dp">

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

                    <ImageView
                        android:layout_width="70dp"
                        android:layout_height="70dp"
                        android:src="@drawable/ic_gift"
                        android:layout_marginTop="18dp"/>

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Reward"
                        android:fontFamily="@font/sans_bold"
                        android:textSize="18sp"
                        android:textColor="@color/white"
                        android:layout_marginTop="20dp"/>

                </LinearLayout>

            </androidx.cardview.widget.CardView>

            <androidx.cardview.widget.CardView
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="150dp"
                app:cardCornerRadius="12dp"
                app:cardElevation="5dp"
                app:cardBackgroundColor="@color/gray"
                android:layout_margin="10dp">

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

                    <ImageView
                        android:layout_width="70dp"
                        android:layout_height="70dp"
                        android:src="@drawable/ic_tips"
                        android:layout_marginTop="18dp"/>

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Tips"
                        android:fontFamily="@font/sans_bold"
                        android:textSize="18sp"
                        android:textColor="@color/white"
                        android:layout_marginTop="20dp"/>

                </LinearLayout>

            </androidx.cardview.widget.CardView>
           </LinearLayout>
           <LinearLayout
               android:orientation="horizontal"
               android:layout_width="match_parent"
               android:layout_height="0dp"
               android:layout_weight="1"
               android:gravity="center">
            <androidx.cardview.widget.CardView
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="150dp"
                app:cardCornerRadius="12dp"
                app:cardElevation="5dp"
                app:cardBackgroundColor="@color/gray"
                android:layout_margin="10dp">

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

                    <ImageView
                        android:layout_width="70dp"
                        android:layout_height="70dp"
                        android:src="@drawable/ic_videos"
                        android:layout_marginTop="18dp"/>

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Videos"
                        android:fontFamily="@font/sans_bold"
                        android:textSize="18sp"
                        android:textColor="@color/white"
                        android:layout_marginTop="20dp"/>

                </LinearLayout>

            </androidx.cardview.widget.CardView>

            <androidx.cardview.widget.CardView
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="150dp"
                app:cardCornerRadius="12dp"
                app:cardElevation="5dp"
                app:cardBackgroundColor="@color/gray"
                android:layout_margin="10dp">

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

                    <ImageView
                        android:layout_width="70dp"
                        android:layout_height="70dp"
                        android:src="@drawable/ic_download"
                        android:layout_marginTop="18dp"/>

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Downloads"
                        android:fontFamily="@font/sans_bold"
                        android:textSize="18sp"
                        android:textColor="@color/white"
                        android:layout_marginTop="20dp"/>

                </LinearLayout>

            </androidx.cardview.widget.CardView>
           </LinearLayout>
           <LinearLayout
               android:orientation="horizontal"
               android:layout_width="match_parent"
               android:layout_height="0dp"
               android:layout_weight="1"
               android:gravity="center">

            <androidx.cardview.widget.CardView
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="150dp"
                app:cardCornerRadius="12dp"
                app:cardElevation="5dp"
                app:cardBackgroundColor="@color/gray"
                android:layout_margin="10dp">

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

                    <ImageView
                        android:layout_width="70dp"
                        android:layout_height="70dp"
                        android:src="@drawable/ic_settings"
                        android:layout_marginTop="18dp"/>

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Settings"
                        android:fontFamily="@font/sans_bold"
                        android:textSize="18sp"
                        android:textColor="@color/white"
                        android:layout_marginTop="20dp"/>

                </LinearLayout>

            </androidx.cardview.widget.CardView>

            <androidx.cardview.widget.CardView
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="150dp"
                app:cardCornerRadius="12dp"
                app:cardElevation="5dp"
                app:cardBackgroundColor="@color/gray"
                android:layout_margin="10dp">

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

                    <ImageView
                        android:layout_width="70dp"
                        android:layout_height="70dp"
                        android:src="@drawable/ic_baseline_stars_24"
                        android:layout_marginTop="18dp"/>

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Rate us"
                        android:fontFamily="@font/sans_bold"
                        android:textSize="18sp"
                        android:textColor="@color/white"
                        android:layout_marginTop="20dp"/>
                </LinearLayout>
            </androidx.cardview.widget.CardView>
           </LinearLayout>
       </LinearLayout>
    </LinearLayout>
</ScrollView>

Now it will look like the below screenshot:

Black Theme Home UI Dashboard

If you want to go another activity on click card view, from home Dashaboard activity. Then you must create separate empty activity, for each card view onclick method. You can create A New Activity Follow: File Menu > New > Activity > Empty Activity and Name it as ProfileActivity. Now add the below code into activity_profile.xml file

<?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:layout_gravity="center"
    android:gravity="center"
    android:orientation="vertical"
    tools:context=".ProfileActivity">

    <ImageView
        android:layout_width="150dp"
        android:layout_height="150dp"
        android:src="@drawable/ic_profile">

    </ImageView>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="This is my Profile Activity"
        android:textStyle="bold"
        android:textColor="@color/red"
        android:gravity="center"
        android:textSize="20sp">

    </TextView>

</LinearLayout>

Now your Project is ready you can run it from Android Studio to your virtual device or in a real device. if you need free source code then you can download it from the below download link.

Error Solution:

You will see some error in xml file for color then add the below color code into your project. res > values > color.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="purple_200">#2d2d2d</color>
    <color name="purple_500">#FF000000</color>
    <color name="purple_700">#FF000000</color>
    <color name="teal_200">#16EF70</color>
    <color name="teal_700">#FF018786</color>
    <color name="black">#FF000000</color>
    <color name="white">#FFFFFFFF</color>
    <color name="red">#F40909</color>
    <color name="blue">#0091EA</color>
    <color name="textColor">#8C8787</color>
    <color name="colorPrimaryDark">#00574B</color>
    <color name="gray">#2d2d2d</color>
    <color name="background">#FFFFFF</color>
    <color name="colorAccent">#D81B60</color>
</resources>

Now you will see some drawable error in activity_dashboard_black.xml and activity_dashboard_lite.xml, then you can create your icons from Android Studio Free.

To create your icons goto Android Studio > File Menu > New >Vector Assets as shown in the below screenshot

Create new vector assets or icons
Create Vector icons in Android Studio Free With High Quality

Now add create icons one by one for your home dashboard activity and put these to show in CardView.

Download

Leave a Comment