Skip to main content
Android UI Design with Kotlin
CHAPTER 14 Beginner

Creating Dashboard and Home Screens

Updated: May 31, 2026
5 min read

# CHAPTER 14

Creating Dashboard and Home Screens

1. Introduction

The Home Screen or Dashboard is the control center of your application. When a user opens your app, they should immediately see the most important information and have quick access to core features. A poorly designed dashboard overwhelms the user; a well-designed one guides them effortlessly. In this chapter, we will learn how to structure data-heavy screens using a combination of Cards, Grids, and typography.

2. Learning Objectives

By the end of this chapter, you will be able to:
  • Identify the core components of a modern dashboard.
  • Design statistics and summary widgets.
  • Use GridLayout and RecyclerView to create dashboard grids.
  • Implement a cohesive visual hierarchy.
  • Build a Finance Dashboard UI.

3. Dashboard Architecture

A typical modern dashboard consists of three main sections:
  1. 1. The Greeting/Header: A personalized welcome (e.g., "Good morning, Jane!") accompanied by a profile picture or notification icon.
  1. 2. The Summary/Hero Widget: The most important piece of data. In a banking app, this is the total account balance. In a fitness app, it's the daily step count.
  1. 3. The Action Grid / Quick Links: A grid of cards or buttons providing quick access to features (e.g., Transfer Money, Pay Bills, History).

4. Designing Statistics Widgets

A statistics widget should be clean and use typography to establish hierarchy. The number should be large, and the label should be small and muted.
xml
12345678910111213141516171819202122232425262728293031323334
<com.google.android.material.card.MaterialCardView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:cardCornerRadius="16dp"
    app:cardElevation="4dp"
    android:backgroundTint="?attr/colorPrimary">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="24dp"
        android:gravity="center">

        <!-- Label -->
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Total Balance"
            android:textColor="#E0E0E0"
            android:textSize="14sp" />

        <!-- Huge Number -->
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="$12,450.00"
            android:textColor="#FFFFFF"
            android:textSize="36sp"
            android:textStyle="bold"
            android:layout_marginTop="8dp"/>
            
    </LinearLayout>
</com.google.android.material.card.MaterialCardView>

5. Creating Action Grids

For the Quick Links section, you have two options:
  1. 1. Static Grid: If you have exactly 4 or 6 fixed options, you can use a GridLayout or standard ConstraintLayout to manually place the cards.
  1. 2. Dynamic Grid: If the options can change, use a RecyclerView with a GridLayoutManager.

For dashboards, MaterialCardView is the perfect container for these grid items. A standard dashboard card contains an Icon (centered) and a short Label directly beneath it.

6. Mini Project: Finance Dashboard UI

Let's assemble a beautiful Finance Dashboard layout.
xml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#F8F9FA">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="20dp">

        <!-- Greeting -->
        <TextView
            android:id="@+id/greetingText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Hello, Alex"
            android:textSize="24sp"
            android:textStyle="bold"
            android:textColor="#212121"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintStart_toStartOf="parent" />

        <!-- Notification Icon -->
        <ImageView
            android:id="@+id/notifIcon"
            android:layout_width="32dp"
            android:layout_height="32dp"
            android:src="@drawable/ic_bell"
            app:layout_constraintTop_toTopOf="@+id/greetingText"
            app:layout_constraintBottom_toBottomOf="@+id/greetingText"
            app:layout_constraintEnd_toEndOf="parent" />

        <!-- Main Balance Card (Use the XML from Section 4 here) -->
        <include layout="@layout/widget_balance_card"
            android:id="@+id/balanceCard"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="24dp"
            app:layout_constraintTop_toBottomOf="@+id/greetingText" />

        <!-- Section Title -->
        <TextView
            android:id="@+id/servicesTitle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Quick Services"
            android:textSize="18sp"
            android:textStyle="bold"
            android:layout_marginTop="32dp"
            app:layout_constraintTop_toBottomOf="@+id/balanceCard"
            app:layout_constraintStart_toStartOf="parent" />

        <!-- Action Grid (Using a static GridLayout for 4 items) -->
        <GridLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:columnCount="2"
            android:rowCount="2"
            android:layout_marginTop="16dp"
            app:layout_constraintTop_toBottomOf="@+id/servicesTitle">

            <!-- Card 1: Send Money -->
            <com.google.android.material.card.MaterialCardView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_columnWeight="1"
                android:layout_margin="8dp"
                app:cardElevation="2dp"
                app:cardCornerRadius="12dp">
                
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:gravity="center"
                    android:padding="20dp">
                    <ImageView android:layout_width="40dp" android:layout_height="40dp" android:src="@drawable/ic_send" />
                    <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Send" android:layout_marginTop="8dp" />
                </LinearLayout>
            </com.google.android.material.card.MaterialCardView>

            <!-- Repeat for Receive, Bills, and Top-Up -->
            <!-- ... -->

        </GridLayout>
    </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>

