Skip to content

Commit

Permalink
Merge pull request #49 from hansemannn/2_0_0-Property-Migration
Browse files Browse the repository at this point in the history
[TIMOB-23911] Migrate properties to 2.0.0 notation, bump SDK, Hyperloop and app
  • Loading branch information
hansemannn committed Oct 12, 2016
2 parents 47b3195 + d11ec8d commit a00be2b
Show file tree
Hide file tree
Showing 22 changed files with 42 additions and 43 deletions.
6 changes: 3 additions & 3 deletions app/controllers/ios/animateview.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// create a view box we're going to animate when you click the button
var view = UIView.alloc().initWithFrame(CGRectMake(10, 10, 50, 50));
view.backgroundColor = UIColor.redColor();
view.backgroundColor = UIColor.redColor;
container.add(view);

var flag;
Expand All @@ -25,13 +25,13 @@
view.layer.opacity = 0.8;
view.layer.cornerRadius = view.frame.size.width / 2;
view.transform = CGAffineTransformScale(CGAffineTransformRotate(view.transform, Math.PI), 1.5, 1.5);
view.backgroundColor = UIColor.blueColor();
view.backgroundColor = UIColor.blueColor;
} else {
view.frame = CGRectMake(10, 10, 50, 50);
view.layer.opacity = 1;
view.layer.cornerRadius = 0;
view.transform = CGAffineTransformIdentity;
view.backgroundColor = UIColor.redColor();
view.backgroundColor = UIColor.redColor;
}
}, function (_done) {
// this function is called after the animation completes
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/ios/autolayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
label.translatesAutoresizingMaskIntoConstraints = false;
label.setText('Hello World');
label.setTextAlignment(UIKit.NSTextAlignmentCenter);
label.setTextColor(UIColor.redColor());
label.setBackgroundColor(UIColor.blueColor());
label.setTextColor(UIColor.redColor);
label.setBackgroundColor(UIColor.blueColor);

var view = new UIView();
view.setBackgroundColor(UIColor.yellowColor());
view.setBackgroundColor(UIColor.yellowColor);
view.addSubview(label);

var heightConstraint = NSLayoutConstraint.constraintWithItemAttributeRelatedByToItemAttributeMultiplierConstant(
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/ios/beacons.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ function presentNotification(title) {
notification.alertBody = title;
notification.soundName = "Default";

UIApplication.sharedApplication().presentLocalNotificationNow(notification);
UIApplication.sharedApplication.presentLocalNotificationNow(notification);
}
2 changes: 1 addition & 1 deletion app/controllers/ios/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

var button = new UIButton();

button.backgroundColor = UIColor.redColor();
button.backgroundColor = UIColor.redColor;
button.layer.cornerRadius = 6;
button.frame = CGRectMake(50, 50, 300, 45);
button.setTitleForState("CLICK ME", UIControlStateNormal);
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/ios/collectionview.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
}

// Calculate the cell specs
var screenRect = UIScreen.mainScreen().bounds;
screenRect = CGRectMake(0 , 0, UIScreen.mainScreen().bounds.size.width, UIScreen.mainScreen().bounds.size.height - 64);
var screenRect = UIScreen.mainScreen.bounds;
screenRect = CGRectMake(0 , 0, UIScreen.mainScreen.bounds.size.width, UIScreen.mainScreen.bounds.size.height - 64);
var cellWidth = screenRect.size.width / 3.0;

// Create the cell layout and assign the size
Expand All @@ -58,7 +58,7 @@
// Create the UICollectionView, set the delegate, datasource and layout
collectionView = UICollectionView.alloc().initWithFrameCollectionViewLayout(screenRect, layout);
collectionView.registerClassForCellWithReuseIdentifier("UICollectionViewCell", "Cell");
collectionView.backgroundColor = UIColor.clearColor();
collectionView.backgroundColor = UIColor.clearColor;
collectionView.setDataSource(dataSourceDelegate);
collectionView.setDelegate(dataSourceDelegate);

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/ios/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
CGRectMake = require('CoreGraphics').CGRectMake,
CGPointMake = require('CoreGraphics').CGPointMake,
UIScreen = require('UIKit/UIScreen'),
bounds = UIScreen.mainScreen().bounds;
bounds = UIScreen.mainScreen.bounds;

// create the objective-c class
var view = new MyClass();
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/ios/donutchart.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@
Styles.deepRed.setFill();
segmentWithPointerPath.fill();
}
var bounds = UIScreen.mainScreen().bounds;
var bounds = UIScreen.mainScreen.bounds;
view.frame = CGRectMake(0, 0, 256, 256);
view.center = CGPointMake(bounds.size.width / 2, (bounds.size.height / 2) - 30);
view.backgroundColor = UIColor.clearColor();
view.backgroundColor = UIColor.clearColor;
view.layer.allowsEdgeAntialiasing = true;
view.layer.cornerRadius = 10;

Expand Down
8 changes: 4 additions & 4 deletions app/controllers/ios/drawrect.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
var beams = 9;
var radius = rect.size.width / 2;

