2015-05-15 25 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