Skip to content

Commit c646547

Browse files
committed
fix(android): progress color set fix
1 parent ba71f6c commit c646547

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/progress/progress.android.ts

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { Color, PercentLength, heightProperty } from '@nativescript/core';
1+
import { Color, PercentLength, backgroundColorProperty, backgroundInternalProperty, colorProperty, heightProperty } from '@nativescript/core';
22
import { ProgressBase, busyProperty, indeterminateProperty, progressBackgroundColorProperty, progressColorProperty } from './progress-common';
3+
import { getRippleColor } from '@nativescript-community/ui-material-core';
34

45
export class Progress extends ProgressBase {
56
nativeViewProtected: com.google.android.material.progressindicator.LinearProgressIndicator;
@@ -54,4 +55,18 @@ export class Progress extends ProgressBase {
5455
public stopAnimating() {
5556
this.busy = false;
5657
}
58+
[colorProperty.setNative](color) {
59+
const array = Array.create('int', 1);
60+
array[0] = color.android;
61+
this.nativeViewProtected.setIndicatorColor(array);
62+
if (!this.backgroundColor) {
63+
this.nativeViewProtected.setTrackColor(getRippleColor(color));
64+
}
65+
}
66+
[backgroundColorProperty.setNative](color) {
67+
this.nativeViewProtected.setTrackColor(color.android);
68+
}
69+
[backgroundInternalProperty.setNative](value) {
70+
//
71+
}
5772
}

0 commit comments

Comments
 (0)