I've noticed using the latest build of Codename one.
When my sidemenu (hamburger menu) is on the right hand side, the shadow image is flipped.
Seems to be the case on the simulator and Android and iOS.
I seem to remember I had to put in a work around to get this working recently, but that work-around doesn't seem to work anymore.
I tried to replace the imahe using the theme constants, and also to turn it off by setting sideMenuShadowBool to false. but neither of these seem to do anything anymore.
Screenshot:
Code snipit (called on beforeShow for each form):
private void setupTitleBar(Form f, FormController fc) {
if (handler == null) {
handler = new MenuHandler();
sm.addCommandListener(handler);
}
for (int c = 0; c < f.getCommandCount(); c++) {
f.removeCommand(f.getCommand(c));
}
Toolbar tb = new Toolbar();
f.setToolbar(tb);
fc.setupTitlebar(tb);
String formName = f.getName();
if (!"Main".equals(formName)
&& !"Signup".equals(formName)
&& !"MyCards".equals(formName)
&& !("Orders".equals(formName) && !ModuleManager.isModuleEnabled(ModuleManager.LOYALTY))) {
Command back = new Command("", sm.getImage("back.png"), BACK);
back.putClientProperty("TitleCommand", true);
f.setBackCommand(back);
tb.addCommandToLeftBar(back);
}
if (!"Main".equals(formName)
&& !"Signup".equals(formName)) {
addSideCommand("Logout", "LogoutSideOption", LOGOUT, e->logoutUser(), tb);
addSideCommand("View T&Cs", "TnCSideOption", TANDC, e->showTandCs(), tb);
addSideCommand("Reset Tutorials", "TnCSideOption", CLEAR_TUTORIAL, e->clearTutorial(), tb);
}
}
private void addSideCommand(String name, String udid, int commandID, ActionListener event, Toolbar tb) {
Command command = new Command(name, null, commandID);
command.putClientProperty(SideMenuBar.COMMAND_PLACEMENT_KEY, SideMenuBar.COMMAND_PLACEMENT_VALUE_RIGHT);
Button comandLabel = new Button(name);
comandLabel.setUIID(udid);
command.putClientProperty(SideMenuBar.COMMAND_SIDE_COMPONENT, comandLabel);
tb.addCommandToSideMenu(command);
comandLabel.addActionListener(event);
}
This issue should be resolved and will be in the release this Friday (June 3rd 2016)
来源:https://stackoverflow.com/questions/37475286/codename-one-right-side-menu-shadow-is-flipped