TouchMenu kills my settings page

Posted on
  • I really prefer TouchMenu over the default settings page. For some reason though, it messes with my app´s own settings menu. As far as i know, TouchMenu just replaces the built in E.showMenu with some custom functions. My app does not use E.showMenu, but somehow parts of the TouchMenu are still drawn. Here is my settings code:

    (function(back) {
    	Bangle.setUI("");
    	var settings = require('Storage').readJSON("contourcloc­k.json", true) || {};
    	if (settings.fontIndex==undefined) {
    	  settings.fontIndex=0;
    	  require('Storage').writeJSON("myapp.json­", settings);
    	}
      savedIndex=settings.fontIndex;
      setWatch(function() {          //save changes and return to settings menu
        require('Storage').writeJSON("contourclo­ck.json", settings);
    		g.clear();
        back();
      }, BTN, { repeat:false, edge:'falling' });
      Bangle.on('lock', function () { //discard changes and return to clock
        settings.fontIndex=savedIndex;
        require('Storage').writeJSON("contourclo­ck.json", settings);
    		g.clear();
        load();
      });
      Bangle.on('swipe', function (direction) {
    		g.clearRect(0,24,g.getWidth()-1,137); 
    		var fontName = require('contourclock').drawClock(settin­gs.fontIndex+direction);
        if (fontName) {
    			settings.fontIndex+=direction;
          g.clearRect(0,0,g.getWidth()-1,16);
    			g.setFontAlign(0,-1).drawString(fontName­,g.getWidth()/2,0);
    		 }
      });
    	g.reset();
    	g.clear();
      g.setFont("6x8:2x2").setFontAlign(0,-1);­
      g.drawString(require('contourclock').dra­wClock(settings.fontIndex),g.getWidth()/­2,0);
      g.drawString("Swipe - change",g.getWidth()/2,g.getHeight()-36)­;
    	g.drawString("BTN - save",g.getWidth()/2,g.getHeight()-18);
    })
    
    
  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

TouchMenu kills my settings page

Posted by Avatar for RaoulDuke @RaoulDuke

Actions