Skip to content

Commit dca9ba0

Browse files
authored
Merge pull request #5 from react-native-oh-library/dev
release 4.4.3-0.1.2
2 parents 561f7d2 + 85bdaa8 commit dca9ba0

16 files changed

+16
-70
lines changed

package/harmony/slider.har

-402 Bytes
Binary file not shown.

package/harmony/slider/src/main/cpp/ComponentDescriptor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/**
22
* MIT License
33
*
44
* Copyright (C) 2021 Huawei Device Co., Ltd.

package/harmony/slider/src/main/cpp/EventEmitters.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/**
22
* MIT License
33
*
44
* Copyright (C) 2021 Huawei Device Co., Ltd.

package/harmony/slider/src/main/cpp/EventEmitters.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/**
22
* MIT License
33
*
44
* Copyright (C) 2021 Huawei Device Co., Ltd.

package/harmony/slider/src/main/cpp/Props.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/**
22
* MIT License
33
*
44
* Copyright (C) 2021 Huawei Device Co., Ltd.

package/harmony/slider/src/main/cpp/Props.h

Lines changed: 2 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/**
22
* MIT License
33
*
44
* Copyright (C) 2021 Huawei Device Co., Ltd.
@@ -25,6 +25,7 @@
2525
#pragma once
2626

2727
#include <jsi/jsi.h>
28+
#include <react/renderer/components/image/conversions.h>
2829
#include <react/renderer/components/view/ViewProps.h>
2930
#include <react/renderer/core/PropsParserContext.h>
3031
#include <react/renderer/imagemanager/primitives.h>
@@ -33,61 +34,6 @@
3334
namespace facebook {
3435
namespace react {
3536

36-
inline void fromRawValue(const PropsParserContext &context, const RawValue &value, ImageSource &result) {
37-
if (value.hasType<std::string>()) {
38-
result = {
39-
ImageSource::Type::Remote,
40-
(std::string)value,
41-
};
42-
return;
43-
}
44-
45-
if (value.hasType<butter::map<std::string, RawValue>>()) {
46-
auto items = (butter::map<std::string, RawValue>)value;
47-
result = {};
48-
49-
result.type = ImageSource::Type::Remote;
50-
51-
if (items.find("__packager_asset") != items.end()) {
52-
result.type = ImageSource::Type::Local;
53-
}
54-
55-
if (items.find("width") != items.end() && items.find("height") != items.end() &&
56-
items.at("width").hasType<Float>() && items.at("height").hasType<Float>()) {
57-
result.size = {(Float)items.at("width"), (Float)items.at("height")};
58-
}
59-
60-
if (items.find("scale") != items.end() &&
61-
items.at("scale").hasType<Float>()) {
62-
result.scale = (Float)items.at("scale");
63-
} else {
64-
result.scale = items.find("deprecated") != items.end() ? 0.0f : 1.0f;
65-
}
66-
67-
if (items.find("url") != items.end() &&
68-
items.at("url").hasType<std::string>()) {
69-
result.uri = (std::string)items.at("url");
70-
}
71-
72-
if (items.find("uri") != items.end() &&
73-
items.at("uri").hasType<std::string>()) {
74-
result.uri = (std::string)items.at("uri");
75-
}
76-
77-
if (items.find("bundle") != items.end() &&
78-
items.at("bundle").hasType<std::string>()) {
79-
result.bundle = (std::string)items.at("bundle");
80-
result.type = ImageSource::Type::Local;
81-
}
82-
83-
return;
84-
}
85-
result = {};
86-
result.type = ImageSource::Type::Invalid;
87-
}
88-
89-
inline std::string toString(const ImageSource &value) { return "{uri: " + value.uri + "}"; }
90-
9137
class JSI_EXPORT RNCSliderProps final : public ViewProps {
9238
public:
9339
RNCSliderProps() = default;

package/harmony/slider/src/main/cpp/ShadowNodes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/**
22
* MIT License
33
*
44
* Copyright (C) 2021 Huawei Device Co., Ltd.

package/harmony/slider/src/main/cpp/ShadowNodes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/**
22
* MIT License
33
*
44
* Copyright (C) 2021 Huawei Device Co., Ltd.

package/harmony/slider/src/main/cpp/SliderEventEmiRequestHandler.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/**
22
* MIT License
33
*
44
* Copyright (C) 2021 Huawei Device Co., Ltd.

package/harmony/slider/src/main/cpp/SliderJSIBinder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/**
22
* MIT License
33
*
44
* Copyright (C) 2021 Huawei Device Co., Ltd.

package/harmony/slider/src/main/cpp/SliderNapiBinder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/**
22
* MIT License
33
*
44
* Copyright (C) 2021 Huawei Device Co., Ltd.

package/harmony/slider/src/main/cpp/SliderPackage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/**
22
* MIT License
33
*
44
* Copyright (C) 2021 Huawei Device Co., Ltd.

package/harmony/slider/src/main/ets/Logger.ets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/**
22
* MIT License
33
* Copyright (C) 2021 Huawei Device Co., Ltd.
44
* Permission is hereby granted, free of charge, to any person obtaining a copy

package/harmony/slider/src/main/ets/Slider.ets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/**
22
* MIT License
33
*
44
* Copyright (C) 2021 Huawei Device Co., Ltd.

package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@react-native-oh-library/slider",
3-
"version": "4.4.3-0.1.1",
3+
"version": "4.4.3-0.1.2",
44
"license": "MIT",
55
"author": "react-native-community",
66
"homepage": "https://github.com/callstack/react-native-slider#readme",

package/src/Slider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ SliderWithRef.defaultProps = {
289289
};
290290

291291
let styles = StyleSheet.create(
292-
Platform.OS === 'ios' ? {slider: {height: 40}} : {slider: {}},
292+
Platform.OS === 'ios' || Platform.OS === 'harmony' ? {slider: {height: 40}} : {slider: {}},
293293
);
294294

295295
export default SliderWithRef;

0 commit comments

Comments
 (0)