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

Method updateContent

framework/ui/platforms/android/src/ScrollViewCore.cpp:197–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195 }
196
197 void ScrollViewCore::updateContent(const std::shared_ptr<View> &content)
198 {
199 _childGeometry.reset();
200 _jContentParent.removeAllViews();
201
202 if (auto childCore = contentView->core<android::ViewCore>()) {
203 _jContentParent.addView(childCore->getJView());
204 _childGeometry = std::make_unique<Property<Rect>>();
205 _childGeometry->bind(childCore->geometry, BindMode::unidirectional);
206 _childGeometry->onChange() += [=](auto &property) {
207 _jContentParent.setSize(std::lround(property.get().width * getUIScaleFactor()),
208 std::lround(property.get().height * getUIScaleFactor()));
209 };
210 } else {
211 throw std::runtime_error("Cannot add Child with this type of core");
212 }
213
214 updateChildren();
215 }
216
217 void ScrollViewCore::updateGeometry()
218 {

Callers

nothing calls this directly

Calls 4

addViewMethod · 0.80
setSizeMethod · 0.80
bindMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected