How to fill the image according to percentage of textview.and it should change according to percentage of textview.below is my code so please check.
private void displayData(String data) {
if (data != null) {
battery.setText(data);
}
}
this is my textview i am getting data as 100 or some 60 like that.what ever value i got that much level my imageview should fill with color and display.
<TextView android:id="@+id/batterylevel"
android:layout_width="wrap_content"
android:layout_height="150dp" android:text="BRV Battery" android:layout_below="@+id/sos"/>
<ImageView
android:id="@+id/image_level"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:src="@drawable/ic_launcher"
android:layout_toRightOf="@+id/batterylevel"
android:layout_below="@+id/sos"
android:layout_above="@+id/portbearmode"
android:alpha="1"
android:adjustViewBounds="true"
android:contentDescription="@string/app_name"/>
in the layout i did like this i should apply any animations or simply setting any options please tell me.
if battery textview is 60 it should fill blue color upto 60 and remaining 40 as white color.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…