GithubHelp home page GithubHelp logo

Comments (11)

bitfabrikken avatar bitfabrikken commented on August 23, 2024

I too have the crashing problem.

I'm just not sure if it's only with NappDrawer it happens, but it does happen.
Apparantly according to the following it has to do with the Holo theme.

A Q&A here discusses it in more detail: http://developer.appcelerator.com/question/151567/google-maps-v2-module-crashes-when-view-placed-in-tab-group

And a bugticket on JIRA here: https://jira.appcelerator.org/browse/TIMODOPEN-230

Another JIRA: https://jira.appcelerator.org/browse/TIMOB-13864

The tickets appear to be largely ignored by Appcelerator though, so it would be nice if we could find a solution for this!

My temporary workaround has been to create a new view and add the map to that. Then I replace the existing centerView with this new one. This seems the prevent the crash.

from nappdrawer.

shufaz avatar shufaz commented on August 23, 2024

Here's my simple code:

var NappDrawerModule = require('dk.napp.drawer');
var MapModule = require('ti.map');

var leftMenuView = Ti.UI.createView({
backgroundColor:'red',
});

var centerView = Ti.UI.createView({
backgroundColor:'blue',
});

var mapView = MapModule.createView({
userLocation: true,
mapType: MapModule.NORMAL_TYPE,
animate: true,
region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 },
height:'100%',
width:'100%',
});
centerView.add(mapView);

var mainWindow = NappDrawerModule.createDrawer({
leftWindow:leftMenuView,
centerWindow:centerView,
leftDrawerWidth: "260dp",
navBarHidden:true,
});
mainWindow.open();

bitfabrikken, is your workaround something like this? It's still crashing... all the time. I have no problem with the map alone...

from nappdrawer.

bitfabrikken avatar bitfabrikken commented on August 23, 2024

Added a bit to your example code, which makes it work.. But it's weird.

var NappDrawerModule = require('dk.napp.drawer');
var MapModule = require('ti.map');

var leftMenuView = Ti.UI.createView({
    backgroundColor:'red',
});

var centerView = Ti.UI.createView({
    backgroundColor:'blue',
});

var mapView = MapModule.createView({
    userLocation: true,
    mapType: MapModule.NORMAL_TYPE,
    animate: true,
    region: {latitude: -33.87365, longitude: 151.20689, latitudeDelta: 0.1, longitudeDelta: 0.1 }, 
    height:'100%',
    width:'100%',
});
//centerView.add(mapView); //don't add mapView yet!

var mainWindow = NappDrawerModule.createDrawer({
    leftWindow:leftMenuView,
    centerWindow:centerView,
    leftDrawerWidth: "260dp",
    navBarHidden:true,
});
mainWindow.open();

//for some reason, this works..
mainWindow.addEventListener('open',function(){
    var new_view = Ti.UI.createView({
        backgroundColor:'purple',
    });
    mainWindow.setCenterWindow(new_view);   
    setTimeout(function(){
        new_view.add(mapView);
    },1000);    
});

from nappdrawer.

shufaz avatar shufaz commented on August 23, 2024

Hey it works!! Thanks a lot for the workaround, bitfabrikken! Yes it is a bit weird, but it'll do for now until a better solution comes out. Thanks again.

from nappdrawer.

shufaz avatar shufaz commented on August 23, 2024

Update: Unfortunately, this doesn't work on newer android devices. I tried on Samsung Galaxy W, Android 2.3... it works just fine, but when tried on S3 and Note 3, it crashes everytime...

from nappdrawer.

bitfabrikken avatar bitfabrikken commented on August 23, 2024

The fix works for me on Nexus 4, Nexus 5 and Nexus 7 (the first model).

from nappdrawer.

bitfabrikken avatar bitfabrikken commented on August 23, 2024

@viezel - do you have any ideas on this issue? Maybe it's not your module, but the module it's built on? Or maybe a general Titanium thing?

from nappdrawer.

viezel avatar viezel commented on August 23, 2024

im almost sure it has nothing to do with my module. I know their are certain bugs in jira regarding the new map module.
If you look at the source code for NappDrawer you will find that I open 3 views and do some custom animations to make them slide in and out. Thats about it. nothing super fancy, that should break google maps.

from nappdrawer.

Brian-McBride avatar Brian-McBride commented on August 23, 2024

Viezel,

I know you closed this issue, but regardless of what solution I use posted, I cannot get a map drawn in the centerView without crashing the app. I can put it on a setInterval delay of 5000ms and still, once the add method is called - crash.

This is a bit of the XML I used in the alloy to set the main view area:

















from nappdrawer.

albert0m avatar albert0m commented on August 23, 2024

this is still happening, did anyone find a workaround?

from nappdrawer.

Max87ZA avatar Max87ZA commented on August 23, 2024

I have this problem for a long time and finally @bitfabrikken solution works for me. Important thing is, that you have to add mapView after drawer opens.

from nappdrawer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.