Skip to content

Commit 5f64322

Browse files
committed
OpenHarmony support
1 parent c14a234 commit 5f64322

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2883
-199
lines changed

.eslintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = {extends: ['@react-native-community']};

AnyHeader.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

ClassicsHeader.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

DefaultHeader.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

MaterialHeader.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

StoreHouseHeader.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

Util.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

harmony/smart_refresh_layout.har

17.9 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/node_modules
2+
/oh_modules
3+
/.preview
4+
/build
5+
/.cxx
6+
/.test
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright (C) 2023 Huawei Device Co., Ltd.
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
export * from "./src/main/ets/SmartRefreshControl"
16+
export * from "./src/main/ets/RNCAnyHeader"
17+
export * from "./src/main/ets/RNCDefaultHeader"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
string page_show 0x02000000
2+
media icon_load 0x02000001
3+
media icon_up 0x02000002
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"apiType": "stageMode",
3+
"buildOption": {
4+
},
5+
"targets": [
6+
{
7+
"name": "default",
8+
"runtimeOS": "HarmonyOS"
9+
}
10+
]
11+
}

harmony/smart_refresh_layout/consumer-rules.txt

Whitespace-only changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { harTasks } from '@ohos/hvigor-ohos-plugin';
2+
3+
export default {
4+
system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
5+
plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
6+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Define project specific obfuscation rules here.
2+
# You can include the obfuscation configuration files in the current module's build-profile.json5.
3+
#
4+
# For more details, see
5+
# https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md
6+
7+
# Obfuscation options:
8+
# -disable-obfuscation: disable all obfuscations
9+
# -enable-property-obfuscation: obfuscate the property names
10+
# -enable-toplevel-obfuscation: obfuscate the names in the global scope
11+
# -compact: remove unnecessary blank spaces and all line feeds
12+
# -remove-log: remove all console.* statements
13+
# -print-namecache: print the name cache that contains the mapping from the old names to new names
14+
# -apply-namecache: reuse the given cache file
15+
16+
# Keep options:
17+
# -keep-property-name: specifies property names that you want to keep
18+
# -keep-global-name: specifies names that you want to keep in the global scope

harmony/smart_refresh_layout/oh-package-lock.json5

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"license": "Apache-2.0",
3+
"devDependencies": {
4+
"rnoh": "file:../rnoh"
5+
},
6+
"author": "",
7+
"name": "smart_refresh_layout",
8+
"description": "Please describe the basic information.",
9+
"main": "Index.ets",
10+
"version": "1.0.0",
11+
"dependencies": {},
12+
"compileOnlyDependencies": {}
13+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cmake_minimum_required(VERSION 3.13)
2+
set(CMAKE_VERBOSE_MAKEFILE on)
3+
4+
file(GLOB rnoh_smart_refresh_layout_SRC CONFIGURE_DEPENDS *.cpp)
5+
add_library(rnoh_smart_refresh_layout SHARED ${rnoh_smart_refresh_layout_SRC})
6+
target_include_directories(rnoh_smart_refresh_layout PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
7+
target_link_libraries(rnoh_smart_refresh_layout PUBLIC rnoh)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
/**
3+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4+
*
5+
* Do not edit this file as changes may cause incorrect behavior and will be lost
6+
* once the code is regenerated.
7+
*
8+
* @generated by codegen project: GenerateComponentDescriptorH.js
9+
*/
10+
11+
#pragma once
12+
13+
#include "ShadowNodes.h"
14+
#include <react/renderer/core/ConcreteComponentDescriptor.h>
15+
16+
namespace facebook {
17+
namespace react {
18+
19+
using RNCAnyHeaderComponentDescriptor = ConcreteComponentDescriptor<RNCAnyHeaderShadowNode>;
20+
using RNCClassicsHeaderComponentDescriptor = ConcreteComponentDescriptor<RNCClassicsHeaderShadowNode>;
21+
using RNCDefaultHeaderComponentDescriptor = ConcreteComponentDescriptor<RNCDefaultHeaderShadowNode>;
22+
using RNCMaterialHeaderComponentDescriptor = ConcreteComponentDescriptor<RNCMaterialHeaderShadowNode>;
23+
using SmartRefreshLayoutComponentDescriptor = ConcreteComponentDescriptor<SmartRefreshLayoutShadowNode>;
24+
using RNCStoreHouseHeaderComponentDescriptor = ConcreteComponentDescriptor<RNCStoreHouseHeaderShadowNode>;
25+
26+
} // namespace react
27+
} // namespace facebook
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
2+
/**
3+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
4+
*
5+
* Do not edit this file as changes may cause incorrect behavior and will be lost
6+
* once the code is regenerated.
7+
*
8+
* @generated by codegen project: GenerateEventEmitterCpp.js
9+
*/
10+
11+
#include "EventEmitters.h"
12+
13+
namespace facebook {
14+
namespace react {
15+
16+
void SmartRefreshLayoutEventEmitter::onRefresh(OnRefresh event) const {
17+
dispatchEvent("refresh", [event=std::move(event)](jsi::Runtime &runtime) {
18+
auto payload = jsi::Object(runtime);
19+
20+
return payload;
21+
});
22+
}
23+
void SmartRefreshLayoutEventEmitter::onHeaderPulling(OnHeaderPulling event) const {
24+
dispatchEvent("headerPulling", [event=std::move(event)](jsi::Runtime &runtime) {
25+
auto payload = jsi::Object(runtime);
26+
payload.setProperty(runtime, "percent", event.percent);
27+
payload.setProperty(runtime, "offset", event.offset);
28+
payload.setProperty(runtime, "headerHeight", event.headerHeight);
29+
return payload;
30+
});
31+
}
32+
void SmartRefreshLayoutEventEmitter::onHeaderReleasing(OnHeaderReleasing event) const {
33+
dispatchEvent("headerReleasing", [event=std::move(event)](jsi::Runtime &runtime) {
34+
auto payload = jsi::Object(runtime);
35+
payload.setProperty(runtime, "percent", event.percent);
36+
payload.setProperty(runtime, "offset", event.offset);
37+
payload.setProperty(runtime, "headerHeight", event.headerHeight);
38+
return payload;
39+
});
40+
}
41+
void SmartRefreshLayoutEventEmitter::onPullDownToRefresh(OnPullDownToRefresh event) const {
42+
dispatchEvent("pullDownToRefresh", [event=std::move(event)](jsi::Runtime &runtime) {
43+
auto payload = jsi::Object(runtime);
44+
45+
return payload;
46+
});
47+
}
48+
void SmartRefreshLayoutEventEmitter::onReleaseToRefresh(OnReleaseToRefresh event) const {
49+
dispatchEvent("releaseToRefresh", [event=std::move(event)](jsi::Runtime &runtime) {
50+
auto payload = jsi::Object(runtime);
51+
52+
return payload;
53+
});
54+
}
55+
void SmartRefreshLayoutEventEmitter::onHeaderReleased(OnHeaderReleased event) const {
56+
dispatchEvent("headerReleased", [event=std::move(event)](jsi::Runtime &runtime) {
57+
auto payload = jsi::Object(runtime);
58+
59+
return payload;
60+
});
61+
}
62+
63+
64+
} // namespace react
65+
} // namespace facebook

0 commit comments

Comments
 (0)