2015-05-15 15 views
2

我想有一个圆形的进度条这样自定义通知进度条与实心圆

enter image description here

我试过,但它不像圆形,以及如何把动画与衰落一起,因为目前我我为所有六个圆圈使用相同的xml。

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="wrap_content" 
android:layout_height="match_parent" 
android:orientation="horizontal" > 

<LinearLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_gravity="center" 
    android:layout_marginRight="15dp" 
    android:orientation="vertical" > 

    <ImageView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginBottom="5dp" 
     android:src="@drawable/circle_shape_big_custom_search" /> 

    <ImageView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginTop="5dp" 
     android:src="@drawable/circle_shape_big_custom_search" /> 
</LinearLayout> 

<LinearLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_gravity="center" 
    android:orientation="vertical" > 

    <ImageView 
     android:layout_width="wrap_content" 
     android:layout_height="72dp" 
     android:src="@drawable/circle_shape_big_custom_search" /> 

    <ImageView 
     android:layout_width="wrap_content" 
     android:layout_height="72dp" 
     android:src="@drawable/circle_shape_big_custom_search" /> 
</LinearLayout> 

<LinearLayout 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_gravity="center" 
    android:layout_marginLeft="15dp" 
    android:orientation="vertical" > 

    <ImageView 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginBottom="5dp" 
     android:src="@drawable/circle_shape_big_custom_search" /> 

    <ImageView 
     android:layout_width="wrap_content" 
     android:layout_marginTop="5dp" 
     android:layout_height="wrap_content" 
     android:src="@drawable/circle_shape_big_custom_search" /> 
</LinearLayout> 

任何帮助将非常感激。

+2

结帐:https:// gith ub.com/Fichardu/CircleProgress –

+0

此线程已经开放。任何机构都可以帮助我解决这个问题。 ?? – DJhon

回答

1

定义进度条像beloew代码剪断:

<ProgressBar 
     android:id="@+id/progress_bar" 
     android:layout_width="100dp" 
     android:layout_height="100dp" 
     android:layout_gravity="center" 
     android:indeterminateDrawable="@drawable/my_progress_indeterminate" 
     android:visibility="gone" > 
    </ProgressBar> 

my_progress_indeterminate.xml [将该文件放在绘制]

<?xml version="1.0" encoding="utf-8"?> 
<animated-rotate xmlns:android="http://schemas.android.com/apk/res/android" 
    android:drawable="@drawable/image_for_rotation" 
    android:pivotX="50%" 
    android:pivotY="50%" /> 

放置在drawale这里attched这个图片文件: image_to_be_place_in_drawable

+0

毫无疑问,你的答案真的很有帮助,但我不想旋转,我想淡出动作。意味着每个圆形图像都将是自己的位置,但它应该以序列化的方式消失和闪耀。 – DJhon

+0

好的,它上面的程序几乎就是你所说的图像,我认为当你保持循环缓慢时,它似乎并不是在狂欢。 – KOTIOS

+0

是的...图像应该是静态的,但是应该以像运动一样的方式进行淡入淡出。 – DJhon