The effect is as follows: the progress bar is similar to this logic code: Layout.xml
<?XML version= "1.0" encoding= "Utf-8"?><LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Fill_parent"Android:layout_height= "Fill_parent"android:orientation= "vertical"> <RelativelayoutAndroid:layout_width= "Match_parent"Android:layout_height= "50DP"Android:background= "@color/white"> <ImageViewAndroid:id= "@+id/image"Android:layout_width= "Match_parent"Android:layout_height= "50DP"Android:background= "@drawable/clip" /> <TextViewAndroid:layout_width= "Match_parent"Android:layout_height= "50DP"android:gravity= "Center"Android:text= "Phone storage: Size 25.5m/Total size 30M" /> </Relativelayout></LinearLayout>
Myactivity.java
PackageCom.example.myapp;Importandroid.app.Activity;Importandroid.graphics.drawable.ClipDrawable;ImportAndroid.os.Bundle;ImportAndroid.widget.ImageView; Public classMyActivityextendsactivity{@Override Public voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); Setcontentview (R.layout.main); ImageView Image=(ImageView) Findviewbyid (r.id.image); Clipdrawable D=(clipdrawable) image.getbackground (); D.setlevel (D.getlevel ()+7000); }}
Android Clipdrawable Small Example