Skip to content

Commit

Permalink
Merge branch 'release-candidate'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Gordon committed Apr 26, 2016
2 parents 55afa3a + 54c5ad7 commit 037551f
Show file tree
Hide file tree
Showing 344 changed files with 14,134 additions and 3,875 deletions.
1 change: 1 addition & 0 deletions .arcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"phabricator.uri" : "http://codereview.cc/",
"repository.callsign" : "MDC",
"arc.land.onto.default" : "develop",
"arc.feature.start.default": "origin/develop",
"git.default-relative-commit" : "origin/develop",
"unit.xcode": {
"build": {
Expand Down
288 changes: 288 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ considerations as a basis for minimizing dependencies:
- dependency-less components are much easier to drop in and, most importantly, to remove from a
project.

[Reach out to the team directly](community/#questions) for advice or questions on this matter.
[Reach out to the team directly](contributing/#questions) for advice or questions on this matter.

Recommendations:

Expand Down
46 changes: 39 additions & 7 deletions MaterialComponents.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ load 'scripts/generated/icons.rb'

Pod::Spec.new do |s|
s.name = "MaterialComponents"
s.version = "4.0.1"
s.version = "5.0.0"
s.authors = { 'Apple platform engineering at Google' => '[email protected]' }
s.summary = "A collection of stand-alone production-ready UI libraries focused on design details."
s.homepage = "https://github.com/google/material-components-ios"
Expand Down Expand Up @@ -75,6 +75,44 @@ Pod::Spec.new do |s|
ss.dependency "MaterialComponents/Buttons"
end

s.subspec "CollectionCells" do |ss|
ss.public_header_files = "components/#{ss.base_name}/src/*.h"
ss.source_files = "components/#{ss.base_name}/src/*.{h,m}", "components/#{ss.base_name}/src/private/*.{h,m}"
ss.header_mappings_dir = "components/#{ss.base_name}/src/*"

ss.dependency "MaterialComponents/CollectionLayoutAttributes"
ss.dependency "MaterialComponents/Ink"
ss.dependency "MaterialComponents/Typography"
ss.dependency "MaterialComponents/private/Icons/ic_check"
ss.dependency "MaterialComponents/private/Icons/ic_check_circle"
ss.dependency "MaterialComponents/private/Icons/ic_chevron_right"
ss.dependency "MaterialComponents/private/Icons/ic_info"
ss.dependency "MaterialComponents/private/Icons/ic_radio_button_unchecked"
ss.dependency "MaterialComponents/private/Icons/ic_reorder"
end

s.subspec "CollectionLayoutAttributes" do |ss|
ss.public_header_files = "components/#{ss.base_name}/src/*.h"
ss.source_files = "components/#{ss.base_name}/src/*.{h,m}"
ss.header_mappings_dir = "components/#{ss.base_name}/src/*"
end

s.subspec "Collections" do |ss|
ss.public_header_files = "components/#{ss.base_name}/src/*.h"
ss.source_files = "components/#{ss.base_name}/src/*.{h,m}", "components/#{ss.base_name}/src/private/*.{h,m}"
ss.header_mappings_dir = "components/#{ss.base_name}/src/*"
ss.resource_bundles = {
"Material#{ss.base_name}" => ["components/#{ss.base_name}/src/Material#{ss.base_name}.bundle/*"]
}

ss.dependency "MaterialComponents/CollectionCells"
ss.dependency "MaterialComponents/CollectionLayoutAttributes"
ss.dependency "MaterialComponents/Ink"
ss.dependency "MaterialComponents/ShadowElevations"
ss.dependency "MaterialComponents/ShadowLayer"
ss.dependency "MaterialComponents/Typography"
end

s.subspec "FlexibleHeader" do |ss|
ss.public_header_files = "components/#{ss.base_name}/src/*.h"
ss.source_files = "components/#{ss.base_name}/src/*.{h,m}", "components/#{ss.base_name}/src/private/*.{h,m}"
Expand Down Expand Up @@ -133,12 +171,6 @@ Pod::Spec.new do |s|
ss.dependency "MaterialComponents/Typography"
end

s.subspec "ScrollViewDelegateMultiplexer" do |ss|
ss.public_header_files = "components/#{ss.base_name}/src/*.h"
ss.source_files = "components/#{ss.base_name}/src/*.{h,m}"
ss.header_mappings_dir = "components/#{ss.base_name}/src/*"
end

s.subspec "ShadowElevations" do |ss|
ss.public_header_files = "components/#{ss.base_name}/src/*.h"
ss.source_files = "components/#{ss.base_name}/src/*.{h,m}"
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponentsCatalog.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MaterialComponentsCatalog"
s.version = "4.0.1"
s.version = "5.0.0"
s.authors = { 'Apple platform engineering at Google' => '[email protected]' }
s.summary = "A collection of stand-alone production-ready UI libraries focused on design details."
s.homepage = "https://github.com/google/material-components-ios"
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponentsUnitTests.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MaterialComponentsUnitTests"
s.version = "4.0.1"
s.version = "5.0.0"
s.authors = { 'Apple platform engineering at Google' => '[email protected]' }
s.summary = "A collection of stand-alone production-ready UI libraries focused on design details."
s.homepage = "https://github.com/google/material-components-ios"
Expand Down
6 changes: 6 additions & 0 deletions catalog/CatalogByConvention/src/CBCCatalogExample.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
/** Return a list of breadcrumbs defining the navigation path taken to reach this example. */
+ (nonnull NSArray<NSString *> *)catalogBreadcrumbs;

/**
Return a BOOL stating whether this example should be treated as the main "Demo" in the Catalog
for this component
*/
+ (BOOL)catalogIsPrimaryDemo;

@optional

/**
Expand Down
7 changes: 6 additions & 1 deletion catalog/CatalogByConvention/src/CBCNodeViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@
An instance of CBCNodeListViewController is able to represent a non-example CBCNode instance as a
UITableView.
*/
@interface CBCNodeListViewController : UITableViewController
@interface CBCNodeListViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>

/** Initializes a CBCNodeViewController instance with a non-example node. */
- (nonnull instancetype)initWithNode:(nonnull CBCNode *)node;

- (nonnull instancetype)initWithStyle:(UITableViewStyle)style NS_UNAVAILABLE;

@property(nonatomic, strong, nonnull) UITableView *tableView;

/** The node that this view controller must represent. */
@property(nonatomic, strong, nonnull, readonly) CBCNode *node;

Expand Down Expand Up @@ -65,6 +67,9 @@ FOUNDATION_EXTERN CBCNode *__nonnull CBCCreateNavigationTree(void);
/** The children of this node. */
@property(nonatomic, strong, nonnull) NSArray<CBCNode *> *children;

/** Is this the most important or default demo for this component? */
- (BOOL)isPrimaryDemo;

/** Returns YES if this is an example node. */
- (BOOL)isExample;

Expand Down
41 changes: 40 additions & 1 deletion catalog/CatalogByConvention/src/CBCNodeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ - (NSString *)createExampleDescription {
return CBCDescriptionFromClass(_exampleClass);
}

- (BOOL)isPrimaryDemo {
return CBCCatalogIsPrimaryDemoFromClass(_exampleClass);
}

@end

@implementation CBCNodeListViewController
Expand All @@ -85,7 +89,7 @@ - (instancetype)initWithNode:(CBCNode *)node {
NSAssert(!_node.isExample,
@"%@ cannot represent example nodes.", NSStringFromClass([self class]));

self = [super initWithStyle:UITableViewStyleGrouped];
self = [super initWithNibName:nil bundle:nil];
if (self) {
_node = node;

Expand All @@ -99,6 +103,41 @@ - (instancetype)initWithStyle:(UITableViewStyle)style {
return nil;
}

- (void)viewDidLoad {
[super viewDidLoad];

self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds
style:UITableViewStyleGrouped];
self.tableView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
self.tableView.delegate = self;
self.tableView.dataSource = self;
[self.view addSubview:self.tableView];
}

- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];

NSIndexPath *selectedRow = self.tableView.indexPathForSelectedRow;
if (selectedRow) {
[[self transitionCoordinator] animateAlongsideTransition:^(id context) {
[self.tableView deselectRowAtIndexPath:selectedRow animated:YES];
}
completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
if ([context isCancelled]) {
[self.tableView selectRowAtIndexPath:selectedRow
animated:NO
scrollPosition:UITableViewScrollPositionNone];
}
}];
}
}

- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];

[self.tableView flashScrollIndicators];
}

