[Examples] Fix LayoutSpecExamples and LayoutSpecExamples-Swift: image URLs were still pointing to asyncdisplaykit.org (#275)

* Fix Image URLs in LayoutSpecExamples and LayoutSpecExamples-Swift (they were still pointing to asyncdisplaykit.org)

* Update documentation of ASMapNode example to accurately reflect implemented layout

* Fix headers

* More headers fixing
This commit is contained in:
César Estébanez Tascón 2017-05-16 20:05:55 +02:00 committed by Huy Nguyen
parent 9c07aff695
commit e6accc7ea6
5 changed files with 62 additions and 46 deletions

View File

@ -1,18 +1,18 @@
// //
// MapHandlerNode.h // MapHandlerNode.h
// Sample // Texture
// //
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the // This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant // LICENSE file in the /ASDK-Licenses directory of this source tree. An additional
// of patent rights can be found in the PATENTS file in the same directory. // grant of patent rights can be found in the PATENTS file in the same directory.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // Modifications to this file made after 4/13/2017 are: Copyright (c) 2017-present,
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // Pinterest, Inc. Licensed under the Apache License, Version 2.0 (the "License");
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // you may not use this file except in compliance with the License.
// FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN // You may obtain a copy of the License at
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN //
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // http://www.apache.org/licenses/LICENSE-2.0
// //
#import <AsyncDisplayKit/ASDisplayNode.h> #import <AsyncDisplayKit/ASDisplayNode.h>

View File

@ -1,18 +1,18 @@
// //
// MapHandlerNode.m // MapHandlerNode.m
// Sample // Texture
// //
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the // This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant // LICENSE file in the /ASDK-Licenses directory of this source tree. An additional
// of patent rights can be found in the PATENTS file in the same directory. // grant of patent rights can be found in the PATENTS file in the same directory.
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // Modifications to this file made after 4/13/2017 are: Copyright (c) 2017-present,
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // Pinterest, Inc. Licensed under the Apache License, Version 2.0 (the "License");
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // you may not use this file except in compliance with the License.
// FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN // You may obtain a copy of the License at
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN //
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // http://www.apache.org/licenses/LICENSE-2.0
// //
#import "MapHandlerNode.h" #import "MapHandlerNode.h"
@ -112,22 +112,24 @@
} }
/** /**
* ---------------------------------ASStackLayoutSpec-------------------------------- * ------------------------------------ASStackLayoutSpec-----------------------------------
* | ------------------------------ASInsetLayoutSpec----------------------------- | * | ---------------------------------ASInsetLayoutSpec-------------------------------- |
* | | ---------------------------ASStackLayoutSpec-------------------------- | | * | | ------------------------------ASStackLayoutSpec----------------------------- | |
* | | | -----------------ASStackLayoutSpec---------------- | | | * | | | ---------------------------ASStackLayoutSpec-------------------------- | | |
* | | | | --------------ASStackLayoutSpec------------- | | | | * | | | | -----------------ASStackLayoutSpec---------------- | | | |
* | | | | | ASEditableTextNode ASEditableTextNode | | | | | * | | | | | --------------ASStackLayoutSpec------------- | | | | |
* | | | | -------------------------------------------- | | | | * | | | | | | ASEditableTextNode ASEditableTextNode | | | | | |
* | | | | --------------ASStackLayoutSpec------------- | ASButtonNode | | | * | | | | | -------------------------------------------- | | | | |
* | | | | | ASEditableTextNode ASEditableTextNode | | | | | * | | | | | --------------ASStackLayoutSpec------------- | ASButtonNode | | | |
* | | | | -------------------------------------------- | | | | * | | | | | | ASEditableTextNode ASEditableTextNode | | | | | |
* | | | -------------------------------------------------- | | | * | | | | | -------------------------------------------- | | | | |
* | | ---------------------------------------------------------------------- | | * | | | | -------------------------------------------------- | | | |
* | ---------------------------------------------------------------------------- | * | | | ---------------------------------------------------------------------- | | |
* | ASButtonNode | * | | | ASButtonNode | | |
* | ASMapNode | * | | ---------------------------------------------------------------------------- | |
* ---------------------------------------------------------------------------------- * | ---------------------------------------------------------------------------------- |
* | ASMapNode |
* ----------------------------------------------------------------------------------------
* *
* This diagram was created by setting a breakpoint on the returned `layoutSpec` * This diagram was created by setting a breakpoint on the returned `layoutSpec`
* and calling "po [layoutSpec asciiArtString]" in the debugger. * and calling "po [layoutSpec asciiArtString]" in the debugger.

View File

@ -73,7 +73,7 @@ class PhotoWithInsetTextOverlay : LayoutExampleNode {
backgroundColor = .clear backgroundColor = .clear
photoNode.url = URL(string: "http://asyncdisplaykit.org/static/images/layout-examples-photo-with-inset-text-overlay-photo.png") photoNode.url = URL(string: "http://texturegroup.org/static/images/layout-examples-photo-with-inset-text-overlay-photo.png")
photoNode.willDisplayNodeContentWithRenderingContext = { context, drawParameters in photoNode.willDisplayNodeContentWithRenderingContext = { context, drawParameters in
let bounds = context.boundingBoxOfClipPath let bounds = context.boundingBoxOfClipPath
UIBezierPath(roundedRect: bounds, cornerRadius: 10).addClip() UIBezierPath(roundedRect: bounds, cornerRadius: 10).addClip()
@ -101,9 +101,9 @@ class PhotoWithOutsetIconOverlay : LayoutExampleNode {
required init() { required init() {
super.init() super.init()
photoNode.url = URL(string: "http://asyncdisplaykit.org/static/images/layout-examples-photo-with-outset-icon-overlay-photo.png") photoNode.url = URL(string: "http://texturegroup.org/static/images/layout-examples-photo-with-outset-icon-overlay-photo.png")
iconNode.url = URL(string: "http://asyncdisplaykit.org/static/images/layout-examples-photo-with-outset-icon-overlay-icon.png") iconNode.url = URL(string: "http://texturegroup.org/static/images/layout-examples-photo-with-outset-icon-overlay-icon.png")
iconNode.imageModificationBlock = { image in iconNode.imageModificationBlock = { image in
let profileImageSize = CGSize(width: 60, height: 60) let profileImageSize = CGSize(width: 60, height: 60)

View File

@ -1,11 +1,18 @@
// //
// LayoutExampleNodes.h // LayoutExampleNodes.h
// Sample // Texture
// //
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the // This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant // LICENSE file in the /ASDK-Licenses directory of this source tree. An additional
// of patent rights can be found in the PATENTS file in the same directory. // grant of patent rights can be found in the PATENTS file in the same directory.
//
// Modifications to this file made after 4/13/2017 are: Copyright (c) 2017-present,
// Pinterest, Inc. Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// //
#import <AsyncDisplayKit/AsyncDisplayKit.h> #import <AsyncDisplayKit/AsyncDisplayKit.h>

View File

@ -1,11 +1,18 @@
// //
// LayoutExampleNodes.m // LayoutExampleNodes.m
// Sample // Texture
// //
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. // Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the // This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant // LICENSE file in the /ASDK-Licenses directory of this source tree. An additional
// of patent rights can be found in the PATENTS file in the same directory. // grant of patent rights can be found in the PATENTS file in the same directory.
//
// Modifications to this file made after 4/13/2017 are: Copyright (c) 2017-present,
// Pinterest, Inc. Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// //
#import "LayoutExampleNodes.h" #import "LayoutExampleNodes.h"
@ -124,7 +131,7 @@
self.backgroundColor = [UIColor clearColor]; self.backgroundColor = [UIColor clearColor];
_photoNode = [[ASNetworkImageNode alloc] init]; _photoNode = [[ASNetworkImageNode alloc] init];
_photoNode.URL = [NSURL URLWithString:@"http://asyncdisplaykit.org/static/images/layout-examples-photo-with-inset-text-overlay-photo.png"]; _photoNode.URL = [NSURL URLWithString:@"http://texturegroup.org/static/images/layout-examples-photo-with-inset-text-overlay-photo.png"];
_photoNode.willDisplayNodeContentWithRenderingContext = ^(CGContextRef context, id drawParameters) { _photoNode.willDisplayNodeContentWithRenderingContext = ^(CGContextRef context, id drawParameters) {
CGRect bounds = CGContextGetClipBoundingBox(context); CGRect bounds = CGContextGetClipBoundingBox(context);
[[UIBezierPath bezierPathWithRoundedRect:bounds cornerRadius:10] addClip]; [[UIBezierPath bezierPathWithRoundedRect:bounds cornerRadius:10] addClip];
@ -168,10 +175,10 @@
if (self) { if (self) {
_photoNode = [[ASNetworkImageNode alloc] init]; _photoNode = [[ASNetworkImageNode alloc] init];
_photoNode.URL = [NSURL URLWithString:@"http://asyncdisplaykit.org/static/images/layout-examples-photo-with-outset-icon-overlay-photo.png"]; _photoNode.URL = [NSURL URLWithString:@"http://texturegroup.org/static/images/layout-examples-photo-with-outset-icon-overlay-photo.png"];
_iconNode = [[ASNetworkImageNode alloc] init]; _iconNode = [[ASNetworkImageNode alloc] init];
_iconNode.URL = [NSURL URLWithString:@"http://asyncdisplaykit.org/static/images/layout-examples-photo-with-outset-icon-overlay-icon.png"]; _iconNode.URL = [NSURL URLWithString:@"http://texturegroup.org/static/images/layout-examples-photo-with-outset-icon-overlay-icon.png"];
[_iconNode setImageModificationBlock:^UIImage *(UIImage *image) { // FIXME: in framework autocomplete for setImageModificationBlock line seems broken [_iconNode setImageModificationBlock:^UIImage *(UIImage *image) { // FIXME: in framework autocomplete for setImageModificationBlock line seems broken
CGSize profileImageSize = CGSizeMake(60, 60); CGSize profileImageSize = CGSizeMake(60, 60);