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

Method init

framework/ui/platforms/android/src/WindowCore.cpp:60–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58 }
59
60 void WindowCore::init()
61 {
62 ViewCore::init();
63
64 title.onChange() += [=](auto &property) {
65 bdn::android::wrapper::NativeRootView rootView(getJView().getParent().getRef_());
66 rootView.setTitle(property.get());
67 };
68
69 bdn::android::wrapper::NativeRootView rootView(getJView().getParent().getRef_());
70
71 _weakRootViewRef = bdn::java::WeakReference(rootView.getRef_());
72
73 updateUIScaleFactor(rootView.getContext().getResources().getConfiguration());
74 updateOrientation(rootView.getContext().getResources().getConfiguration());
75
76 rootViewSizeChanged(rootView.getWidth(), rootView.getHeight());
77
78 contentView.onChange() += [=](auto &property) { updateContent(property.get()); };
79
80 allowedOrientations.onChange() += [=](auto &property) {
81 bdn::android::wrapper::Activity activity(getJView().getContext().getRef_());
82
83 if (property.get() == Window::Core::Orientation::All) {
84 activity.setRequestedOrientation(bdn::android::wrapper::ActivityInfo::SCREEN_ORIENTATION_FULL_USER);
85 } else if (property.get() & Window::Core::Orientation::PortraitMask) {
86 activity.setRequestedOrientation(bdn::android::wrapper::ActivityInfo::SCREEN_ORIENTATION_USER_PORTRAIT);
87 } else if (property.get() & Window::Core::Orientation::LandscapeMask) {
88 activity.setRequestedOrientation(
89 bdn::android::wrapper::ActivityInfo::SCREEN_ORIENTATION_USER_LANDSCAPE);
90 }
91 };
92 }
93
94 void WindowCore::initTag()
95 {

Callers

nothing calls this directly

Calls 6

WeakReferenceClass · 0.85
getRef_Method · 0.80
setTitleMethod · 0.80
getWidthMethod · 0.80
getMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected