Titanium

[ALOY-83] Allow platform conditionals in markup via the "platform" attribute

GitHub Issuen/a
TypeNew Feature
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-07-19T11:52:02.000+0000
Affected Version/s2012 Sprint 14
Fix Version/s2012 Sprint 14
ComponentsXML
Labelsn/a
ReporterTony Lukasavage
AssigneeTony Lukasavage
Created2012-07-01T14:45:24.000+0000
Updated2014-06-22T13:21:04.000+0000

Description

Basic Description

To allow marking to make platform-specific code, we should use the "platform" attribute with basic logic in it. The generated code should use compiler directives if the platform is known at compile time. It will use runtime checks if the platform is not known at compile time. * The platform name will indicate its usage * The exclamation point \(!\) will negate a platform * A comma \(,\) will serve as an OR operator

Examples

This would show the view on android and ios devices

This would should the view on any platform that is not mobileweb

Comments

  1. Tony Lukasavage 2012-07-02 Both the runtime and compile time conditional have been implemented. Additional work needs to be done to ensure that special tag parsers that handle the parsing of their children also abide by these platform specifications.

JSON Source