Created
January 29, 2016 20:38
-
-
Save codenameone/d0491ce08ce6b889bbd5 to your computer and use it in GitHub Desktop.
A rather elaborate sampleto show off the layered layout Codename One API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Form hi = new Form("Layered Layout"); | |
int w = Math.min(Display.getInstance().getDisplayWidth(), Display.getInstance().getDisplayHeight()); | |
Button settingsLabel = new Button(""); | |
Style settingsStyle = settingsLabel.getAllStyles(); | |
settingsStyle.setFgColor(0xff); | |
settingsStyle.setBorder(null); | |
settingsStyle.setBgColor(0xff00); | |
settingsStyle.setBgTransparency(255); | |
settingsStyle.setFont(settingsLabel.getUnselectedStyle().getFont().derive(w / 3, Font.STYLE_PLAIN)); | |
FontImage.setMaterialIcon(settingsLabel, FontImage.MATERIAL_SETTINGS); | |
Button close = new Button(""); | |
close.setUIID("Container"); | |
close.getAllStyles().setFgColor(0xff0000); | |
FontImage.setMaterialIcon(close, FontImage.MATERIAL_CLOSE); | |
hi.add(LayeredLayout.encloseIn(settingsLabel, | |
FlowLayout.encloseRight(close))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample usage code for LayeredLayout
From the Codename One project