MCPcopy Create free account
hub / github.com/AshampooSystems/boden / updateGeometry

Method updateGeometry

framework/ui/platforms/android/src/ViewCore.cpp:139–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137 }
138
139 void ViewCore::updateGeometry()
140 {
141 bdn::JavaObject parent(_jView.getParent().getRef_());
142 Rect rGeometry = geometry;
143
144 if (parent.isNull_()) {
145 auto thisViewAsNativeGroup = getJViewAS<bdn::android::wrapper::NativeViewGroup>();
146 if (thisViewAsNativeGroup.isInstanceOf_(bdn::android::wrapper::NativeViewGroup::javaClass())) {
147 thisViewAsNativeGroup.setSize((int)(rGeometry.width * _uiScaleFactor),
148 (int)(rGeometry.height * _uiScaleFactor));
149 }
150 } else {
151 bdn::android::wrapper::NativeViewGroup parentView(parent.getRef_());
152 if (parentView.isInstanceOf_(bdn::android::wrapper::NativeViewGroup::javaClass())) {
153 parentView.setChildBounds(getJView(), (int)(rGeometry.x * _uiScaleFactor),
154 (int)(rGeometry.y * _uiScaleFactor), (int)(rGeometry.width * _uiScaleFactor),
155 (int)(rGeometry.height * _uiScaleFactor));
156 } else {
157 _jView.layout((int)(rGeometry.x * _uiScaleFactor), (int)(rGeometry.y * _uiScaleFactor),
158 (int)(rGeometry.width * _uiScaleFactor), (int)(rGeometry.height * _uiScaleFactor));
159 }
160 }
161 }
162
163 std::shared_ptr<ViewCore> viewCoreFromJavaViewRef(const java::Reference &javaViewRef)
164 {

Callers

nothing calls this directly

Calls 6

getRef_Method · 0.80
isNull_Method · 0.80
isInstanceOf_Method · 0.80
setSizeMethod · 0.80
setChildBoundsMethod · 0.80
layoutMethod · 0.45

Tested by

no test coverage detected