Home Changing the circular spinner color in ProgressDialog
Reply: 1

Changing the circular spinner color in ProgressDialog

BRDroid
1#
BRDroid Published in 2018-02-14 09:59:19Z

I am trying to change the circular spinner color in ProgressDialog but unable to do it using colorAccent. The theme I am using is 'android:Theme.Holo.Dialog'.

Why I am using this style: I just want to show the spinner but not the text. this works like a charm using the link.
Create a progressDialog only with the spinner (in the middle)

Could you suggest how can I achieve this.

thanks R

progressDialog = new ProgressDialog(getActivity(), R.style.MyProgressDialogTheme);

<style name="MyProgressDialogTheme" parent="android:Theme.Holo.Dialog">
        <item name="android:alertDialogStyle">@style/CustomAlertDialogStyle</item>
        <item name="android:windowBackground">@color/transparent</item>
        <item name="android:colorAccent">@color/colorPrimary</item>
        <item name="android:textColorPrimary">#FFFFFF</item>
        <item name="android:backgroundDimEnabled">false</item>
        <item name="android:textColor">#FFFFFF</item>
        <item name="android:textStyle">normal</item>
        <item name="android:textSize">12sp</item>
    </style>

    <style name="CustomAlertDialogStyle">
        <item name="android:bottomBright">@color/transparent</item>
        <item name="android:bottomDark">@color/transparent</item>
        <item name="android:bottomMedium">@color/transparent</item>
        <item name="android:centerBright">@color/transparent</item>
        <item name="android:centerDark">@color/transparent</item>
        <item name="android:centerMedium">@color/transparent</item>
        <item name="android:fullBright">@color/transparent</item>
        <item name="android:fullDark">@color/transparent</item>
        <item name="android:topBright">@color/transparent</item>
        <item name="android:topDark">@color/transparent</item>
    </style>

<color name="transparent">#00000000</color>
<color name="colorPrimary">@color/blueyPurple</color>
<color name="blueyPurple">#673AB7</color>
AloDev
2#
AloDev Reply to 2018-02-14 14:06:41Z

colorAccent is useless for Theme.Holo.Dialog because this style doesn't support material design params like colorAccent.

If you want spinner to change its color using colorAccent then instead of android:Theme.Holo.Dialog use AppCompat Dialog Style, for example Theme.AppCompat.Dialog.Alert.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.295761 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO