Android Clipdrawable Small Example

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.