Skip to content

Commit 53a9008

Browse files
author
farfromrefug
committed
feat(progress,android): new trackCornerRadius property
1 parent b64f560 commit 53a9008

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/progress/progress-common.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { cssProperty } from '@nativescript-community/ui-material-core';
2-
import { CSSType, Color, CssProperty, Progress as NSProgress, Property, Style, booleanConverter } from '@nativescript/core';
2+
import { CoreTypes, CSSType, Color, CssProperty, Length, Progress as NSProgress, Property, Style, booleanConverter } from '@nativescript/core';
33

44
@CSSType('MDProgress')
55
export abstract class ProgressBase extends NSProgress {
@@ -37,6 +37,15 @@ export const indeterminateProperty = new Property<ProgressBase, boolean>({
3737
defaultValue: false,
3838
valueConverter: booleanConverter
3939
});
40+
41+
42+
export const trackCornerRadiusProperty = new CssProperty<Style, CoreTypes.LengthType>({
43+
name: 'trackCornerRadius',
44+
cssName: 'track-corner-radius',
45+
valueConverter: Length.parse
46+
});
47+
trackCornerRadiusProperty.register(Style);
48+
4049
busyProperty.register(ProgressBase);
4150
indeterminateProperty.register(ProgressBase);
4251
progressColorProperty.register(Style);

src/progress/progress.android.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Color, PercentLength, backgroundColorProperty, backgroundInternalProperty, colorProperty, heightProperty } from '@nativescript/core';
2-
import { ProgressBase, busyProperty, indeterminateProperty, progressBackgroundColorProperty, progressColorProperty } from './progress-common';
1+
import { Color, Length, PercentLength, backgroundColorProperty, backgroundInternalProperty, colorProperty, heightProperty } from '@nativescript/core';
2+
import { ProgressBase, busyProperty, indeterminateProperty, progressBackgroundColorProperty, progressColorProperty, trackCornerRadiusProperty } from './progress-common';
33
import { getRippleColor } from '@nativescript-community/ui-material-core';
44
import { inflateLayout } from '@nativescript-community/ui-material-core/android/utils';
55

@@ -69,4 +69,8 @@ export class Progress extends ProgressBase {
6969
[backgroundInternalProperty.setNative](value) {
7070
//
7171
}
72+
73+
[trackCornerRadiusProperty.setNative](value) {
74+
this.nativeViewProtected.setTrackCornerRadius(Length.toDevicePixels(value, 0))
75+
}
7276
}

0 commit comments

Comments
 (0)