41 Commits

Author SHA1 Message Date
Robert Moore
e03186525d
[Examples/Tests] Convert @imports to imports (#2761)
In order to make the internal build systems happier, @import statements should not be used.
2017-12-22 12:30:25 -05:00
Yarden Eitan
29d760c7d6
Added isPresentable to catalog files, ported over ZShadow to dragons. (#2726) 2017-12-15 12:20:35 -05:00
Randall Li
b1ec22207f
Fixed float conversion build errors (#2602)
* Fixed float conversion build errors
Implicit conversion loses floating-point precision: 'double' to 'CGFloat' (aka 'float')

Found by turning on warnings via: https://github.com/material-components/material-components-ios/pull/2480

* More Fixed float conversion build errors
Implicit conversion loses floating-point precision: 'double' to 'CGFloat' (aka 'float')

Found by turning on warnings via: https://github.com/material-components/material-components-ios/pull/2480
2017-12-06 15:57:04 -05:00
Randall Li
ef179750a0
Fixed method collision build errors (#2603)
* Fixed method collision build errors
multiple methods named 'count' found

Found by turning on warnings via: https://github.com/material-components/material-components-ios/pull/2480

* switch to using using a more precise array of arrays rather than casting the array.
2017-12-06 15:56:46 -05:00
Yurii Samsoniuk
2a96682230 Replace unnecessary imports with forward declarations (#2429)
* [Themes] Remove unnecessary imports.

* [TextFields] Remove unnecessary imports.

* [Typography] Do not use an umbrella header inside of a component.

* [Snackbar] Do not use self umbrella header.

* [ActivityIndicator] Do not use self umbrella header.

* [AppBar] Use umbrella headers.

* [AppBar] Remove self import header.

* [ButtonBar] Removed self umbrella header imports.

* [Buttons] Removed self umbrella header imports.

* [Collections] Update imports.

* [Dialogs] Moved import into an m file.

* [Collections] Fixed imports.

* [FeatureHighlight] Removed self umbrealla imports.

* [HeaderStackView] Reordered imports.

* [Ink] Replaced imports with forward declarations.

* [Slider] Replaced self umbrella import use.

* [Snackbar] Removed self umbrella header import.

* [Tabs] Changed math import. Replaced self umbrella header import.

* [Icons] Removed unnecessary imports.

* [Overlay] Replaced umbrella header import.

* [ShapeLibrary] Replace Shapes imports with an umbrella header.

* [Shapes] Replaced imports with forward declarations.

* [AppBar] Replace import with a forward declaration.

* [Examples] Updated imports.

* Fixed conflicting imports

* Added space between different import categories
2017-11-16 18:25:06 -05:00
Martin Petrov
f98a9d42ed @objc annoaing catalog by convention (#2305) 2017-10-30 10:24:17 -04:00
Cody Weaver
a462a2ac4f [Mutliple components] Update components that use colors to use MDCPalette. (#2129)
* Update components that use colors to use MDCPalette.

* Update podspec to make palettes available to Collection Cell
2017-10-09 12:53:50 -04:00
Gauthier Ambard
cd39384b48 [Collections] Update collections to support iPhone X (#1988)
* [Collections] Update collections to support iPhone X

The collections use the contentInset to compute the width of the cells.
With iPhone X, the width must take into account possible inset of the side.
This patch makes sure that the collection takes into account the adjustedContentInset, which may take the safe area into consideration.

Closes #1980

* Correct respondsToSelect

* Use macro + @available instead of NSInvocation

* Fix CollectionCellsExamples and add a swift version check to the swift example.

* Make UIScrollViewContentInsetAdjustmentAlways the default

* Remove override from CollectionsSectionInsetsExample
2017-10-06 11:32:07 -04:00
Robert Moore
8940d77d6d [Catalog] Verify all examples provide CatalogByConvention methods (#1911)
All examples now have at least the required `+catalogBreadcrumbs` and `+catalogIsPrimaryDemo`.  All examples in the same breadcrumbs path have only one primary demo.  There should be only one `-catalogDescription` attached to the primary demo.

Closes #1897
2017-08-31 08:46:10 -04:00
Robert Moore
584e212fa0 [Collections] Fix example property attribute (#1854)
The static analyzer complained that 2 NSMutableArrays would be copied as
immutable. Fixing their attributes to please the analyzer.
2017-08-21 09:17:21 -04:00
Gauthier Ambard
84a7a6bf71 [Collections] Limit the drag needed to dismiss an item (#1811)
When using the swipe-to-dimiss gesture on large screens, the distance on which the user has to move the item can be big. This commit limits the distance by using the width of the item instead of the width of the collection.

Closes #1780
2017-08-17 10:02:54 -04:00
Robert Moore
14e00b76ce [Collections] Add "editing" performance example (#1710)
* [Collections] Add "editing" performance example

New example to demonstrate scrolling performance when a collection
contains a large number of cells. "Editing" mode is currently very
inefficient.

* Refactoring, pulling some code into supplemental

* Making cell identifier symbol unique
2017-07-28 13:15:39 -04:00
Gauthier Ambard
14496a33a2 [Collections] Add StylingDelegate methods to control separator display (#1627)
* [Collections] Add StylingDelegate methods to control separator display

Adds methods to MDCCollectionViewStylingDelegate, allowing the delegate to control the display of the separator on cells, header and footer.

Closes #1406
2017-07-25 09:48:14 -04:00
Robert Moore
0495092f1e [Collections] Allow custom UIEdgeInsets (#1614)
* [Collections] Allow custom UIEdgeInsets

MDCCollectionViewController implements custom logic for computing the
`UIEdgeInsets` depending on the `MDCCollectionViewCellStyle` and the
`MDCCollectionViewCellLayoutType`. Subclasses need to override this
functionality to customize their presentation.

* MDCCollectionViewController will use the public
  `-collectionView:layout:section` to compute the width of its
   supplementary view instead of the internal implementation directly.
* Update the Collections layout example to have different horizontal
  edge insets depending on the view's horizontal size class.

Closes #1507

* Add EarlGrey test to verify the insets exampl

* Removing changes to Collection Cells example

* Running code formatter

* Supplemental files.

* Some code clean-up based on willlarche@'s comments

* Removing old header, small cleanup

* Changing block parameter types to match the desired class

* One last id to remove

* Making Earl Grey test a bit better. Some formatting

* Fixing a bug with the flowLayout delegate
2017-07-17 17:30:37 -04:00
ianegordon
f018e09afe Eliminate static analyzer warnings. Simplify Collection supplementary views (#1316) 2017-04-17 17:46:55 -04:00
ianegordon
2ce144abd0 Fix warnings uncovered by the Xcode 8.3 static analyzer (#1298)
* Fix warnings from the 8.3 static analyzer

* Revert scheme change

* Revert Scheme change

* Additional warning fixes

* Revert Scheme Changes
2017-04-03 20:21:31 -04:00
Will Larche
8c5350de31 [All] Formatting. (#1269) 2017-03-22 12:18:15 -04:00
Gauthier Ambard
6ddf3fbdcf [Collection] Fix text in header/footer example (#1266)
The header and the footer of the catalog example now display the correct text.
2017-03-21 11:15:23 -04:00
Justin Shephard
620b5be111 [Collections] - Updated README docs and example to use collection headers in editing mode (#1193)
* [ReadMes] - Updated readme docs for collection views to include note about using section headers/footers while editing

* Updated docs

* [ReadMes] - Fixed code snippets

* [ReadMes] - Updated indention in code blocks

* [ReadMes] - Corrected indentions in code snippets

* [Collections] - Updated cell editing example

* [Collections] - Updated example spacing

* [Collections] Fixed return statement

* [Collections] - Updated example

* [Collections] - Added TODO comment with bug reference

* [Collections] - Added comment TODO comment to example code as well
2017-02-15 16:35:57 -05:00
Adrian Secord
8bcb19781c More SwiftLint fixes for unit tests and example apps. (#1154)
* ClangFormat changes.

* Added swiftlint to scripts/format_all.`

* Fix scripts/lint_all to work from any directory.

* Fixed swiftlint invocation.

* Remove the checks for force casting (! operator).

* Some fixes.

* More Swift fixes.
2017-01-11 13:27:57 -05:00
Adrian Secord
6843303f9d [Collections] Added custom Storyboard cell to the Storyboard example. (#1152) 2017-01-10 18:17:51 -05:00
Adrian Secord
7ba66bf09c Formatted all Objective-C sources with clang-format. (#1133) 2017-01-05 10:17:24 -05:00
Adrian Secord
4842a362f5 Convert component examples to Swift 3 (#1002)
* WIP

* WIP

* Simplified build script and fixed it to build all schemes.

* WIP

* Renamed script to build_all and added better output.

* Add scripts/list_xcode_workspaces.

* Filtered out the CocoaPods schemes.

* Use Xcode to update Swift to v3.

* Updated tracked touches map from NSNumber to Int.

* Fixed button sorting that was not actually sorting.

* targetContentOffset no longer allowed to be nil.

* "Fixed" failing test by reducing random number range?

* Swift 3 syntax change.

* Swift 3 syntax change.

* Removed invalid center-aligning tests.

Fixed default nav bar alignment test.
2016-12-12 09:55:36 -05:00
Adrian Secord
171e5bfbc5 Remove MDCSwitch examples and catalog usage. (#892)
* Remove MDCSwitch examples and catalog usage.

* Restored deletion of Switch examples.

* Revert "Restored deletion of Switch examples."

This reverts commit efe9fc75ae3310b58fbb4b56c31caedb7a109bf9.

* No, really. Restore Switch examples.

* Removed all Podfile references.
2016-11-28 14:38:32 -05:00
Ed Chin
68651011a0 Showcase a collectionView footer that does not have card style background in a card style collectionView. (#709) 2016-09-30 16:35:05 -04:00
Adrian Secord
0b57f48e1d Removed all warnings from the build.
Reviewers: O1 Material components iOS, randallli

Reviewed By: O1 Material components iOS, randallli

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1633
2016-09-19 10:20:45 -04:00
Adrian Secord
8c3af252be Adding AUTHORS and removing CONTRIBUTORS.txt.
We can credit any contributor who would like to be credited this way, by adding them on request to the AUTHORS file. The copyright statement changes are required for this to work. Note that this has...

Summary:

We can credit any contributor who would like to be credited this way, by adding them on request to the AUTHORS file. The copyright statement changes are required for this to work. Note that this has no legal change, since the contributors always retained their copyright despite the copyright notice, but it's a nice acknowledgement.

Changed copyright statement to include non-Google authors.

Command run:

find * \( -name '*\.m' -or -name '*\.h' -or -name '*\.swift' \) -and -not \( -path 'scripts/external*' -name Pods  \) -print0 | xargs -0 sed -i '' 's/Copyright \(.*\) Google Inc/Copyright \1 the Material Components for iOS authors/'

Added non-source files.

Command run:

grep -Rl 'Copyright .* Google Inc' * --exclude-dir scripts/external --null | xargs -0 sed -i '' 's/Copyright \(.*\) Google Inc/Copyright \1 the Material Components for iOS authors/'

Reviewers: featherless, O1 Material components iOS, randallli

Reviewed By: O1 Material components iOS, randallli

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1415
2016-08-08 08:16:37 -07:00
Sam Morrison
10e11da725 Remove ARC guards from MDC
Reviewers: O1 Material components iOS, ajsecord

Reviewed By: O1 Material components iOS, ajsecord

Subscribers: ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1304
2016-07-22 11:38:27 -04:00
Chris Cox
627206634f [Collections] Adds storyboard example.
Reviewers: O1 Material components iOS, iangordon

Reviewed By: O1 Material components iOS, iangordon

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1192
2016-07-12 11:22:36 -04:00
Adrian Secord
3aedace959 Re-enabled 100-character line limit.
Reviewers: randallli, O1 Material components iOS

Reviewed By: randallli, O1 Material components iOS

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D965
2016-06-13 13:34:57 -04:00
Chris Cox
f5d26d4b84 [Collections] Fixes bug when setting own collection view on MDCCollectionViewController. Also adds editing in example.
Summary: Closes https://github.com/google/material-components-ios/issues/542

Reviewers: O1 Material components iOS, ajsecord

Reviewed By: O1 Material components iOS, ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D897
2016-05-27 11:27:38 -04:00
Chris Cox
6c8ca27405 [Collections] Adds API to allow setting cell ink color at given index path.
Reviewers: ajsecord, #mdc_ios_owners

Reviewed By: ajsecord, #mdc_ios_owners

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D857
2016-05-11 10:19:18 -04:00
Chris Cox
86174317b3 [Collections]! Updates ink to fire on cell highlight/unhighlight for faster response. Also adds demo to catalog.
Summary: Closes https://github.com/google/material-components-ios/issues/498

Reviewers: ajsecord, #mdc_ios_owners, featherless

Reviewed By: #mdc_ios_owners, featherless

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D848
2016-05-09 16:39:16 -04:00
Chris Cox
4e79ce507f [Collections] Adds lightweight generics to NSArray of NSIndexPath
Summary: Closes https://github.com/google/material-components-ios/issues/488

Reviewers: #mdc_ios_owners, ajsecord

Reviewed By: #mdc_ios_owners, ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D832
2016-05-05 15:38:29 -04:00
Chris Cox
2e08c3768d [Collections] Adds example of subclass providing own collection view.
Reviewers: #mdc_ios_owners, ajsecord

Reviewed By: #mdc_ios_owners, ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D816
2016-05-04 10:43:23 -04:00
Chris Cox
787c09ddb0 [Collections] Updates editing example and readme to reverse sort order index paths before removal.
Reviewers: ajsecord, randallli, #mdc_ios_owners

Reviewed By: randallli, #mdc_ios_owners

Subscribers: randallli

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D797
2016-05-02 14:26:22 -04:00
Chris Cox
ee3daf2fe5 Removes broken image.
Reviewers: featherless, #mdc_ios_owners

Reviewed By: featherless, #mdc_ios_owners

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D750
2016-04-22 18:30:54 -04:00
Chris Cox
e88dc4ff3f [Collections] Adds swift example.
Reviewers: #mdc_ios_owners, featherless

Reviewed By: #mdc_ios_owners, featherless

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D737
2016-04-22 15:50:44 -04:00
Jeff Verkoeyen
8b925d001c [Collections] Replace StyleManager with a Styling protocol.
Reviewers: randallli, cjcox, #mdc_ios_owners

Reviewed By: randallli, cjcox, #mdc_ios_owners

Subscribers: randallli

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D720
2016-04-22 14:55:46 -04:00
Jeff Verkoeyen
60ffaa5590 [Collections] Replace EditingManager with an Editing protocol.
Reviewers: cjcox, randallli, #mdc_ios_owners

Reviewed By: cjcox, randallli, #mdc_ios_owners

Subscribers: randallli

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D719
2016-04-22 14:46:04 -04:00
Chris Cox
f15f6d5db6 [Collections] Merge Collections, CollectionCells, and CollectionLayoutAttributes components.
Summary: Adds Collections, CollectionCells, and CollectionLayoutAttributes components

Reviewers: ajsecord, featherless, randallli, #mdc_ios_owners, iangordon

Reviewed By: randallli, #mdc_ios_owners, iangordon

Subscribers: lpromero, featherless, randallli, iangordon, ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D725
2016-04-22 12:04:14 -04:00