react-native icon indicating copy to clipboard operation
react-native copied to clipboard

Can't define color of ProgressBarAndroid

Open davidgilbertson opened this issue 11 years ago • 6 comments

I would like to be able to define the color of the ProgressBarAndroid component (the default spinner).

I notice in the facebook ads manager app it is a nice blue, was this done with a style in JS or down in Java somewhere?

davidgilbertson avatar Oct 04 '15 22:10 davidgilbertson

I just grepped the fb codebase and don't see color for ProgressBarAndroid being set.

I don't think it's exposed? cc @andreicoman11

mkonicek avatar Oct 05 '15 23:10 mkonicek

The progress bar makes use of the apps theme. Ads Manager's theme has a blue accent which alters the look of the progress bar.

mikearmstrong001 avatar Oct 06 '15 05:10 mikearmstrong001

It hasn't been exposed yet, but feel free do add it! Color can be added as a property and then set on the progressBar itself in the following way: progressBar.getIndeterminateDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN);

andreicoman11 avatar Oct 06 '15 09:10 andreicoman11

@andreicoman11 could you point me in the right direction? Where do I get a reference to the progressBar to be able to call getIndeterminateDrawable?

Keep in mind I don't know Java or Android development.

davidgilbertson avatar Oct 13 '15 07:10 davidgilbertson

I'm having the same issue. Current docs say the color can be set through the color property, but it doesn't seem to work:

https://github.com/facebook/react-native/blob/a797be6ffdd8fd9107cd8654b0c0d7c46ee2c6bb/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js#L68

I've tried the following, but none seems to work:

<ProgressBarAndroid color"white" />
<ProgressBarAndroid color"#ffffff" />

mrcasals avatar Nov 06 '15 11:11 mrcasals

Fixed in https://github.com/facebook/react-native/commit/a797be6ffdd8fd9107cd8654b0c0d7c46ee2c6bb

andreicoman11 avatar Nov 06 '15 14:11 andreicoman11