Some adjustments
This commit is contained in:
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 73 KiB |
+1
-1
@@ -23,7 +23,7 @@
|
||||
<haxelib name="haxe-strings" />
|
||||
<haxelib name="fuzzaldrin" />
|
||||
|
||||
<icon path="assets/icons/app_icon_1024.svg"/>
|
||||
<icon path="assets/icons/app_icon.svg"/>
|
||||
|
||||
<assets path="assets">
|
||||
<font path="fonts/Montserrat/MontserratLight300.ttf" id="MontserratLight300" embed="true"/>
|
||||
|
||||
@@ -57,6 +57,7 @@ class AppModelLocator extends EventDispatcher implements IModelLocator {
|
||||
// update one property of the selectedRider VO
|
||||
public function updateSelectedRiderProp(pProperty:String, pValue:Dynamic) {
|
||||
Reflect.setField(selectedRider, pProperty, pValue);
|
||||
|
||||
traceYellow(Reflect.field(selectedRider, pProperty));
|
||||
}
|
||||
|
||||
@@ -67,7 +68,7 @@ class AppModelLocator extends EventDispatcher implements IModelLocator {
|
||||
|
||||
private function set_ridersListDP(value:ArrayCollection<RiderVO>):ArrayCollection<RiderVO> {
|
||||
ridersListDP = value;
|
||||
dispatchEvent(new Event(RIDERS_LIST_DP_CHANGE));
|
||||
dispatchEvent(new Event(AppModelLocator.RIDERS_LIST_DP_CHANGE));
|
||||
return ridersListDP;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ class Constants {
|
||||
public static final MAIN_COLOR3:Int = 0xECEFF0;
|
||||
public static final PURE_WHITE:Int = 0xFFFFFF;
|
||||
|
||||
public static final ALARM:Int = 0x7C2F99;
|
||||
public static final ALERT:Int = 0xB74B4B;
|
||||
public static final WARNING:Int = 0xAFAC5E;
|
||||
public static final ALARM:Int = 0x9E59B8;
|
||||
public static final ALERT:Int = 0xB76D4B;
|
||||
public static final WARNING:Int = 0xB3A700;
|
||||
public static final INFO:Int = 0x6CB583;
|
||||
|
||||
public static final BUTTON_UP_COLOR:Int = 0x050EB7;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package view;
|
||||
|
||||
import openfl.utils.Function;
|
||||
import model.AppModelLocator;
|
||||
import model.String.Strings;
|
||||
import feathers.layout.HorizontalAlign;
|
||||
@@ -32,8 +33,9 @@ class ConfirmationPanel extends Panel {
|
||||
private var b1:Button;
|
||||
private var b2:Button;
|
||||
private var mainLabel:Label;
|
||||
private var confirmFunction:Function;
|
||||
|
||||
public function new(pB1Text:String, pB2Text:String) {
|
||||
public function new(pB1Text:String, pB2Text:String, pConfirmFunction:Function = null) {
|
||||
super();
|
||||
|
||||
head = new Header();
|
||||
@@ -45,6 +47,8 @@ class ConfirmationPanel extends Panel {
|
||||
b1 = new Button(pB1Text);
|
||||
b2 = new Button(pB2Text);
|
||||
|
||||
confirmFunction = pConfirmFunction;
|
||||
|
||||
addEventListener(FeathersEvent.CREATION_COMPLETE, onCreationComplete);
|
||||
}
|
||||
|
||||
@@ -66,7 +70,7 @@ class ConfirmationPanel extends Panel {
|
||||
backgroundSkin = bkg1;
|
||||
|
||||
// header
|
||||
var bkg2:RectangleSkin = new RectangleSkin(SolidColor(Constants.WARNING, 1));
|
||||
var bkg2:RectangleSkin = new RectangleSkin(SolidColor(Constants.ACCENT_COLOR2, 1));
|
||||
bkg2.cornerRadius = Constants.GLOBAL_CORNER_RADIUS;
|
||||
head.backgroundSkin = bkg2;
|
||||
head.height = Std.int(stage.stageHeight * Constants.MAIN_HEADER_HEIGHT_RATIO);
|
||||
@@ -96,6 +100,9 @@ class ConfirmationPanel extends Panel {
|
||||
|
||||
b2.icon = SVGIconFactory.makeIcon("vector/check_icon_black.svg", Constants.BUTTONS_ICON_SIZE, Constants.MAIN_COLOR3);
|
||||
b2.setIconForState(ButtonState.DOWN, SVGIconFactory.makeIcon("vector/check_icon_black.svg", Constants.BUTTONS_ICON_SIZE, Constants.HERO_COLOR));
|
||||
b2.addEventListener(TriggerEvent.TRIGGER, (e) -> {
|
||||
confirmFunction();
|
||||
});
|
||||
|
||||
// footer
|
||||
foot.height = Std.int(stage.stageHeight * Constants.MAIN_HEADER_HEIGHT_RATIO);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package view;
|
||||
|
||||
import openfl.utils.Function;
|
||||
import feathers.core.PopUpManager;
|
||||
import components.VSpacer;
|
||||
import feathers.controls.AssetLoader;
|
||||
@@ -143,7 +144,12 @@ class RiderCardDrawer extends Drawer {
|
||||
removeOneCredit.text = Strings.RCD_S2;
|
||||
removeOneCredit.addEventListener(TriggerEvent.TRIGGER, (e) -> {
|
||||
traceRed("removeOneCredit()");
|
||||
PopUpManager.addPopUp(new ConfirmationPanel(Strings.CP_S2, Strings.CP_S3), parent, true, true);
|
||||
// this function will be exectuted when the user will click on the ConfirmationPanel's "confirm" button
|
||||
var f:Function = function () {
|
||||
trace("remove 1 credit to selected rider in model");
|
||||
// TODO remove 1 credit to selected rider in model
|
||||
}
|
||||
PopUpManager.addPopUp(new ConfirmationPanel(Strings.CP_S2, Strings.CP_S3, f), parent, true, true);
|
||||
});
|
||||
mainScrollContainer.addChild(removeOneCredit);
|
||||
|
||||
@@ -162,7 +168,6 @@ class RiderCardDrawer extends Drawer {
|
||||
var rvo:RiderVO = model.selectedRider;
|
||||
|
||||
// profile picture
|
||||
ppal.source = "https://lepetittrot.com/lptcm/assets/profile-pictures/pp512/pp_test_512.jpg";
|
||||
ppal.source = Constants.PROFIL_PICTURES_PATH_512 + rvo.uid + ".jpg";
|
||||
|
||||
// first name text input
|
||||
|
||||
@@ -6,7 +6,7 @@ import components.RidersListRendererAccessory;
|
||||
import components.RoundAvatar;
|
||||
import control.RiderSelectEvent;
|
||||
import feathers.controls.ListView;
|
||||
import feathers.controls.dataRenderers.ItemRenderer;
|
||||
import feathers.controls.dataRenderers.ItemRenderer;
|
||||
import feathers.data.ListViewItemState;
|
||||
import feathers.events.FeathersEvent;
|
||||
import feathers.events.ListViewEvent;
|
||||
|
||||
Reference in New Issue
Block a user