Skip to content
This repository was archived by the owner on Dec 3, 2024. It is now read-only.

Commit c38432c

Browse files
committed
add shape prop
1 parent c704877 commit c38432c

File tree

7 files changed

+9
-0
lines changed

7 files changed

+9
-0
lines changed

harmony/checkbox/src/main/cpp/JSIBinder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class CheckboxJSIBinder : public ViewComponentJSIBinder {
3434
object.setProperty(rt, "tintColor", "Color");
3535
object.setProperty(rt, "value", "boolean");
3636
object.setProperty(rt, "disabled", "boolean");
37+
object.setProperty(rt, "shape", "int");
3738
object.setProperty(rt, "strokeColor", "Color");
3839
object.setProperty(rt, "markSize", "float");
3940
object.setProperty(rt, "strokeWidth", "float");

harmony/checkbox/src/main/cpp/NapiBinder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class CheckboxNapiBinder : public ViewComponentNapiBinder {
3939
.addProperty("tintColor", props->tintColor)
4040
.addProperty("value", props->value)
4141
.addProperty("disabled", props->disabled)
42+
.addProperty("shape", props->shape)
4243
.addProperty("markSize", props->markSize)
4344
.addProperty("strokeWidth", props->strokeWidth)
4445
.addProperty("strokeColor", props->strokeColor)

harmony/checkbox/src/main/cpp/Props.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ namespace react {
3535
disabled(convertRawProp(context, rawProps, "disabled", sourceProps.disabled, {false})),
3636
onCheckColor(convertRawProp(context, rawProps, "onCheckColor", sourceProps.onCheckColor, {})),
3737
markSize(convertRawProp(context, rawProps, "markSize", sourceProps.markSize, {-1.0})),
38+
shape(convertRawProp(context, rawProps, "shape", sourceProps.shape, {0})),
3839
strokeWidth(convertRawProp(context, rawProps, "strokeWidth", sourceProps.strokeWidth, {-1.0})),
3940
strokeColor(convertRawProp(context, rawProps, "strokeColor", sourceProps.strokeColor, {})),
4041
tintColor(convertRawProp(context, rawProps, "tintColor", sourceProps.tintColor, {}))

harmony/checkbox/src/main/cpp/Props.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class JSI_EXPORT RNCCheckboxProps final : public ViewProps {
4141
bool disabled{false};
4242
SharedColor onCheckColor{};
4343
SharedColor tintColor{};
44+
int shape{0};
4445
Float markSize{-1.0};
4546
Float strokeWidth{-1.0};
4647
SharedColor strokeColor{};

harmony/checkbox/src/main/ets/RNCCheckbox.ets

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export interface RNCCheckboxProps extends ViewBaseProps {
4040
value: boolean
4141
disabled: boolean
4242
markSize:number
43+
shape:number
4344
strokeWidth:number
4445
strokeColor:ColorSegments
4546
}
@@ -83,6 +84,7 @@ export struct RNCCheckbox {
8384
.select(this.descriptor.props.value)
8485
.width('100%')
8586
.height('100%')
87+
.shape(this.descriptor.props.shape)
8688
.selectedColor(convertColorSegmentsToString(this.descriptor.props.onCheckColor))
8789
.unselectedColor(convertColorSegmentsToString(this.descriptor.props.tintColor))
8890
.onChange((v)=>{this.onChange(v)})

src/RNCCheckboxNativeComponent.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export interface CheckBoxNativeProps extends ViewProps {
4040
onChange?: DirectEventHandler<ChangeEvent>;
4141
onCheckColor?: ColorValue;
4242
tintColor?: ColorValue;
43+
shape?:WithDefault<Int32,0>;
4344
markSize?: WithDefault<Int32, -1>;
4445
strokeWidth?: WithDefault<Int32, -1>;
4546
strokeColor?: ColorValue;

src/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ function CheckboxBase({
4141
tintColor,
4242
onCheckColor,
4343
testID,
44+
shape,
4445
forwardedRef,
4546
markSize,
4647
strokeWidth,
@@ -59,6 +60,7 @@ function CheckboxBase({
5960
tintColor={tintColor}
6061
onCheckColor={onCheckColor}
6162
value={value}
63+
shape={shape}
6264
disabled={disabled}
6365
markSize={markSize}
6466
strokeWidth={strokeWidth}

0 commit comments

Comments
 (0)