https://www.viralandroid.com/2016/02/dashboard-ui-design-for-android-app.html
In this tutorial, you will learn to create a material design dashboard for android application with progressing status. Making dashboard user interface is not much difficult in android but making actual working dashboard is not easy. In this dashboard I have used ProgressBar to show progress activity.
Here I have created two different XML files in drawable folder to make circular progress using ProgressBar and I have added RelativeLayout, LinearLayout, ProgressBar, TextView, ScrollView, etc in XML layout file with different attributes.
Related:
Android Material Design Login Form XML UI Design
Android Progress Bar Example
Android Custom Vertical Dropdown Icons Menu
Let’s start by creating new android project with project name: Dashboard UI Design For Android.
Firstly, add the following color values in your project res/values/colors.xml file.
res/values/colors.xml
Now, create two XML files in drawable folder of your project to make circular progress bar. Following is the complete content of two XML files of drawable folder.
res/drawable/ circular_progress_bar.xml
res/drawable/ circle_shape.xml
In XML layout file I have added different RelativeLayout, LinearLayout, ProgressBar, TextView etc. Following is the complete content of XML layout file.
res/layout/ dashboard_xml_ui_design.xml
Following is the complete code of java activity file.
src/ DashboardForAndroidApp.java
res/values/strings.xml
Now, run your Dashboard UI Design for Android application, you will see four different progresses for different topics: storage, battery, RAM, performance in progress bar.
In this tutorial, you will learn to create a material design dashboard for android application with progressing status. Making dashboard user interface is not much difficult in android but making actual working dashboard is not easy. In this dashboard I have used ProgressBar to show progress activity.
Here I have created two different XML files in drawable folder to make circular progress using ProgressBar and I have added RelativeLayout, LinearLayout, ProgressBar, TextView, ScrollView, etc in XML layout file with different attributes.
Related:
Android Material Design Login Form XML UI Design
Android Progress Bar Example
Android Custom Vertical Dropdown Icons Menu
Android Example: Material Design Dashboard UI Design for Android App
Let’s start by creating new android project with project name: Dashboard UI Design For Android.
Firstly, add the following color values in your project res/values/colors.xml file.
res/values/colors.xml
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<color name="colorPrimary">#009688</color> | |
<color name="colorPrimaryDark">#00796B</color> | |
<color name="colorAccent">#FF4081</color> | |
<color name="light_black">#504f4f</color> | |
<color name="black">#000000</color> | |
<color name="blue">#0737d4</color> | |
</resources> |
Now, create two XML files in drawable folder of your project to make circular progress bar. Following is the complete content of two XML files of drawable folder.
res/drawable/ circular_progress_bar.xml
<?xml version="1.0" encoding="utf-8"?> | |
<shape | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:innerRadiusRatio="2.3" | |
android:shape="ring" | |
android:thickness="5dp" | |
android:useLevel="true"> | |
<solid android:color="@color/colorPrimary" /> | |
</shape> |
res/drawable/ circle_shape.xml
<?xml version="1.0" encoding="utf-8"?> | |
<shape | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="ring" | |
android:innerRadiusRatio="2.5" | |
android:thickness="1dp" | |
android:useLevel="false"> | |
<solid android:color="#CCC" /> | |
</shape> |
XML Layout File
In XML layout file I have added different RelativeLayout, LinearLayout, ProgressBar, TextView etc. Following is the complete content of XML layout file.
res/layout/ dashboard_xml_ui_design.xml
<?xml version="1.0" encoding="utf-8"?> | |
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="#ddd"> | |
<LinearLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:orientation="vertical" | |
android:padding="10dp"> | |
<LinearLayout | |
android:layout_width="fill_parent" | |
android:layout_height="wrap_content" | |
android:orientation="horizontal" | |
android:paddingBottom="10dp"> | |
<LinearLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_weight="1" | |
android:background="#fff" | |
android:gravity="center_horizontal" | |
android:orientation="vertical"> | |
<RelativeLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content"> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_centerHorizontal="true" | |
android:layout_marginTop="16dp" | |
android:text="Storage" | |
android:textSize="18sp" | |
android:textStyle="bold" /> | |
<ProgressBar | |
android:id="@+id/progressBar" | |
style="?android:attr/progressBarStyleHorizontal" | |
android:layout_width="200dp" | |
android:layout_height="200dp" | |
android:layout_marginTop="26dp" | |
android:background="@drawable/circle_shape" | |
android:indeterminate="false" | |
android:max="100" | |
android:progress="10" | |
android:progressDrawable="@drawable/circular_progress_bar" /> | |
<TextView | |
android:id="@+id/progress_circle_text" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_centerInParent="true" | |
android:background="@android:color/transparent" | |
android:gravity="center" | |
android:text="15%" | |
android:textColor="@color/colorPrimary" | |
android:textSize="30sp" | |
android:textStyle="bold" /> | |
</RelativeLayout> | |
</LinearLayout> | |
<LinearLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginLeft="10dp" | |
android:layout_weight="1" | |
android:background="#fff" | |
android:gravity="center_horizontal" | |
android:orientation="vertical"> | |
<RelativeLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content"> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_centerHorizontal="true" | |
android:layout_marginTop="16dp" | |
android:text="Battery" | |
android:textSize="18sp" | |
android:textStyle="bold" /> | |
<ProgressBar | |
android:id="@+id/progressBar1" | |
style="?android:attr/progressBarStyleHorizontal" | |
android:layout_width="200dp" | |
android:layout_height="200dp" | |
android:layout_marginTop="26dp" | |
android:background="@drawable/circle_shape" | |
android:indeterminate="false" | |
android:max="100" | |
android:progress="75" | |
android:progressDrawable="@drawable/circular_progress_bar" /> | |
<TextView | |
android:id="@+id/progress_circle_text1" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_centerInParent="true" | |
android:background="@android:color/transparent" | |
android:gravity="center" | |
android:text="75%" | |
android:textColor="@color/colorPrimary" | |
android:textSize="30sp" | |
android:textStyle="bold" /> | |
</RelativeLayout> | |
</LinearLayout> | |
</LinearLayout> | |
<LinearLayout | |
android:layout_width="fill_parent" | |
android:layout_height="wrap_content" | |
android:orientation="horizontal"> | |
<LinearLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_weight="1" | |
android:background="#fff" | |
android:gravity="center_horizontal" | |
android:orientation="vertical"> | |
<RelativeLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content"> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_centerHorizontal="true" | |
android:layout_marginTop="16dp" | |
android:text="RAM" | |
android:textSize="18sp" | |
android:textStyle="bold" /> | |
<ProgressBar | |
android:id="@+id/progressBar3" | |
style="?android:attr/progressBarStyleHorizontal" | |
android:layout_width="200dp" | |
android:layout_height="200dp" | |
android:layout_marginTop="26dp" | |
android:background="@drawable/circle_shape" | |
android:indeterminate="false" | |
android:max="100" | |
android:progress="60" | |
android:progressDrawable="@drawable/circular_progress_bar" /> | |
<TextView | |
android:id="@+id/progress_circle_text3" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_centerInParent="true" | |
android:background="@android:color/transparent" | |
android:gravity="center" | |
android:text="60%" | |
android:textColor="@color/colorPrimary" | |
android:textSize="30sp" | |
android:textStyle="bold" /> | |
</RelativeLayout> | |
</LinearLayout> | |
<LinearLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginLeft="10dp" | |
android:layout_weight="1" | |
android:background="#fff" | |
android:gravity="center_horizontal" | |
android:orientation="vertical"> | |
<RelativeLayout | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content"> | |
<TextView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_centerHorizontal="true" | |
android:layout_marginTop="16dp" | |
android:text="Performance" | |
android:textSize="18sp" | |
android:textStyle="bold" /> | |
<ProgressBar | |
android:id="@+id/progressBar4" | |
style="?android:attr/progressBarStyleHorizontal" | |
android:layout_width="200dp" | |
android:layout_height="200dp" | |
android:layout_marginTop="26dp" | |
android:background="@drawable/circle_shape" | |
android:indeterminate="false" | |
android:max="100" | |
android:progress="85" | |
android:progressDrawable="@drawable/circular_progress_bar" /> | |
<TextView | |
android:id="@+id/progress_circle_text4" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_centerInParent="true" | |
android:background="@android:color/transparent" | |
android:gravity="center" | |
android:text="85%" | |
android:textColor="@color/colorPrimary" | |
android:textSize="30sp" | |
android:textStyle="bold" /> | |
</RelativeLayout> | |
</LinearLayout> | |
</LinearLayout> | |
<TextView | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" | |
android:layout_marginTop="10dp" | |
android:gravity="center_horizontal" | |
android:text="ViralAndroid.com" | |
android:textSize="22sp" | |
android:textStyle="bold" /> | |
</LinearLayout> | |
</ScrollView> |
Java Activity File
Following is the complete code of java activity file.
src/ DashboardForAndroidApp.java
//Dashboard/FrontPage XML UI Design For Android App and Game with Source Code | |
package viralandroid.com.androidxmluserinterfacetutorial; | |
import android.os.Bundle; | |
import android.os.Handler; | |
import android.support.v7.app.AppCompatActivity; | |
import android.widget.ProgressBar; | |
import android.widget.TextView; | |
public class DashboardForAndroidApp extends AppCompatActivity { | |
ProgressBar myprogressBar; | |
TextView progressingTextView; | |
Handler progressHandler = new Handler(); | |
int i = 0; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.dashboard_xml_ui_design); | |
myprogressBar = (ProgressBar) findViewById(R.id.progressBar); | |
progressingTextView = (TextView) findViewById(R.id.progress_circle_text); | |
new Thread(new Runnable() { | |
public void run() { | |
while (i < 100) { | |
i += 2; | |
progressHandler.post(new Runnable() { | |
public void run() { | |
myprogressBar.setProgress(i); | |
progressingTextView.setText("" + i + " %"); | |
} | |
}); | |
try { | |
Thread.sleep(300); | |
} catch (InterruptedException e) { | |
e.printStackTrace(); | |
} | |
} | |
} | |
}).start(); | |
} | |
} |
Strings.xml File
res/values/strings.xml
<resources> | |
<string name="app_name">Android App Dashboard UI Design</string> | |
</resources> |
Now, run your Dashboard UI Design for Android application, you will see four different progresses for different topics: storage, battery, RAM, performance in progress bar.
- Get link
- X
- Other Apps
- Get link
- X
- Other Apps
Comments
Post a Comment