Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1488] Alloy Hyperloop in Alloy XML views

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionWon't Do
Resolution Date2016-04-05T13:40:52.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsXML
Labelshyperloop
ReporterHans Knöchel
AssigneeBruce Wayne
Created2016-04-03T17:46:22.000+0000
Updated2016-04-05T13:40:52.000+0000

Description

I know it's a pretty big thing, but we should at least file it now to discuss it. This ticket is about the idea to support Hyperloop-based Views with Alloy. Example:
var view = new UIView();
view.setBackgroundColor(UIColor.redColor());
view.setFrame(CGRectMake(20,20,300,300));
would become:
<Alloy>
  <UIView class="myView" />
</Alloy>
".myView": {
  backgroundColor: UIColor.redColor,
  frame: CGRectMake(20,20,300,300)
}

Comments

  1. Hans Knöchel 2016-04-03

    /cc [~fokkezb]
  2. Fokke Zandbergen 2016-04-05

    I'm not sure if I'd be a fan of this. How would Alloy know if a tag is for Titanium or HL? I'd like to remove some of the magic from Alloy for 2.0, not add more. I think best practice for HL should be to build (cross-platform) factory libraries that in Alloy you'd then simply use via the existing module attribute.
  3. Bert Grantges 2016-04-05

    You can already create custom tags in Alloy that link to Hyperloop code. I am MUCH more in favor of that approach vs what is mentioned below. [~fokkezb]'s comments are accurate. See my gist on how to do this. https://gist.github.com/grantges/1c5df7f7b0eada2c4610
  4. Hans Knöchel 2016-04-05

    Closing this issue, since it's already possible with the suggested Alloy tags. We need some documentation around it, but that's fine. Thanks [~bgrantges@appcelerator.com]!

JSON Source