Battery Indicator

Example:

                                    
                                        <?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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"
    tools:context=".BatteryIndicatorExample"
    android:padding="16dp"
    android:gravity="center"
    android:background="@color/colorWhite"
    android:orientation="vertical">

    <TextView
        android:id="@+id/batterylevel"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text=""
        android:textColor="@color/colorBlack"
        android:textSize="30sp"
        android:gravity="center"/>

    <ProgressBar
        android:id="@+id/progressbar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        style="@style/Widget.AppCompat.ProgressBar.Horizontal"
        android:max="100"
        android:minHeight="40dp"
        android:minWidth="200dp"/>
</LinearLayout>