Android custom pop-up window progress bar [Source Code]

Source: Internet
Author: User

The Android custom progress bar mainly modifies the style of the ProgressBar, And the pop-up window displays the ProgressBar in the Dialog.

Directly add the code.

Add the following code to style. xml:

<Style name = "ProgressBar_Mini" parent = "@ android: style/Widget. ProgressBar. Horizontal">
<Item name = "android: maxHeight"> 50dip </item>
<Item name = "android: minHeight"> 8dip </item>
<Item name = "android: indeterminateOnly"> false </item>
<Item name = "android: indeterminateDrawable"> @ android: drawable/progress_indeterminate_horizontal </item>
<Item name = "android: progressDrawable"> @ drawable/progressbar_mini </item>
</Style>

 

<Style name = "dialog" parent = "@ android: style/Theme. Dialog">
<Item name = "android: windowFrame"> @ null </item>
<Item name = "android: incluwisfloating"> true </item>
<Item name = "android: javaswistranslucent"> true </item>
<Item name = "android: windowNoTitle"> true </item>
<Item name = "android: backgroundDimEnabled"> true </item>
<Item name = "android: windowBackground"> @ color/transparent </item>
</Style>

The content of the new drawable/progressbar_mini.xml file is as follows:

<Layer-list xmlns: android = "http://schemas.android.com/apk/res/android">
<Item android: id = "@ android: id/background">
<Shape>
<Corners android: radius = "0dip"/>
<Gradient
Android: Angular = "270"
Android: centery= "0.75"
Android: endColor = "# F5F5F5"
Android: startColor = "# BEBEBE"/>
</Shape>
</Item>
 
<Item android: id = "@ android: id/secondaryProgress">
<Clip>
<Shape>
<Corners android: radius = "0dip"/>
<Gradient
Android: Angular = "270"
Android: centery= "0.75"
Android: endColor = "# 165CBC"
Android: startColor = "#85B0E9"/>
</Shape>
</Clip>
</Item>
 
<Item android: id = "@ android: id/progress">
<Clip>
<Shape>
<Corners android: radius = "0dip"/>
<Gradient
Android: Angular = "270"
Android: centery= "0.75"
Android: endColor = "#00FF66"
Android: startColor = "#00FF66"/>
</Shape>
</Clip>
</Item>
</Layer-list>

 

  • 1
  • 2
  • 3
  • 4
  • Next Page

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.