mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
Merge pull request #3770 from NativeScript/activity-indicator-crash
FIX: Crash setting color to activity-indicator
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
import { ActivityIndicatorBase, busyProperty, colorProperty, visibilityProperty, Visibility } from "./activity-indicator-common";
|
import { ActivityIndicatorBase, busyProperty, colorProperty, visibilityProperty, Visibility, Color } from "./activity-indicator-common";
|
||||||
|
|
||||||
export * from "./activity-indicator-common";
|
export * from "./activity-indicator-common";
|
||||||
|
|
||||||
@ -47,12 +47,12 @@ export class ActivityIndicator extends ActivityIndicatorBase {
|
|||||||
get [colorProperty.native](): number {
|
get [colorProperty.native](): number {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
set [colorProperty.native](value: number) {
|
set [colorProperty.native](value: number | Color) {
|
||||||
if (value < 0) {
|
if (value instanceof Color) {
|
||||||
this._progressBar.getIndeterminateDrawable().clearColorFilter();
|
this._progressBar.getIndeterminateDrawable().setColorFilter(value.android, android.graphics.PorterDuff.Mode.SRC_IN);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this._progressBar.getIndeterminateDrawable().setColorFilter(value, android.graphics.PorterDuff.Mode.SRC_IN);
|
this._progressBar.getIndeterminateDrawable().clearColorFilter();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user