| 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 | { |
nothing calls this directly
no test coverage detected