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

MapContainer & Tabs issue #6

Open
romancanoniero2 opened this issue Nov 2, 2016 · 9 comments
Open

MapContainer & Tabs issue #6

romancanoniero2 opened this issue Nov 2, 2016 · 9 comments

Comments

@romancanoniero2
Copy link

HI!

i find the following problem and im writing to ask you a possible solution:

i have a tabs control who shows in one of the tabs a MapContainer and in the another many containers in another one. i change between tabs with a button.

the problem its when i move the finger along the tab who cointains de items (no the map) and the map moves too, ignoring that the map its not visible in that moment.

thanks

@shannah
Copy link
Collaborator

shannah commented Nov 4, 2016

I'm going to need a test case. I can't reproduce this. Here is my test case:

package com.codename1.tests.googlemapstabs;


import com.codename1.googlemaps.MapContainer;
import com.codename1.ui.Display;
import com.codename1.ui.Form;
import com.codename1.ui.Dialog;
import com.codename1.ui.Label;
import com.codename1.ui.plaf.UIManager;
import com.codename1.ui.util.Resources;
import com.codename1.io.Log;
import com.codename1.ui.Container;
import com.codename1.ui.Tabs;
import com.codename1.ui.Toolbar;
import com.codename1.ui.layouts.BorderLayout;
import java.io.IOException;

/**
 * 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 TestGoogleMapsTabs {

    private Form current;
    private Resources theme;

    public void init(Object context) {
        theme = UIManager.initFirstTheme("/theme");

        // Enable Toolbar on all Forms by default
        Toolbar.setGlobalToolbar(true);

        // Pro only feature, uncomment if you have a pro subscription
        // Log.bindCrashProtection(true);
    }

    public void start() {
        if(current != null){
            current.show();
            return;
        }
        Form hi = new Form("Hi World");
        Tabs tabs = new Tabs();
        tabs.addTab("Tab 1", createTab("Hello tab 1"));
        tabs.addTab("Tab 2", createTab("Hello tab 2"));

        MapContainer map = new MapContainer();
        tabs.addTab("Map tab", map);

        tabs.addTab("Tab 3", createTab("Hello tab 3"));
        tabs.addTab("Tab 4", createTab("Hello tab 4"));
        hi.setLayout(new BorderLayout());
        hi.addComponent(BorderLayout.CENTER, tabs);
        hi.show();
    }

    private Container createTab(String message) {
        Container c = new Container();
        c.add(message);
        return c;
    }

    public void stop() {
        current = Display.getInstance().getCurrent();
        if(current instanceof Dialog) {
            ((Dialog)current).dispose();
            current = Display.getInstance().getCurrent();
        }
    }

    public void destroy() {
    }

}

@romancanoniero2
Copy link
Author

Steve: your code works fine, but in my app isnt. can you reproduce it from my app or you need the exact code?? the last option will be more dificult because the complexity of my app.

regards

@romancanoniero2
Copy link
Author

romancanoniero2 commented Nov 6, 2016

steve: here is a case!

first, i discover that the thing happends when you move the finger from left to right;
second: the problem is in the first tab -not in the second-, when you move the finger on the fourth blank space betweens labels
my code is:

            Tabs tabs = new Tabs();
    tabs.setSwipeActivated(false);
    tabs.addTab("Tab 1", createTab("Hello tab 1"));
    tabs.addTab("Tab 2", createTab("Hello tab 2"));

    MapContainer map = new MapContainer();
    tabs.addTab("Map tab", map);

    tabs.addTab("Tab 3", createTab("Hello tab 3"));
    tabs.addTab("Tab 4", createTab("Hello tab 4"));



     private Container createTab(String message) {
    Container c = new Container();
    c.getStyle().setBgColor(0x000000);
    c.setLayout(new BoxLayout(BoxLayout.Y_AXIS));

    for (int i=0; i<20; i++)
    {
    Label lbl=new Label(message);
    lbl.setUIID("fondoPrueba3");
    lbl.setPreferredH(60);
    lbl.getStyle().setMarginTop(50);
    c.add(lbl);
    }

    return c;
}

@romancanoniero2
Copy link
Author

can you reproduce it?

@shannah
Copy link
Collaborator

shannah commented Nov 9, 2016

Can't reproduce it. Works fine for me. Are you using the latest google maps lib?

@romancanoniero2
Copy link
Author

The libs doesnt updates whe i make a build??

Enviado desde mi iPhone

El 9 nov. 2016, a las 17:24, Steve Hannah <notifications@github.commailto:notifications@github.com> escribi?:

Can't reproduce it. Works fine for me. Are you using the latest google maps lib?

You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com//issues/6#issuecomment-259516624, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVOcrzmgdZJAlsC2TQnMNmeDk1e_WUY8ks5q8ivhgaJpZM4KnMRa.

@shannah
Copy link
Collaborator

shannah commented Nov 10, 2016

No. You need to go into the Extensions section of the CodenameOne settings, and press "Update" for the library in question. Or download the latest manually and place it in your libs directory, and then select "Refresh cn1libs".

@romancanoniero2
Copy link
Author

Steve, i done what you say but, nothing.

its possible tht i send you my app to check it? i search for everiwhere but i didnt find the bug.

thanks

@shannah
Copy link
Collaborator

shannah commented Nov 15, 2016

Don't send me a whole app. Post a test case (single file -- the one with your start() method etc..) that reproduces the issue. Let me know what version of Android, and which device to give me a better chance of reproducing it. The test case that you posted so far works perfectly (as far as I can tell) on my Nexus 5 running Android 5.0.1

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

2 participants