-
-
Notifications
You must be signed in to change notification settings - Fork 153
Expand file tree
/
Copy pathRNKCOverKeyboardViewComponentDescriptor.h
More file actions
31 lines (24 loc) · 1018 Bytes
/
RNKCOverKeyboardViewComponentDescriptor.h
File metadata and controls
31 lines (24 loc) · 1018 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once
#include "RNKCOverKeyboardViewShadowNode.h"
#include <react/debug/react_native_assert.h>
#include <react/renderer/components/keyboardcontroller/Props.h>
#include <react/renderer/core/ConcreteComponentDescriptor.h>
namespace facebook::react {
class OverKeyboardViewComponentDescriptor final
: public ConcreteComponentDescriptor<OverKeyboardViewShadowNode> {
public:
using ConcreteComponentDescriptor::ConcreteComponentDescriptor;
void adopt(ShadowNode &shadowNode) const override {
auto& layoutableShadowNode =
static_cast<YogaLayoutableShadowNode&>(shadowNode);
auto& stateData =
static_cast<const OverKeyboardViewShadowNode::ConcreteState&>(
*shadowNode.getState())
.getData();
layoutableShadowNode.setSize(
Size{stateData.screenSize.width, stateData.screenSize.height});
layoutableShadowNode.setPositionType(YGPositionTypeAbsolute);
ConcreteComponentDescriptor::adopt(shadowNode);
}
};
} // namespace facebook::react