Skip to content

Commit

Permalink
Merge pull request #5 from react-native-oh-library/dev
Browse files Browse the repository at this point in the history
release 4.4.3-0.1.2
  • Loading branch information
Louis-C7 authored Nov 29, 2023
2 parents 561f7d2 + 85bdaa8 commit dca9ba0
Showing 16 changed files with 16 additions and 70 deletions.
Binary file modified package/harmony/slider.har
Binary file not shown.
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/cpp/ComponentDescriptor.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/cpp/EventEmitters.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/cpp/EventEmitters.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/cpp/Props.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
58 changes: 2 additions & 56 deletions package/harmony/slider/src/main/cpp/Props.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
@@ -25,6 +25,7 @@
#pragma once

#include <jsi/jsi.h>
#include <react/renderer/components/image/conversions.h>
#include <react/renderer/components/view/ViewProps.h>
#include <react/renderer/core/PropsParserContext.h>
#include <react/renderer/imagemanager/primitives.h>
@@ -33,61 +34,6 @@
namespace facebook {
namespace react {

inline void fromRawValue(const PropsParserContext &context, const RawValue &value, ImageSource &result) {
if (value.hasType<std::string>()) {
result = {
ImageSource::Type::Remote,
(std::string)value,
};
return;
}

if (value.hasType<butter::map<std::string, RawValue>>()) {
auto items = (butter::map<std::string, RawValue>)value;
result = {};

result.type = ImageSource::Type::Remote;

if (items.find("__packager_asset") != items.end()) {
result.type = ImageSource::Type::Local;
}

if (items.find("width") != items.end() && items.find("height") != items.end() &&
items.at("width").hasType<Float>() && items.at("height").hasType<Float>()) {
result.size = {(Float)items.at("width"), (Float)items.at("height")};
}

if (items.find("scale") != items.end() &&
items.at("scale").hasType<Float>()) {
result.scale = (Float)items.at("scale");
} else {
result.scale = items.find("deprecated") != items.end() ? 0.0f : 1.0f;
}

if (items.find("url") != items.end() &&
items.at("url").hasType<std::string>()) {
result.uri = (std::string)items.at("url");
}

if (items.find("uri") != items.end() &&
items.at("uri").hasType<std::string>()) {
result.uri = (std::string)items.at("uri");
}

if (items.find("bundle") != items.end() &&
items.at("bundle").hasType<std::string>()) {
result.bundle = (std::string)items.at("bundle");
result.type = ImageSource::Type::Local;
}

return;
}
result = {};
result.type = ImageSource::Type::Invalid;
}

inline std::string toString(const ImageSource &value) { return "{uri: " + value.uri + "}"; }

class JSI_EXPORT RNCSliderProps final : public ViewProps {
public:
RNCSliderProps() = default;
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/cpp/ShadowNodes.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/cpp/ShadowNodes.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/cpp/SliderJSIBinder.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/cpp/SliderNapiBinder.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/cpp/SliderPackage.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/ets/Logger.ets
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Permission is hereby granted, free of charge, to any person obtaining a copy
2 changes: 1 addition & 1 deletion package/harmony/slider/src/main/ets/Slider.ets
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/**
* MIT License
*
* Copyright (C) 2021 Huawei Device Co., Ltd.
2 changes: 1 addition & 1 deletion package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-oh-library/slider",
"version": "4.4.3-0.1.1",
"version": "4.4.3-0.1.2",
"license": "MIT",
"author": "react-native-community",
"homepage": "https://github.com/callstack/react-native-slider#readme",
2 changes: 1 addition & 1 deletion package/src/Slider.tsx
Original file line number Diff line number Diff line change
@@ -289,7 +289,7 @@ SliderWithRef.defaultProps = {
};

let styles = StyleSheet.create(
Platform.OS === 'ios' ? {slider: {height: 40}} : {slider: {}},
Platform.OS === 'ios' || Platform.OS === 'harmony' ? {slider: {height: 40}} : {slider: {}},
);

export default SliderWithRef;

0 comments on commit dca9ba0

Please sign in to comment.