0

I would like to customize spinner, background and text colors for ProgressBar dialog.

I want to do this via style.xml across 4+ and 5 OS versions.

What is the correct parent theme and attributes responsible for my properties?

I cannot use a custom drawable to solve this issue, as the style is not defined via standard style.xml.

Baum mit Augen
  • 49,044
  • 25
  • 144
  • 182
Android dev
  • 75
  • 1
  • 8
  • Are you trying to do so from the java files or the xml files? –  Jul 12 '15 at 06:45
  • possible duplicate of [How to Customize a Progress Bar In Android](http://stackoverflow.com/questions/16893209/how-to-customize-a-progress-bar-in-android) –  Jul 12 '15 at 06:52
  • As I mentioned I want to do this via style.xml file. – Android dev Jul 12 '15 at 06:54
  • This is not a duplicate "How to Customize a Progress Bar In Android " My question relates to styling not to implementing new drawable – Android dev Jul 12 '15 at 06:55
  • Don't use UPDATE (or EDIT), when updating your post. We have edit history for that. Make sure the post continuous to be a readable coherent whole. – Anthon Jul 14 '15 at 07:33

1 Answers1

0

here is an example on spinner style same could be applicable on progress bar, if you need to use a drawable file you could use it as a background as suggested bellow:

<!-- Border for spinners-->
    <style name="spinner_style" parent="AppBaseTheme">
        <item name="android:background">@drawable/bg</item>
        <item name="android:layout_marginLeft">10dp</item>
        <item name="android:layout_marginRight">10dp</item>
        <item name="android:layout_marginBottom">10dp</item>
        <item name="android:paddingLeft">8dp</item>
        <item name="android:paddingTop">5dp</item>
        <item name="android:paddingBottom">5dp</item>
        <item name="android:popupBackground">#CECCCD</item>

    </style>

bg.xml

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

    <item><layer-list>
        <item><shape>
            <gradient android:angle="90" android:endColor="#ebebeb" android:startColor="#ebebeb" android:type="linear" />

            <stroke android:width="2dip" android:color="#32CD32" />
            <corners android:radius="10dip"/>

            <padding android:bottom="3dp" android:left="3dp" android:right="3dp" android:top="3dp" />
        </shape></item>
        <item ><bitmap android:gravity="bottom|right" android:src="@drawable/arrow" />
        </item>
    </layer-list></item>

</selector>  

arrow:

enter image description here

Hope this will help.

Ahmad Sanie
  • 3,678
  • 2
  • 21
  • 56