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

Method SwitchCore

framework/ui/platforms/android/src/SwitchCore.cpp:11–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9{
10
11 SwitchCore::SwitchCore(const std::shared_ptr<ViewCoreFactory> &viewCoreFactory)
12 : ViewCore(viewCoreFactory, createAndroidViewClass<bdn::android::wrapper::Switch>(viewCoreFactory)),
13 _jSwitch(getJViewAS<bdn::android::wrapper::Switch>())
14 {
15 _jSwitch.setSingleLine(true);
16
17 label.onChange() += [=](auto &property) {
18 _jSwitch.setText(property.get());
19 scheduleLayout();
20 };
21
22 on.onChange() += [=](auto &property) { _jSwitch.setChecked(property.get()); };
23
24 bdn::android::wrapper::NativeViewCoreClickListener listener;
25 _jSwitch.setOnClickListener(listener.cast<bdn::android::wrapper::OnClickListener>());
26 }
27
28 void SwitchCore::clicked()
29 {

Callers

nothing calls this directly

Calls 3

setOnClickListenerMethod · 0.80
setTextMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected