2016-06-21 33 views
-1

如何在Android中的GIF中創建一個進度按鈕?我搜索了很多,但我無法準確地找到這樣的事:如何使這樣的進度按鈕爲Android?

Animated Progress Button

這個按鈕是如此漂亮,我真的希望能夠創建進度按鈕完全一樣的。任何幫助或鏈接到GitHub項目將是很好的。

+5

我只是去github上,發現這比在一分鐘的時間:圓形的進展按鈕(https://github.com/dmytrodanylyk/circular-progress-button)同樣這也太[的Fab進展] (https://github.com/ckurtm/FabButton) –

+1

與我的朋友沒什麼兩樣,我睜開眼睛。首先你有一個按鈕和一個動畫。當你點擊按鈕,你可以隱藏並設置可見的晶圓廠進度,一旦完成,你可以再次設置可見。沒有人可以直接幫助你。請做一些努力,並帶着您嘗試過的一些代碼來到這裏。我向你展示了一種方法,你可以試試.Stackoverflow就是爲此目的而存在的 –

+0

將矩形按鈕轉換爲圓形按鈕anim如何? – Matarata

回答

0

您可以實現一個圓形的seekbar,當seekBar進度爲100時,您可以將圖像從十字(x)更改爲勾號。要實現圓形進度條,你可以參考這個link

0

看看the Blog the image comes from

它引用了關於FAB(Floating Action Button)設計的another article on that same blog,其中包括代碼示例,示例和codepen鏈接。

+0

我在他的網站上看不到任何代碼或示例。代碼在哪裏? – Matarata

+0

我答案中的第二個鏈接包含CodePen框,帶有用於顯示HTML,CSS和輸出的標籤。 –

+0

我需要Android代碼而不是CSS。 TY – Matarata

3

這正是FabButton你在尋找什麼

<view 
     android:layout_width="@dimen/button_size" 
     android:layout_height="@dimen/button_size" 
     class="mbanje.kurt.fabbutton.FabButton" 
     android:id="@+id/determinate" 
     android:layout_gravity="center" 
     android:color="#ff6e9cff" 
     android:src="@drawable/ic_fab_play" 
     android:visibility="visible" 
     android:layout_centerInParent="true" 
     android:indeterminate="false" 
     android:max="100" 
     app:fbb_autoStart="true" 
     app:fbb_progressColor="#ff170aff" 
     app:fbb_progressWidthRatio="0.1" 
     app:fbb_endBitmap="@drawable/ic_fab_complete" 
     app:fbb_showEndBitmap="true" 
     />