Skip to content

Commit

Permalink
now scaling mobile interface
Browse files Browse the repository at this point in the history
  • Loading branch information
adufilie committed Oct 5, 2012
1 parent 1d8a7ee commit 97bd5e2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
18 changes: 11 additions & 7 deletions WeaveMobileClient/src/WeaveMobileClient.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,19 @@
import spark.layouts.TileOrientation;
import spark.layouts.VerticalLayout;
import weave.Weave;
import weave.api.WeaveAPI;
import weave.api.ui.ILinkableLayoutManager;
import weave.core.UIUtils;
import weave.resources._MobileDemo;
import weave.ui.BasicLinkableLayoutManager;
import weave.ui.WeavePodLayoutManager;
WeaveFonts; // this ensures the fonts get embedded.
// reference classes here so they get included in the app build
WeaveFonts;
MobileConsole;
//public var console:MobileConsole;
// public var main:MobileDemoInterface;
//public var main:BasicLinkableLayoutManager;
public var main:WeavePodLayoutManager;
public var tileLayout:TileLayout;
Expand All @@ -53,21 +55,23 @@
// this.addElement(main = new MobileDemoInterface());
// begin tile layout demo
this.addElement(main = new WeavePodLayoutManager());
/* tileLayout = new TileLayout();
this.addElement(main = new BasicLinkableLayoutManager());
tileLayout.orientation = TileOrientation.ROWS;
tileLayout.columnWidth = 220;
tileLayout.rowHeight = 220;
main.layout = tileLayout; */
// end tile layout demo
// this.addElement(main = new LinkablePodLayoutManager());
this.addElement(main = new WeavePodLayoutManager());
main.scale.value = 2;
UIUtils.linkLayoutManager(main, WeaveAPI.globalHashMap);
_MobileDemo.setXMLState(WeaveAPI.globalHashMap, _MobileDemo.full);
// _MobileDemo.setXMLState(WeaveAPI.globalHashMap, _MobileDemo.fullXML);
Weave.loadWeaveFileContent((new _MobileDemo.fullWeave()) as ByteArray);
}
public function set scale(value:Number):void { main.scaleX = main.scaleY = value; }
public function set scale(value:Number):void { main.scale.value = value; }
]]>
</fx:Script>
</s:Application>
4 changes: 3 additions & 1 deletion WeaveUISpark/src/weave/resources/_MobileDemo.as
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ package weave.resources
setSessionState(target, state);
}

[Embed(source="/weave/resources/demoFull.weave", mimeType="application/octet-stream")]
public static const fullWeave:Class;
[Embed(source="/weave/resources/demoFull.xml", mimeType="application/octet-stream")]
public static const full:Class;
public static const fullXML:Class;
[Embed(source="/weave/resources/demoGlobals.xml", mimeType="application/octet-stream")]
public static const globals:Class;
[Embed(source="/weave/resources/demoVisMap.xml", mimeType="application/octet-stream")]
Expand Down
Binary file added WeaveUISpark/src/weave/resources/demoFull.weave
Binary file not shown.
8 changes: 8 additions & 0 deletions WeaveUISpark/src/weave/ui/WeavePodLayoutManager.as
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ package weave.ui

import weave.api.core.IDisposableObject;
import weave.api.getCallbackCollection;
import weave.api.linkBindableProperty;
import weave.api.newLinkableChild;
import weave.api.registerLinkableChild;
import weave.api.ui.ILinkableLayoutManager;
import weave.core.LinkableNumber;

/**
* @author sanbalag
Expand All @@ -42,8 +46,12 @@ package weave.ui
percentWidth = 100;
percentHeight = 100;
manager.container = this;
linkBindableProperty(scale, this, 'scaleX');
linkBindableProperty(scale, this, 'scaleY');
}

public const scale:LinkableNumber = registerLinkableChild(this, new LinkableNumber(1));

private var _idToComponent:Object = {}; // String -> IVisualElement
private var _componentToId:Dictionary = new Dictionary(true); // IVisualElement -> String

Expand Down

0 comments on commit 97bd5e2

Please sign in to comment.