7

I would like to change progress color and thumb color of seek bar. I used drawable to change progress color but the progress thickness is changed. Is there any way to change thumb and progress color.

Image

I want to change color of default seekbar like second one on the Image.

  • reffer http://stackoverflow.com/questions/16163215/android-styling-seek-bar – Ravish Sharma Dec 03 '16 at 07:39
  • I saw this answer but i don't want to use any picture. It is not good solution. I can change seekbar color changing "colorAccent" value in colors.xml so i think there should be easiet way to change color. –  Dec 03 '16 at 07:49

1 Answers1

8

This is very simple if you are using Material Theme in your project

Just check first which style are you using in your manifest for your app It would be something like below:

<application
    android:allowBackup="false"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme">

Now follow @style/AppTheme

You will probably want to set your parent theme :Theme.AppCompat.Light.DarkActionBar

Note: The colorAccent attribute will give the desired color to all your widgets

 <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/PrimaryColor</item>
    <item name="colorPrimaryDark">@color/DarkPrimaryColor</item>
    <item name="colorAccent">@color/DarkPrimaryColor</item>
    <item name="android:textColorSecondary">@color/PrimaryColor</item>
    <item name="android:itemBackground">@color/DarkPrimaryColor</item>
    <item name="android:textColor">@color/TextIconsColor</item>
</style>

So if you want, you can create this custom theme for your layouts or activities instead for your whole app theme.

This works for me and its as per Developer Guidelines..As simple as that Ref: Google Developers

shadygoneinsane
  • 2,226
  • 1
  • 24
  • 47