简体   繁体   English

GWT Switch小部件实现(Android样式的复选框)

[英]GWT Switch widget implementation (Android styled Checkbox)

I need to develop a checkbox widget which should look like an android styled Switch widget. 我需要开发一个复选框小部件,其外观应类似于android风格的Switch小部件。 This widget should be stateful (Should keep true-false values). 此小部件应为有状态的(应保留true-false值)。

Just because of this, I don't want to inherit a whole new library like https://gwtmaterialdesign.github.io/gwt-material-demo/#switches 正因为如此,我不想继承一个全新的库,例如https://gwtmaterialdesign.github.io/gwt-material-demo/#switches

Does anyone have a ready made code to achieve this? 有没有人有现成的代码来实现这一目标? A required java class + CSS change. 必需的Java类+ CSS更改。

I have tried mGWT and GWT Material design libraries. 我已经尝试了mGWT和GWT材质设计库。 But The aim is not to inherit any external libraries just for the sake of one tiny widget. 但是其目的不是仅仅为了一个小部件而继承任何外部库。

我正在寻找的图像

have you checked domino-ui it has a similar checkbox/switch button and the library is really very lightweight, you can even look at the code and re-implement it, the source can be found here and you can see it in action here scroll down to switch button section. 你检查Domino的用户界面也有类似的复选框/开关按钮和库真的很轻巧,你甚至可以查看代码并重新实现它,源,可以发现在这里 ,你可以在行动中看到它在这里滚动向下切换按钮部分。

investigate the code and copy the css if need. 研究代码,并在需要时复制CSS。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM