Skip to content

Commit 7be09fc

Browse files
committed
feat: expose custom shadow nodes
1 parent 314be9d commit 7be09fc

6 files changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.reactnativekeyboardcontroller
2+
3+
import com.facebook.react.bridge.ReactApplicationContext
4+
import com.facebook.react.uimanager.ThemedReactContext
5+
import com.facebook.react.uimanager.ViewGroupManager
6+
import com.facebook.react.uimanager.ViewManagerDelegate
7+
import com.facebook.react.viewmanagers.KeyboardToolbarExcludeViewManagerDelegate
8+
import com.facebook.react.viewmanagers.KeyboardToolbarExcludeViewManagerInterface
9+
import com.reactnativekeyboardcontroller.managers.KeyboardToolbarExcludeViewManagerImpl
10+
import com.reactnativekeyboardcontroller.views.KeyboardToolbarExcludeReactViewGroup
11+
import com.reactnativekeyboardcontroller.views.overlay.OverKeyboardHostView
12+
13+
class KeyboardToolbarExcludeViewManager(
14+
mReactContext: ReactApplicationContext,
15+
) : ViewGroupManager<KeyboardToolbarExcludeReactViewGroup>(),
16+
KeyboardToolbarExcludeViewManagerInterface<OverKeyboardHostView> {
17+
private val manager = KeyboardToolbarExcludeViewManagerImpl(mReactContext)
18+
private val mDelegate = KeyboardToolbarExcludeViewManagerDelegate(this)
19+
20+
override fun getDelegate(): ViewManagerDelegate<KeyboardToolbarExcludeReactViewGroup> = mDelegate
21+
22+
override fun getName(): String = KeyboardToolbarExcludeViewManagerImpl.NAME
23+
24+
override fun createViewInstance(context: ThemedReactContext): KeyboardToolbarExcludeReactViewGroup =
25+
manager.createViewInstance(context)
26+
}

android/src/main/jni/RNKC.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <react/renderer/components/RNKC/RNKCOverKeyboardViewComponentDescriptor.h>
1616
#include <react/renderer/components/RNKC/RNKCKeyboardBackgroundViewComponentDescriptor.h>
1717
#include <react/renderer/components/RNKC/RNKCClippingScrollViewDecoratorViewComponentDescriptor.h>
18+
#include <react/renderer/components/RNKC/RNKCKeyboardToolbarExcludeViewComponentDescriptor.h>
1819

1920
#include <memory>
2021
#include <string>

common/cpp/react/renderer/components/RNKC/RNKCKeyboardToolbarExcludeViewShadowNode.h

Whitespace-only changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#pragma once
2+
3+
#ifdef ANDROID
4+
#include <folly/dynamic.h>
5+
#endif
6+
7+
namespace facebook::react {
8+
9+
class KeyboardToolbarExcludeViewState {
10+
public:
11+
KeyboardToolbarExcludeViewState() = default;
12+
13+
#ifdef ANDROID
14+
KeyboardToolbarExcludeViewState(KeyboardToolbarExcludeViewState const &previousState, folly::dynamic data) {}
15+
folly::dynamic getDynamic() const {
16+
return {};
17+
}
18+
#endif
19+
};
20+
21+
} // namespace facebook::react

react-native.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
"OverKeyboardViewComponentDescriptor",
99
"KeyboardBackgroundViewComponentDescriptor",
1010
"ClippingScrollViewDecoratorViewComponentDescriptor",
11+
"KeyboardToolbarExcludeViewComponentDescriptor",
1112
],
1213
cmakeListsPath: "../android/src/main/jni/CMakeLists.txt",
1314
},

src/specs/KeyboardToolbarExcludeViewNativeComponent.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ export interface NativeProps extends ViewProps {}
77

88
export default codegenNativeComponent<NativeProps>(
99
"KeyboardToolbarExcludeView",
10+
{
11+
interfaceOnly: true,
12+
},
1013
) as HostComponent<NativeProps>;

0 commit comments

Comments
 (0)