#pragma mark - UITableViewDataSource

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
Expand Down
3 changes: 3 additions & 0 deletions catalog/CatalogByConvention/src/private/CBCRuntime.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
/** Invokes +catalogBreadcrumbs on the class and returns the corresponding array of strings. */
FOUNDATION_EXTERN NSArray<NSString *> *CBCCatalogBreadcrumbsFromClass(Class aClass);

/** Invokes +catalogIsPrimaryDemo on the class and returns the BOOL value. */
FOUNDATION_EXTERN BOOL CBCCatalogIsPrimaryDemoFromClass(Class aClass);

#pragma mark Runtime enumeration

/** Returns all Objective-C and Swift classes available to the runtime. */
Expand Down
19 changes: 18 additions & 1 deletion catalog/CatalogByConvention/src/private/CBCRuntime.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,23 @@
return [aClass performSelector:@selector(catalogBreadcrumbs)];
}

#pragma mark Primary demo check

BOOL CBCCatalogIsPrimaryDemoFromClass(Class aClass) {
BOOL isPrimaryDemo = NO;

if ([aClass respondsToSelector:@selector(catalogIsPrimaryDemo)]) {
NSMethodSignature *signature = [aClass methodSignatureForSelector:@selector(catalogIsPrimaryDemo)];
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
invocation.selector = @selector(catalogIsPrimaryDemo);
invocation.target = aClass;
[invocation invoke];
[invocation getReturnValue:&isPrimaryDemo];
}

return isPrimaryDemo;
}

#pragma mark Runtime enumeration

NSArray<Class> *CBCGetAllClasses(void) {
Expand Down Expand Up @@ -87,7 +104,7 @@
NSCAssert(vc, @"expecting a initialViewController in the storyboard %@", storyboardName);
return vc;
}
return [[aClass alloc] initWithNibName:nil bundle:nil];
return [[aClass alloc] init];
}

NSString *CBCDescriptionFromClass(Class aClass) {
Expand Down
Loading

0 comments on commit 037551f

Please sign in to comment.