Trying get rid of the scroll bars
- moved view classes instanciation into CREATION_COMPLETE triggered methods
This commit is contained in:
@@ -35,7 +35,7 @@ class ToolbarToggleButton extends ToggleButton {
|
|||||||
iconSize = pIconSize;
|
iconSize = pIconSize;
|
||||||
textSize = pTextSize;
|
textSize = pTextSize;
|
||||||
|
|
||||||
traceRed("iconSize : " + iconSize + " / textSize : " + textSize);
|
//traceRed("iconSize : " + iconSize + " / textSize : " + textSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
override private function initialize():Void {
|
override private function initialize():Void {
|
||||||
|
|||||||
@@ -46,6 +46,6 @@ class MainDrawer extends Drawer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function onCreationComplete(event:FeathersEvent):Void {
|
private function onCreationComplete(event:FeathersEvent):Void {
|
||||||
traceBlue(this + " --> onCreationComplete()");
|
traceBlue(this + " --> onCreationComplete() - w: " + width + " h: " + height );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,12 @@ class MainFooter extends LayoutGroup {
|
|||||||
var hdl:HorizontalDistributedLayout = new HorizontalDistributedLayout();
|
var hdl:HorizontalDistributedLayout = new HorizontalDistributedLayout();
|
||||||
layout = hdl;
|
layout = hdl;
|
||||||
|
|
||||||
// Buttons
|
}
|
||||||
|
|
||||||
|
private function onCreationComplete(event:FeathersEvent):Void {
|
||||||
|
traceBlue(this + " --> onCreationComplete() - w: " + width + " h: " + height );
|
||||||
|
|
||||||
|
// Buttons
|
||||||
btn1 = new ToolbarToggleButton(Assets.getText("vector/rider_icon_black.svg"),
|
btn1 = new ToolbarToggleButton(Assets.getText("vector/rider_icon_black.svg"),
|
||||||
Constants.MAIN_COLOR2,
|
Constants.MAIN_COLOR2,
|
||||||
Constants.HERO_COLOR,
|
Constants.HERO_COLOR,
|
||||||
@@ -49,10 +54,4 @@ class MainFooter extends LayoutGroup {
|
|||||||
addChild(btn2);
|
addChild(btn2);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function onCreationComplete(event:FeathersEvent):Void {
|
|
||||||
traceBlue(this + " --> onCreationComplete()");
|
|
||||||
trace(height);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-18
@@ -1,6 +1,5 @@
|
|||||||
package view;
|
package view;
|
||||||
|
|
||||||
import feathers.skins.RectangleSkin;
|
|
||||||
import com.adobe.cairngorm.control.CairngormEvent;
|
import com.adobe.cairngorm.control.CairngormEvent;
|
||||||
import com.adobe.cairngorm.control.CairngormEventDispatcher;
|
import com.adobe.cairngorm.control.CairngormEventDispatcher;
|
||||||
import components.IconButton;
|
import components.IconButton;
|
||||||
@@ -11,6 +10,7 @@ import feathers.controls.LayoutGroup;
|
|||||||
import feathers.events.FeathersEvent;
|
import feathers.events.FeathersEvent;
|
||||||
import feathers.events.TriggerEvent;
|
import feathers.events.TriggerEvent;
|
||||||
import feathers.layout.HorizontalLayout;
|
import feathers.layout.HorizontalLayout;
|
||||||
|
import feathers.skins.RectangleSkin;
|
||||||
import feathers.text.TextFormat;
|
import feathers.text.TextFormat;
|
||||||
import model.Constants;
|
import model.Constants;
|
||||||
import openfl.Assets;
|
import openfl.Assets;
|
||||||
@@ -22,6 +22,11 @@ class MainHeader extends LayoutGroup {
|
|||||||
private var btn1:Button;
|
private var btn1:Button;
|
||||||
private var lbl1:Label;
|
private var lbl1:Label;
|
||||||
|
|
||||||
|
private var sw:Int;
|
||||||
|
private var sh:Int;
|
||||||
|
private var headerWidth:Int;
|
||||||
|
private var headerHeight:Int;
|
||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
@@ -31,10 +36,10 @@ class MainHeader extends LayoutGroup {
|
|||||||
override private function initialize():Void {
|
override private function initialize():Void {
|
||||||
super.initialize();
|
super.initialize();
|
||||||
|
|
||||||
final sw:Int = stage.stageWidth;
|
sw = stage.stageWidth;
|
||||||
final sh:Int = stage.stageHeight;
|
sh = stage.stage.stageHeight;
|
||||||
final headerWidth = Std.int(sw * Constants.MAIN_HEADER_WIDTH_RATIO);
|
headerWidth = Std.int(sw * Constants.MAIN_HEADER_WIDTH_RATIO);
|
||||||
final headerHeight = Std.int(sh * Constants.MAIN_HEADER_HEIGHT_RATIO);
|
headerHeight = Std.int(sh * Constants.MAIN_HEADER_HEIGHT_RATIO);
|
||||||
|
|
||||||
autoSizeMode = CONTENT;
|
autoSizeMode = CONTENT;
|
||||||
backgroundSkin = new RectangleSkin(SolidColor(Constants.HERO_COLOR, 1));
|
backgroundSkin = new RectangleSkin(SolidColor(Constants.HERO_COLOR, 1));
|
||||||
@@ -42,36 +47,31 @@ class MainHeader extends LayoutGroup {
|
|||||||
|
|
||||||
// Layout settings
|
// Layout settings
|
||||||
var l:HorizontalLayout = new HorizontalLayout();
|
var l:HorizontalLayout = new HorizontalLayout();
|
||||||
l.paddingLeft = l.paddingRight = Std.int(headerHeight * .3);
|
l.paddingLeft = l.paddingRight = Std.int(headerHeight * .1);
|
||||||
l.paddingTop = l.paddingBottom = Std.int(headerHeight * .2);
|
l.paddingTop = l.paddingBottom = Std.int(headerHeight * .1);
|
||||||
l.verticalAlign = MIDDLE;
|
//l.verticalAlign = MIDDLE;
|
||||||
layout = l;
|
layout = l;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onCreationComplete(event:FeathersEvent):Void {
|
||||||
|
traceBlue(this + " --> onCreationComplete() - w: " + width + " h: " + height );
|
||||||
|
|
||||||
// Menu button
|
// Menu button
|
||||||
var svgIconString:String = Assets.getText("vector/menu_icon_black.svg");
|
var svgIconString:String = Assets.getText("vector/menu_icon_black.svg");
|
||||||
btn1 = new IconButton(svgIconString, Constants.MAIN_COLOR3);
|
btn1 = new IconButton(svgIconString, Constants.MAIN_COLOR3);
|
||||||
|
|
||||||
btn1.addEventListener(TriggerEvent.TRIGGER, onMenuButtonPress);
|
btn1.addEventListener(TriggerEvent.TRIGGER, onMenuButtonPress);
|
||||||
addChild(btn1);
|
addChild(btn1);
|
||||||
|
|
||||||
// Title label
|
// Title label
|
||||||
lbl1 = new Label();
|
lbl1 = new Label();
|
||||||
//lb1.backgroundSkin = new RectangleSkin(SolidColor(Constants.ACCENT_COLOR2, 1));
|
|
||||||
|
|
||||||
//lb1.verticalAlign = VerticalAlign.TOP;
|
|
||||||
lbl1.text = Constants.MENU_ITEM_0_STRING;
|
lbl1.text = Constants.MENU_ITEM_0_STRING;
|
||||||
lbl1.embedFonts = true;
|
lbl1.embedFonts = true;
|
||||||
var fnt:Font = Assets.getFont(Constants.MONTSERRAT_MEDIUM_500);
|
var fnt:Font = Assets.getFont(Constants.MONTSERRAT_MEDIUM_500);
|
||||||
|
|
||||||
lbl1.textFormat = new TextFormat(fnt.fontName, Std.int(headerHeight * .4), Constants.MAIN_COLOR3);
|
lbl1.textFormat = new TextFormat(fnt.fontName, Std.int(headerHeight * .4), Constants.MAIN_COLOR3);
|
||||||
addChild(lbl1);
|
addChild(lbl1);
|
||||||
}
|
|
||||||
|
|
||||||
private function onCreationComplete(event:FeathersEvent):Void {
|
|
||||||
traceBlue(this + " --> onCreationComplete()");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function onMenuButtonPress(e:TriggerEvent):Void {
|
function onMenuButtonPress(e:TriggerEvent):Void {
|
||||||
var e:CairngormEvent = new CairngormEvent(AppController.OPEN_DRAWER_EVENT);
|
var e:CairngormEvent = new CairngormEvent(AppController.OPEN_DRAWER_EVENT);
|
||||||
CairngormEventDispatcher.getInstance().dispatchEvent(e);
|
CairngormEventDispatcher.getInstance().dispatchEvent(e);
|
||||||
|
|||||||
+6
-11
@@ -28,6 +28,11 @@ class MainPanel extends Panel {
|
|||||||
autoSizeMode = STAGE;
|
autoSizeMode = STAGE;
|
||||||
backgroundSkin = new RectangleSkin(SolidColor(Constants.MAIN_COLOR2, 1));
|
backgroundSkin = new RectangleSkin(SolidColor(Constants.MAIN_COLOR2, 1));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function onCreationComplete(event:FeathersEvent):Void {
|
||||||
|
traceBlue(this + " --> onCreationComplete() - w: " + width + " h: " + height );
|
||||||
|
|
||||||
mh = new MainHeader();
|
mh = new MainHeader();
|
||||||
header = mh;
|
header = mh;
|
||||||
|
|
||||||
@@ -35,19 +40,9 @@ class MainPanel extends Panel {
|
|||||||
footer = mf;
|
footer = mf;
|
||||||
|
|
||||||
sn = new StackNavigator();
|
sn = new StackNavigator();
|
||||||
sn.width = 400;
|
sn.autoSizeMode = STAGE;
|
||||||
sn.height = 300;
|
|
||||||
sn.addItem(StackItem.withClass("ridersScreen", RidersScreen));
|
sn.addItem(StackItem.withClass("ridersScreen", RidersScreen));
|
||||||
sn.rootItemID = "ridersScreen";
|
sn.rootItemID = "ridersScreen";
|
||||||
addChild(sn);
|
addChild(sn);
|
||||||
|
|
||||||
/*var rl:RidersList = new RidersList();
|
|
||||||
rl.width = 300;
|
|
||||||
rl.height = 400;
|
|
||||||
addChild(rl);*/
|
|
||||||
}
|
|
||||||
|
|
||||||
private function onCreationComplete(event:FeathersEvent):Void {
|
|
||||||
traceBlue(this + " --> onCreationComplete()");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package view;
|
package view;
|
||||||
|
|
||||||
|
import feathers.layout.AutoSizeMode;
|
||||||
import feathers.controls.ListView;
|
import feathers.controls.ListView;
|
||||||
import feathers.events.FeathersEvent;
|
import feathers.events.FeathersEvent;
|
||||||
import model.AppModelLocator;
|
import model.AppModelLocator;
|
||||||
@@ -12,8 +13,9 @@ class RidersList extends ListView {
|
|||||||
public function new() {
|
public function new() {
|
||||||
super();
|
super();
|
||||||
addEventListener(FeathersEvent.CREATION_COMPLETE, onCreationComplete);
|
addEventListener(FeathersEvent.CREATION_COMPLETE, onCreationComplete);
|
||||||
width = 300;
|
|
||||||
height = 400;
|
//width = 300;
|
||||||
|
//height = 400;
|
||||||
}
|
}
|
||||||
|
|
||||||
override private function initialize():Void {
|
override private function initialize():Void {
|
||||||
@@ -24,15 +26,15 @@ class RidersList extends ListView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function onCreationComplete(event:FeathersEvent):Void {
|
private function onCreationComplete(event:FeathersEvent):Void {
|
||||||
traceBlue(this + " --> onCreationComplete()");
|
traceBlue(this + " --> onCreationComplete() - w: " + width + " h: " + height );
|
||||||
}
|
}
|
||||||
|
|
||||||
private function onRideListDpChange(e:Event):Void {
|
private function onRideListDpChange(e:Event):Void {
|
||||||
traceGreen(this + " : onRideListDpChange");
|
|
||||||
dataProvider = model.ridersListDP;
|
dataProvider = model.ridersListDP;
|
||||||
|
|
||||||
itemToText = function(item:Dynamic):String {
|
itemToText = function(item:Dynamic):String {
|
||||||
return item.firstName;
|
return item.firstName;
|
||||||
};
|
};
|
||||||
|
traceGreen(this + " --> onRideListDpChange() - w: " + width + " h: " + height );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package view;
|
package view;
|
||||||
|
|
||||||
|
import feathers.events.FeathersEvent;
|
||||||
import feathers.layout.VerticalLayout;
|
import feathers.layout.VerticalLayout;
|
||||||
import feathers.controls.ScrollContainer;
|
import feathers.controls.ScrollContainer;
|
||||||
|
import t9.util.ColorTraces.*;
|
||||||
|
|
||||||
class RidersScreen extends ScrollContainer {
|
class RidersScreen extends ScrollContainer {
|
||||||
|
|
||||||
@@ -10,6 +12,7 @@ class RidersScreen extends ScrollContainer {
|
|||||||
|
|
||||||
public function new() {
|
public function new() {
|
||||||
super();
|
super();
|
||||||
|
addEventListener(FeathersEvent.CREATION_COMPLETE, onCreationComplete);
|
||||||
}
|
}
|
||||||
|
|
||||||
override private function initialize():Void {
|
override private function initialize():Void {
|
||||||
@@ -19,11 +22,15 @@ class RidersScreen extends ScrollContainer {
|
|||||||
vl.verticalAlign = TOP;
|
vl.verticalAlign = TOP;
|
||||||
layout = vl;
|
layout = vl;
|
||||||
|
|
||||||
tb = new ToolBar();
|
}
|
||||||
|
|
||||||
|
private function onCreationComplete(event:FeathersEvent):Void {
|
||||||
|
traceBlue(this + " --> onCreationComplete() - w: " + width + " h: " + height );
|
||||||
|
|
||||||
|
tb = new ToolBar();
|
||||||
addChild(tb);
|
addChild(tb);
|
||||||
|
|
||||||
rl = new RidersList();
|
rl = new RidersList();
|
||||||
addChild(rl);
|
addChild(rl);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-8
@@ -1,5 +1,6 @@
|
|||||||
package view;
|
package view;
|
||||||
|
|
||||||
|
import feathers.layout.HorizontalLayoutData;
|
||||||
import feathers.controls.Label;
|
import feathers.controls.Label;
|
||||||
import feathers.controls.LayoutGroup;
|
import feathers.controls.LayoutGroup;
|
||||||
import feathers.events.FeathersEvent;
|
import feathers.events.FeathersEvent;
|
||||||
@@ -30,31 +31,32 @@ class ToolBar extends LayoutGroup {
|
|||||||
final headerHeight = Std.int(sh * Constants.MAIN_HEADER_HEIGHT_RATIO);
|
final headerHeight = Std.int(sh * Constants.MAIN_HEADER_HEIGHT_RATIO);
|
||||||
|
|
||||||
autoSizeMode = CONTENT;
|
autoSizeMode = CONTENT;
|
||||||
backgroundSkin = new RectangleSkin(SolidColor(Constants.ACCENT_COLOR1, 1));
|
backgroundSkin = new RectangleSkin(SolidColor(Constants.ACCENT_COLOR2, 1));
|
||||||
variant = LayoutGroup.VARIANT_TOOL_BAR;
|
//variant = LayoutGroup.VARIANT_TOOL_BAR;
|
||||||
|
|
||||||
// Layout settings
|
// Layout settings
|
||||||
var l:HorizontalLayout = new HorizontalLayout();
|
var l:HorizontalLayout = new HorizontalLayout();
|
||||||
l.paddingLeft = l.paddingRight = Std.int(headerHeight * .3);
|
l.setPadding(Std.int(headerHeight * .1));
|
||||||
l.paddingTop = l.paddingBottom = Std.int(headerHeight * .2);
|
|
||||||
l.verticalAlign = MIDDLE;
|
l.verticalAlign = MIDDLE;
|
||||||
layout = l;
|
layout = l;
|
||||||
|
|
||||||
// Title label
|
// Title label
|
||||||
lbl1 = new Label();
|
lbl1 = new Label();
|
||||||
|
|
||||||
|
//lbl1.layoutData = ld1;
|
||||||
//lb1.backgroundSkin = new RectangleSkin(SolidColor(Constants.ACCENT_COLOR2, 1));
|
//lb1.backgroundSkin = new RectangleSkin(SolidColor(Constants.ACCENT_COLOR2, 1));
|
||||||
|
|
||||||
//lb1.verticalAlign = VerticalAlign.TOP;
|
//lb1.verticalAlign = VerticalAlign.TOP;
|
||||||
|
var fnt:Font = Assets.getFont(Constants.MONTSERRAT_MEDIUM_500);
|
||||||
lbl1.text = "Toolbar";
|
lbl1.text = "Toolbar";
|
||||||
lbl1.embedFonts = true;
|
lbl1.embedFonts = true;
|
||||||
var fnt:Font = Assets.getFont(Constants.MONTSERRAT_MEDIUM_500);
|
lbl1.textFormat = new TextFormat(fnt.fontName, Std.int(headerHeight * .3), Constants.MAIN_COLOR3);
|
||||||
|
|
||||||
lbl1.textFormat = new TextFormat(fnt.fontName, Std.int(headerHeight * .4), Constants.MAIN_COLOR3);
|
|
||||||
addChild(lbl1);
|
addChild(lbl1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function onCreationComplete(event:FeathersEvent):Void {
|
private function onCreationComplete(event:FeathersEvent):Void {
|
||||||
traceBlue(this + " --> onCreationComplete()");
|
traceBlue(this + " --> onCreationComplete() - w: " + width + " h: " + height );
|
||||||
|
traceYellow(width + " / " + height);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user