UIColor.whiteColor().setFill();
UIColor.whiteColor.setFill();
CGContextFillRect(UIGraphicsGetCurrentContext(), rect);

UIColor.redColor().setFill();
UIColor.greenColor().setStroke();
UIColor.redColor.setFill();
UIColor.greenColor.setStroke();

var bezierPath = UIBezierPath.bezierPath();
var centerPoint = CGPointMake(rect.size.width / 2, rect.size.height / 2);
Expand Down Expand Up @@ -61,7 +61,7 @@
}


view.backgroundColor = UIColor.yellowColor();
view.backgroundColor = UIColor.yellowColor;
view.frame = CGRectMake(0, 0, 300, 300);
container.add(view);

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/ios/gravity.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ setTimeout(function () {
// create class to detect collisions
var CollisionBehaviorDelegate = require('subclasses/collisionbehaviordelegate');

var soundPath = NSBundle.mainBundle().pathForResourceOfType('sounds/hit', 'mp3');
var soundPath = NSBundle.mainBundle.pathForResourceOfType('sounds/hit', 'mp3');
var soundURL = NSURL.fileURLWithPath(soundPath);
var sound = AVAudioPlayer.alloc().initWithContentsOfURLError(soundURL);
sound.prepareToPlay();
Expand Down
8 changes: 4 additions & 4 deletions app/controllers/ios/httprequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ function startRequest() {
var URLSessionDelegate = require("subclasses/urlsessiondelegate");
var delegate = new URLSessionDelegate();
var urlPath = NSURL.alloc().initWithString("https://appcelerator.com");
var sessionConfiguration = NSURLSessionConfiguration.defaultSessionConfiguration();
var sessionConfiguration = NSURLSessionConfiguration.defaultSessionConfiguration;

// Set request headers like `User-Agent` and `Authorization`
sessionConfiguration.HTTPAdditionalHeaders = {"User-Agent" : "Appcelerator Hyperloop"};

var session = NSURLSession.sessionWithConfigurationDelegateDelegateQueue(sessionConfiguration, delegate, null);
var task = session.dataTaskWithURLCompletionHandler(urlPath, function(data, response, error) {
UIApplication.sharedApplication().networkActivityIndicatorVisible = false
UIApplication.sharedApplication.networkActivityIndicatorVisible = false

alert("Request completed!");
session.finishTasksAndInvalidate();
Expand All @@ -27,8 +27,8 @@ function startRequest() {
session.finishTasksAndInvalidate();
};

UIApplication.sharedApplication().networkActivityIndicatorVisible = true;
UIApplication.sharedApplication.networkActivityIndicatorVisible = true;
$.btn.setEnabled(false);
$.btn.setTitle("Loading ...");
task.resume();
}
}
4 changes: 2 additions & 2 deletions app/controllers/ios/label.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

var shadowDic = new NSShadow();
shadowDic.shadowBlurRadius = 10.0;
shadowDic.shadowColor = UIColor.grayColor();
shadowDic.shadowColor = UIColor.grayColor;
shadowDic.shadowOffset = CGSizeMake(0, 4);

attString.addAttributeValueRange(UIKit.NSFontAttributeName, font, range);
attString.addAttributeValueRange(UIKit.NSShadowAttributeName, shadowDic,range);
attString.addAttributeValueRange(UIKit.NSStrokeColorAttributeName, UIColor.redColor(), range);
attString.addAttributeValueRange(UIKit.NSStrokeColorAttributeName, UIColor.redColor, range);
attString.addAttributeValueRange(UIKit.NSStrokeWidthAttributeName, 5.0, range);

var label = new UILabel();
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/ios/libraries/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

var endDate = GLDateUtils.dateByAddingDaysToDate(2, beginDate);
var range = GLCalendarDateRange.rangeWithBeginDateEndDate(beginDate, endDate);
range.backgroundColor = UIColor.redColor();
range.backgroundColor = UIColor.redColor;
range.editable = true;

return range;
Expand Down Expand Up @@ -136,7 +136,7 @@
});

// Get the screensize
var bounds = UIScreen.mainScreen().bounds
var bounds = UIScreen.mainScreen.bounds
var frame = CGRectMake(0, 0, bounds.size.width, bounds.size.height);
var today = NSDate.date();
calendar = new GLCalendarView();
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/ios/libraries/charting.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
chart.dataSource = delegate;

// make the chart take up most of the screen bounds
var bounds = UIScreen.mainScreen().bounds;
var bounds = UIScreen.mainScreen.bounds;
chart.frame = CGRectMake(0, 0, bounds.size.width - 40, bounds.size.height - 100);

// docs say we need to reload the data initially to cause it to paint
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/ios/shapes.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
var shapeLayer = CAShapeLayer.layer();
shapeLayer.path = path.CGPath;
shapeLayer.strokeColor = UIColor.colorWithRedGreenBlueAlpha(color.red, color.green, color.blue, color.alpha).CGColor;
shapeLayer.fillColor = UIColor.clearColor().CGColor;
shapeLayer.fillColor = UIColor.clearColor.CGColor;
shapeLayer.lineWidth = lineWidth;
shapeLayer.strokeStart = 0.0;
shapeLayer.strokeEnd = 1.0;
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/ios/tableview.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
var TableViewDataSourceAndDelegate = require('subclasses/tableviewdatasourcedelegate')

// Create + configure tableView
var tableView = UITableView.alloc().initWithFrameStyle(UIScreen.mainScreen().bounds, UITableViewStyleGrouped);
var tableView = UITableView.alloc().initWithFrameStyle(UIScreen.mainScreen.bounds, UITableViewStyleGrouped);
var dataSourceDelegate = new TableViewDataSourceAndDelegate();

dataSourceDelegate.numberOfSections = function(tableView) {
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/ios/touches.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

var view1 = UIView.alloc().initWithFrame(CGRectMake(40,40,100,100));
view1.addGestureRecognizer(panGesture1);
view1.backgroundColor = UIColor.greenColor();
view1.backgroundColor = UIColor.greenColor;

var view2 = UIView.alloc().initWithFrame(CGRectMake(40,180,100,100));
view2.addGestureRecognizer(panGesture2);
view2.backgroundColor = UIColor.redColor();
view2.backgroundColor = UIColor.redColor;

container.add(view1);
container.add(view2);
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/ios/xib.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var NSBundle = require('Foundation/NSBundle');

var view = NSBundle.mainBundle().loadNibNamedOwnerOptions('view');
var view = NSBundle.mainBundle.loadNibNamedOwnerOptions('view');

container.add(view.objectAtIndex(0));

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/sizefill.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
var UIColor = require('UIKit/UIColor');
var label = new UILabel();
label.text = "Hello";
label.backgroundColor = UIColor.yellowColor();
label.backgroundColor = UIColor.yellowColor;
bottomViewContainer.add(label);

button.addEventListener('click', function () {
Expand Down
4 changes: 2 additions & 2 deletions app/lib/ios/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ exports.createArrow = function (options) {
var shapeLayer = CAShapeLayer.layer();
shapeLayer.path = path.CGPath;
shapeLayer.strokeColor = UIColor.colorWithRedGreenBlueAlpha(0, 0, 0, 1).CGColor;
shapeLayer.fillColor = UIColor.clearColor().CGColor;
shapeLayer.fillColor = UIColor.clearColor.CGColor;
shapeLayer.lineWidth = 2;
shapeLayer.strokeStart = 0.0;
shapeLayer.strokeEnd = 1.0;
Expand All @@ -57,7 +57,7 @@ exports.createCircle = function(options) {
var shapeLayer = CAShapeLayer.layer();
shapeLayer.path = path.CGPath;
shapeLayer.strokeColor = UIColor.colorWithRedGreenBlueAlpha(0, 0, 0, 1).CGColor;
shapeLayer.fillColor = UIColor.clearColor().CGColor;
shapeLayer.fillColor = UIColor.clearColor.CGColor;
shapeLayer.lineWidth = 2;
shapeLayer.strokeStart = 0.0;
shapeLayer.strokeEnd = 1.0;
Expand Down
2 changes: 1 addition & 1 deletion app/lib/ios/subclasses/chartdelegate.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ChartDelegate.addMethod({
}
Ti.API.error('ChartDelegate colorForBar(view, index) callback missing');
UIColor = require('UIKit/UIColor');
return UIColor.clearColor();
return UIColor.clearColor;
}
});

Expand Down
3 changes: 1 addition & 2 deletions appc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ module.exports = {
* included here to further customize the xcode build
*/
flags: {
GCC_PREPROCESSOR_DEFINITIONS: 'foo=bar',
SWIFT_VERSION: '2.3'
GCC_PREPROCESSOR_DEFINITIONS: 'foo=bar'
},
/**
* this sample doesn't use StoreKit but this demonstrates
Expand Down
8 changes: 4 additions & 4 deletions tiapp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ti:app xmlns:ti="http://ti.appcelerator.org">
<id>com.appcelerator.sample.hyperloop</id>
<name>Hyperloop_Sample</name>
<version>1.0.0</version>
<version>2.0.0</version>
<publisher>Appcelerator</publisher>
<url>http://www.appcelerator.com</url>
<description>This app demonstrates Hyperloop</description>
Expand Down Expand Up @@ -61,7 +61,7 @@
</manifest>
</android>
<modules>
<module>hyperloop</module>
<module version="2.0.0">hyperloop</module>
</modules>
<deployment-targets>
<target device="android">true</target>
Expand All @@ -70,9 +70,9 @@
<target device="mobileweb">false</target>
<target device="windows">false</target>
</deployment-targets>
<sdk-version>5.5.0.GA</sdk-version>
<sdk-version>6.0.0</sdk-version>
<plugins>
<plugin version="1.0">ti.alloy</plugin>
<plugin>hyperloop</plugin>
<plugin version="2.0.0">hyperloop</plugin>
</plugins>
</ti:app>

0 comments on commit a00be2b

Please sign in to comment.