2016-07-21 50 views
2

我想在进度值的末尾显示圆圈(点)指示器。它是这样的: -带圆圈指示器的水平进度条android

horizontal progressbar indicator image

这里是我的进度xml文件: -

<?xml version="1.0" encoding="utf-8"?> 
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> 

    <item android:id="@android:id/background"> 
     <shape> 
      <corners android:radius="5dip" /> 
      <gradient 
       android:angle="270" 
       android:centerColor="#EBEBEB" 
       android:centerY="0.75" 
       android:endColor="#EBEBEB" 
       android:startColor="#EBEBEB" /> 
     </shape> 
    </item> 

    <item android:id="@android:id/secondaryProgress"> 
     <clip> 
      <shape> 
       <corners android:radius="5dip" /> 
       <gradient 
        android:angle="270" 
        android:centerColor="#EBEBEB" 
        android:centerY="0.75" 
        android:endColor="#EBEBEB" 
        android:startColor="#EBEBEB" /> 
      </shape> 
     </clip> 
    </item> 

    <item android:id="@android:id/progress"> 
     <clip> 
      <shape> 
       <corners android:radius="5dip" /> 
       <gradient 
        android:angle="270" 
        android:centerColor="#00FFB7" 
        android:centerY="0.75" 
        android:endColor="#00FFB7" 
        android:startColor="#00FFB7" /> 
      </shape> 
     </clip> 
    </item> 
</layer-list> 

它目前看起来像这样: -

current progressbar

请帮我添加循环指标。感谢名单

+0

我也有同样的问题。请一些身体帮助我们............ – Chirag

回答

0

添加摇篮依赖性:

dependencies { 
    compile 'com.github.rey5137:material:1.2.4' 
} 

和XML代码用这种方式

<com.rey.material.widget.Slider 
      android:id="@+id/slider_sl_continuous_disable" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:gravity="center" 
      android:padding="16dp" 
      android:enabled="false" 
      app:v_styleId="@array/slider"/> 

你可以在你themes.xml文件

<array name="slider"> 
     <item>@style/LightSlider</item> 
    </array> 

styles.xml文件中定义定义silder这种方式

<style name="LightSlider" parent="Material.Widget.Slider"> 
     <item name="sl_primaryColor">@color/colorPrimary</item> 
    </style> 

输出:

enter image description here

希望这会帮助你。快乐编码..

+0

不,这是行不通的( – Sid

+0

@mahideveloper你可以告诉我什么问题。或任何错误发生。 – Ironman

+0

我需要progrees栏不寻求酒吧(滑块) – Sid