
Dashboard Design Android Studio is the main attraction of any mobile app. It should be attractive as well as user friendly also. In this tutorial i am going to show how you can build a dashboard which is clean and user friendly.
Creating New Android Project (Dashboard Design Android Studio)
- Create a new project in Android Studio File–>New–>New Project.
- Enter Application Name, Package Name, Select Empty Activity and click on finish.
Add Colors
- Open App–>values–>colors.xml
- Specify colors which we are going to use in app.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="colorPrimary">#e74c3c</color> <color name="colorPrimaryDark">#ec7063</color> <color name="colorAccent">#f93283</color> <color name="purple">#7c4dff</color> <color name="yellow">#ffb300</color> <color name="green">#00bfa5</color> <color name="darkblue">#2980b9</color> <color name="darkpurple">#a569bd</color> <color name="pinky">#fe104d</color> <color name="lightgray">#808080</color> </resources> |
Add Cardview Library
- Open build.gradle(Module:app) and add Cardview Library.
1 2 3 4 5 |
dependencies { compile 'com.android.support:cardview-v7:26.0.0' } |
Add Vector Drawable
- Add vector drawable which we are going to use in our project.
- Right click on Drawable folder then New–>Vector Asset.
- click on Icon then Select Icon and add it to on drawable folder.
- You can change color of vector drawable. To change color open that drawable and change FillColor value.
Lets Design Dashboard
- Open activity.xml file and put add following code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="10dp" android:background="#FCFCFC"> <ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <LinearLayout android:clipToPadding="false" android:gravity="center" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v7.widget.CardView android:foreground="?android:attr/selectableItemBackground" android:clickable="true" android:id="@+id/bankcardId" android:layout_width="160dp" android:layout_height="190dp" android:layout_margin="10dp" android:padding="0dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="130dp" android:gravity="center" android:background="@color/green"> <ImageView android:layout_width="64dp" android:layout_height="64dp" android:src="@drawable/ic_phone_android_black_24dp" android:padding="10dp"/> </LinearLayout> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Mobile" android:textColor="#000" android:textSize="18dp" /> <View android:layout_width="match_parent" android:layout_height="1dp" android:background="@color/lightgray" android:layout_margin="2dp"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="New range of mobile" android:textColor="@android:color/darker_gray"/> </LinearLayout> </android.support.v7.widget.CardView> <android.support.v7.widget.CardView android:foreground="?android:attr/selectableItemBackground" android:clickable="true" android:id="@+id/bankcardId1" android:layout_width="160dp" android:layout_height="190dp" android:layout_margin="10dp" android:padding="0dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="130dp" android:gravity="center" android:background="@color/purple"> <ImageView android:layout_width="64dp" android:layout_height="64dp" android:padding="10dp" android:src="@drawable/ic_attach_money_black_24dp" /> </LinearLayout> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Recharge" android:textColor="#000" android:textSize="18dp" /> <View android:layout_width="match_parent" android:layout_height="1dp" android:background="@color/lightgray" android:layout_margin="2dp"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Exciting offers inside" android:textColor="@android:color/darker_gray"/> </LinearLayout> </android.support.v7.widget.CardView> </LinearLayout> <LinearLayout android:clipToPadding="false" android:gravity="center" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v7.widget.CardView android:foreground="?android:attr/selectableItemBackground" android:clickable="true" android:id="@+id/bankcardId2" android:layout_width="160dp" android:layout_height="190dp" android:layout_margin="10dp" android:padding="0dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="130dp" android:gravity="center" android:background="@color/yellow"> <ImageView android:layout_width="64dp" android:layout_height="64dp" android:padding="10dp" android:src="@drawable/ic_directions_bus_black_24dp" /> </LinearLayout> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Bus" android:textColor="#000" android:textSize="18dp" /> <View android:layout_width="match_parent" android:layout_height="1dp" android:background="@color/lightgray" android:layout_margin="2dp"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Cashback upto 50%" android:textColor="@android:color/darker_gray"/> </LinearLayout> </android.support.v7.widget.CardView> <android.support.v7.widget.CardView android:foreground="?android:attr/selectableItemBackground" android:clickable="true" android:id="@+id/bankcardId3" android:layout_width="160dp" android:layout_height="190dp" android:layout_margin="10dp" android:padding="0dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="130dp" android:gravity="center" android:background="@color/pinky"> <ImageView android:layout_width="64dp" android:layout_height="64dp" android:padding="10dp" android:src="@drawable/ic_attach_money_black_24dp" /> </LinearLayout> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Train" android:textColor="#000" android:textSize="18dp" /> <View android:layout_width="match_parent" android:layout_height="1dp" android:background="@color/lightgray" android:layout_margin="2dp"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Get discount upto 20%" android:textColor="@android:color/darker_gray"/> </LinearLayout> </android.support.v7.widget.CardView> </LinearLayout> <LinearLayout android:clipToPadding="false" android:gravity="center" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content"> <android.support.v7.widget.CardView android:foreground="?android:attr/selectableItemBackground" android:clickable="true" android:id="@+id/bankcardId5" android:layout_width="160dp" android:layout_height="190dp" android:layout_margin="10dp" android:padding="0dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="130dp" android:gravity="center" android:background="@color/darkblue"> <ImageView android:layout_width="64dp" android:layout_height="64dp" android:src="@drawable/ic_arrow_downward_black_24dp" android:padding="10dp"/> </LinearLayout> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Send" android:textColor="#000" android:textSize="18dp" /> <View android:layout_width="match_parent" android:layout_height="1dp" android:background="@color/lightgray" android:layout_margin="2dp"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Send money" android:textColor="@android:color/darker_gray" /> </LinearLayout> </android.support.v7.widget.CardView> <android.support.v7.widget.CardView android:foreground="?android:attr/selectableItemBackground" android:clickable="true" android:id="@+id/bankcardId4" android:layout_width="160dp" android:layout_height="190dp" android:layout_margin="10dp" android:padding="0dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="130dp" android:gravity="center" android:background="@color/darkpurple"> <ImageView android:layout_width="64dp" android:layout_height="64dp" android:padding="10dp" android:src="@drawable/ic_arrow_upward_black_24dp" /> </LinearLayout> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Receive" android:textColor="#000" android:textSize="18dp" /> <View android:layout_width="match_parent" android:layout_height="1dp" android:background="@color/lightgray" android:layout_margin="2dp"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Receive money" android:textColor="@android:color/darker_gray" /> </LinearLayout> </android.support.v7.widget.CardView> </LinearLayout> </LinearLayout> </ScrollView> </RelativeLayout> |
That’s it run your project.
Download Complete Project
Android Dashboard Design Using Android Studio Complete Project
Subscribe To Our YouTube Channel
Like Us On Facebook
Thats great Admin.. Thank You for helpful posts.