Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Picker/Interaction dialog doesn't appear when using desktop skin in simulator #3860

Open
shannah opened this issue Dec 15, 2024 · 0 comments

Comments

@shannah
Copy link
Collaborator

shannah commented Dec 15, 2024

Example app:

package ca.weblite.datespinnerbug;

import static com.codename1.ui.CN.*;

import com.codename1.system.Lifecycle;
import com.codename1.ui.*;
import com.codename1.ui.spinner.Picker;
import com.codename1.ui.layouts.BoxLayout;

import java.util.Calendar;
import java.util.Date;

/**
 * This file was generated by <a href="https://www.codenameone.com/">Codename One</a> for the purpose
 * of building native mobile applications using Java.
 */
public class DateSpinnerBug extends Lifecycle {
    @Override
    public void runApp() {

        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.YEAR, 2000);
        cal.set(Calendar.MONTH, 6);
        cal.set(Calendar.DATE, 31);

        Picker datePicker = new Picker();
        datePicker.setType(Display.PICKER_TYPE_DATE);
        datePicker.setStartDate(cal.getTime());
        datePicker.setEndDate(new Date());
        datePicker.setUseLightweightPopup(true);

        Picker stringPicker = new Picker();
        stringPicker.setType(Display.PICKER_TYPE_STRINGS);
        stringPicker.setStrings("A", "B", "C", "D");

        Form hi = new Form("Hi World", BoxLayout.y());
        Button helloButton = new Button("Hello World");
        hi.add(helloButton);
        hi.add(datePicker);
        hi.add(stringPicker);
        helloButton.addActionListener(e -> hello());
        hi.getToolbar().addMaterialCommandToSideMenu("Hello Command",
        FontImage.MATERIAL_CHECK, 4, e -> hello());
        hi.show();
    }

    private void hello() {
        Dialog.show("Hello Codename One", "Welcome to Codename One", "OK", null);
    }

}

When clicking on either the date picker or string picker, in the simulator with the desktop skin, the dialog does not display. It works with both the iPhone skin, and iPad skin.

Initial investigation shows that the components are added to the form okay, but they have zero or negative widths.

Looking through the git blame in code path I don't see anything recent, so this bug has been around for a while.

Testing on Windows 11, Maven, Simulator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant