Side Menu stopped working after new update - codenameone

I have an app that has a nice side menu that comes from the left, after today's update it is completely empty when it slides out and I have no idea why.
here is how I show it,
SideMenuBar smb = (SideMenuBar) Display.getInstance().getCurrent().getMenuBar();
smb.openMenu(null);
Here is how it is created (remember this worked perfectly until today when I updated libs):
private void addSideMenuToLeft(Form f)
{
_("addSideMenuToLeft");
//make a toolbarForLeftMenu so we can use its sidemenu (we can only have one on the left!)
if (toolbarForLeftMenu==null)
{
toolbarForLeftMenu = new Toolbar();
}
toolbarForLeftMenu.setHidden(true);
f.setToolbar(toolbarForLeftMenu);
if (SideMenuLEFT==null) //otherwise it keeps adding each time
{
SideMenuLEFT = (Container)this.createContainer(resources, "SideMenuLEFT");
SideMenuLEFT.setWidth(Display.getInstance().getDisplayWidth()/2);
SideMenuLEFT.setHeight((Display.getInstance().getDisplayHeight()));
SideMenuLEFT.setUIID("SideNavigationPanel");//so we get the nice background.
toolbarForLeftMenu.setUIID("Container");
toolbarForLeftMenu.addComponentToSideMenu(SideMenuLEFT);
//make each button live, there are 2 buttons the icon and the words, for each one
Button btCategory = (Button) Tools.findByNameX("btCategory", SideMenuLEFT,sm );
btCategory.addActionListener(new ActionListener(){
#Override
public void actionPerformed(ActionEvent evt) {
}
});
_("made left menu");
}
}

We deprecated the SideMenuBar and replaced it with the new on-top side menu. It was announced multiple times and discussed quite a bit.
To disable this and use the "old" functionality you can use:
Toolbar.setOnTopSideMenu(false);

Related

Element not found. How to test sequence of steps in multi-page WPF app with winappdriver?

I have a WPF application that features several pages. Navigation takes place after selecting some of the buttons. I am able to start the testing session successfully and to find elements in the main window. However, when clicking the "OK" button that should trigger navigation to another page, the app does not navigate and the test case fails to find UI elements in the next page. I have tried ImplicitWait and Thread.Sleep but the elements still cannot be found. It seems like the app does not navigate at all when the button is clicked.
Any ideas on how to tackle this issue? Below is what I have accomplished so far:
namespace TestDAAC
{
[TestClass]
public class UnitTests
{
protected const string WINAPPDRIVER_URL = "http://127.0.0.1:4723";
private const string DAAC_APP_ID = #"C:\Users\Admin\Desktop\VC PROJECTS\daac\DAAC\bin\x64\Release\DAAC5.exe";
protected static WindowsDriver<WindowsElement> daacSession;
[ClassInitialize]
public static void Setup(TestContext context)
{
if (daacSession == null)
{
var appiumOptions = new AppiumOptions();
appiumOptions.AddAdditionalCapability("app", DAAC_APP_ID);
appiumOptions.AddAdditionalCapability("deviceName", "WindowsPC");
daacSession = new WindowsDriver<WindowsElement>(new Uri(WINAPPDRIVER_URL), appiumOptions);
}
}
[TestMethod]
public void SequenceOfSteps()
{
daacSession.FindElementByName("OK").Click();
Thread.Sleep(5000);
// daacSession.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
daacSession.FindElementByName("New Imaging Session").Click();
}
}
}
I was able to find the reason why my test cases were not working. WinAppDriver is compatible only with Windows 10 Home or Pro. My target device runs on Windows Enterprise.

Styling command in onTop side menu

What we do in commnads in older side menu is that we put the "uiid" in putClientProperty() method but it doesn't work in ontop side menu. How to style it?
Command services = new Command(" Services", servicesIcon) {
#Override
public void actionPerformed(ActionEvent evt) {
}
};
f.getToolbar().addCommandToSideMenu(services);
services.putClientProperty("uiid", "commandProp");
It still works but because the side menu is constructed eagerly instead of lazily you don't see this.
Instead of this:
f.getToolbar().addCommandToSideMenu(services);
services.putClientProperty("uiid", "commandProp");
Do:
services.putClientProperty("uiid", "commandProp");
f.getToolbar().addCommandToSideMenu(services);

add pull2refresh to tabs in codenameone

i have added the following codes for pull2refresh but the run method is not called. I have tested for form and its ok for form. How to make it workable for tabs so that I can update all tab at once . and I have pull2refresh of form for whole for refresh.
findTabs1(f).getContentPane().addPullToRefresh(new Runnable() {
#Override
public void run() {
// throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
//
}
});
Tab doesn't have contentPane but TabbedPane.
To add pullToRefresh to a tab, you should add it to the container you added to the tab and it must be scrollable-Y.
Instead of findTabs1(f).getContentPane().addPullToRefresh do findMyContainerInsideTab().addPullToRefresh

Why Doesn't My Component Appear On Top of The HTML Page Or Media Player In Codename One

I've used a media player and I'm trying to do rendering on top of it with progress indication or buttons but the code isn't working.
E.g.:
findInfiniteProgress().setVisible(true);
Timer timer = new Timer();
TimerTask timerTask = new TimerTask() {
#Override
public void run() {
Display.getInstance().callSerially(new Runnable() {
#Override
public void run() {
if(findMediaPlayer().getMedia() != null && findMediaPlayer().getMedia().isPlaying()){
findInfiniteProgress(f).setVisible(false);
}else{
findInfiniteProgress(f).setVisible(true);
}
}
});
}
};
Codename One uses lightweight rendering which means all components are drawn in sequence on a single thread. Native widgets (peers) need to be drawn on the native thread and are always drawn on top, that is the secret to Codname Ones portability explained here.
Common peers in Codename One include: Web browser, media playback & native maps.
The workaround is to use Dialog which is effectively a separate Form so the current peer doesn't really render underneath.

codename one remove back button on ios

I removed the title of the form because I don't want it. when I did that, a back button on the iOS(On android back button does not show) started to show on the bottom of the form.
I've tried to override showForm() in the StateMachine and invoke setTitle("") but the back button is still there.
#Override
public Form showForm(String resourceName, Command sourceCommand) {
Form f = super.showForm(resourceName, sourceCommand);
f.setTitle("");
return f;
};
Is there a way to remove that back button?
That's not the way. Override allowBackTo as:
protected boolean allowBackTo(String formName) {
return false;
}

Resources