7. Design Principles

  • Visual Hierarchy: The user's eye should naturally go to the most important thing first (the large balance number), then the secondary actions.
  • Whitespace: Dashboards can easily become cluttered. Use generous padding (16dp to 24dp) between sections to let the UI breathe.
  • Scrollability: Always wrap your dashboard ConstraintLayout inside a NestedScrollView or ScrollView. Even if it fits on your screen, it might get cut off on a smaller phone.

8. Common Mistakes

  • Information Overload: Trying to fit every single feature of the app onto the home screen. Use the dashboard for summaries and quick actions, and let the user navigate deeper for details.
  • Inconsistent Card Heights: In a grid, if one card's text wraps to two lines, it might make that card taller than its neighbor, breaking the clean grid look. Fix this by using layout_rowWeight or setting fixed heights for cards.

9. Best Practices

  • Use a slight off-white or very light gray background for the screen (like #F8F9FA), and pure white #FFFFFF for the Cards. This subtle contrast makes the cards "pop" much better than placing white cards on a white background.

10. Exercises

  1. 1. Replace the static GridLayout in the mini-project with a RecyclerView. Write the Adapter and set up a GridLayoutManager(context, 2) in your Kotlin code.
  1. 2. Add a "Recent Transactions" section below the Quick Services grid. It should contain a small vertical list of two items.

11. UI Design Challenges

Challenge: Design a dashboard for a Fitness Tracking App. The top widget should be a circular progress indicator showing Steps Taken. Below it, a horizontal row of three small cards showing Calories, Distance, and Active Minutes.

12. MCQ Quiz with Answers

Question 1

Why should the main content of a Dashboard usually be wrapped in a ScrollView or NestedScrollView?

Question 2

When designing a summary widget (like a total balance), how do you establish a strong visual hierarchy?

13. Interview Questions

  • Q: When building a dashboard grid, when would you choose a static GridLayout versus a RecyclerView with a GridLayoutManager?
  • Q: How does background contrast affect the perception of Elevation on MaterialCardViews?

14. FAQs

Q: My dashboard has a RecyclerView for a vertical list of transactions, but it's inside a NestedScrollView, and scrolling is glitchy. Why? A: Nesting a scrollable view inside another scrollable view causes scroll conflicts. The modern solution is to use a single RecyclerView with multiple ItemViewTypes (one type for the header widget, one for the grid, one for the list items) instead of using a NestedScrollView.

15. Summary

A beautiful dashboard sets the tone for your entire application. By combining strong typography, structured grids, and elevated cards against a subtle background, we created a dashboard that is both highly functional and aesthetically pleasing.

16. Next Chapter Recommendation

Our app looks great in the day, but what happens when the user opens it in bed at 2 AM? Blinding them with a white dashboard is bad UX. In Chapter 15: Dark Mode and Theme Customization, we will learn how to seamlessly adapt our UI for Dark Theme.

Finish this Chapter

Save your progress on your learning path and prepare for coding interview challenges.

Discussion

Join the discussion

Log in or create a free account to participate.

Sort: ·