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

Method init

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

Source from the content-addressed store, hash-verified

6namespace bdn::ui::android
7{
8 void ViewCore::init()
9 {
10 if (View::debugViewEnabled()) {
11 int bgColor = 0xFF000000 + (std::rand() % 0x00FFFFFF);
12 _jView.setBackgroundColor(bgColor);
13 }
14
15 _uiScaleFactor = 1;
16
17 visible.onChange() += [=](auto &property) {
18 _jView.setVisibility(property.get() ? bdn::android::wrapper::View::VISIBLE
19 : bdn::android::wrapper::View::INVISIBLE);
20 };
21
22 geometry.onChange() += [=](auto) { updateGeometry(); };
23
24 backgroundColor.onChange() += [=](auto &property) {
25 auto color = property.get();
26 if (color) {
27 _jView.setBackgroundColor(*color);
28 } else {
29 _jView.setBackgroundColor(Color(0x0));
30 }
31 };
32
33 bdn::android::wrapper::NativeViewCoreLayoutChangeListener layoutChangeListener;
34 getJView().addOnLayoutChangeListener(layoutChangeListener);
35
36 initTag();
37 }
38
39 ViewCore::~ViewCore()
40 {

Callers 2

makeCoreMethod · 0.45
appEntryFunction · 0.45

Calls 2

ColorClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected