132 Commits

Author SHA1 Message Date
ianegordon
49de50edae Consolidate installation requirements in the main README (#2809) 2018-01-05 13:50:38 -05:00
Yarden Eitan
224115d5f1
stop weird behavior of swiping to dismiss cells in collection views if 2 fingers are swiping at the same time (#2792) 2018-01-03 15:39:57 -05:00
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
Robert Moore
0bade5a52e
[Collections] Add BUILD file and add missing import (#2698) 2017-12-13 13:52:13 -05:00
featherless
fb7109442a [Collections] Fix iOS 11-specific bug where section headers would overlap scroll indicators. (#2572) 2017-12-08 17:38:14 -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
Yurii Samsoniuk
2f1921b64e [Collections] Use MDCPalettes for info bar colors (#2364) 2017-11-13 14:32:22 -05:00
Andrés
8cda30a778 [Collections] Support SafeAreaInsets in MDCCollectionInfoBarView. (#2378) 2017-11-10 11:52:54 -05:00
Martin Petrov
f98a9d42ed @objc annoaing catalog by convention (#2305) 2017-10-30 10:24:17 -04:00
Andrés
67825350b2 [Collections] Don't inset sections when there is a safe area inset. (#2258) 2017-10-23 17:36:35 -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
Martin Petrov
f9cf78cd0f [Collections] Modernize Swift in styling readme. (#2133) 2017-10-09 12:52:43 -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
7f4c4e18c5 [Bundles] Use explicit class in bundleForClass (#1942)
Using `[self class]` when loading a bundle can result in missed resources when
a method is called from a subclass.  To prevent these errors, components should
be explicit about which class is being used to load bundles.

References #1941 (Components)
2017-09-05 14:17:54 -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
5498005f65 [Catalog] Enabling all "unused" warnings (#1875)
Re-enabling warnings for unused parameters. Turning on every other
unused warning I could find.

Closes #1874
2017-08-29 17:57:41 -04:00
Robert Moore
6daa64df87 [Collections] Remove dismiss animation rotation (#1842)
Dismissing a cell or section in a UICollectionView that uses an
MDCCollectionViewController with the default editor will now use a
simple linear dismiss animation.

Closes #1833
2017-08-24 09:09:51 -04:00
Robert Moore
2b6552d09f [Collections] Allow selection of cells with hidden ink (#1739)
MDCCollectionViewController does not receive messages for
`-collectionView:didSelectItemAtIndexPath:` if it responds `NO` to
`-collectionView:shouldHighlightCellAtIndexPath:`. By allowing
highlight, but not performing a highlight animation on the cell, the delegate
will receive *didSelect* messages for cells with hidden ink.

Closes #1446
2017-08-23 22:38:41 -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
Robert Moore
70026b323b [Collections] Decoration frame is unset when null (#1845)
If a section no longer has any cells remaining, the
UICollectionViewLayoutAttributes for that section's decorationView
should not set the frame to CGRectNull.  Instead, the frame should
remain untouched.

Closes #1844
2017-08-18 16:50:11 -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
155a3975be [Collections] Fix header info view z-index (#1798)
The Info Bar view wasn't correctly applying the z-index value from the
LayoutAttributes.  This resulted in the header appearing behind the
collectionView cells on iOS 11.

Closes #1786
2017-08-14 16:56:30 -04:00
Robert Moore
080cc37058 [Collections] Replacing macros with function calls (#1787)
A few colors were generated using macros, so they are now replaced with
actual method and function calls.

References #1682
2017-08-11 17:53:59 -04:00
Robert Moore
417ce2b4f6 [Collections] Adding unit tests for flow layouts (#1779)
Documenting current attributes behavior with some unit tests.
2017-08-11 10:19:12 -04:00
Robert Moore
0223d431e5 [Collections] Custom section insets call delegate (#1752)
Calling the public API for determining the insets for a CollectionView
section instead of the internal method. This allows subclasses to
override the implementation and determine custom section insets.

Closes #1738
References #1711
2017-08-08 15:10:39 -04:00
Justin Shephard
abb81d969b [Collections] - Fix for possible infinite recursion (#1711)
* [Collections] - Fix for possible infinite recursion in the case the UICOllectionViewDelegate methods call loadView if self.collectionView has not been set.

* [Collections] - Removed commented code, added comment as to why we shouldn’t call delegate method, updated passed argument in method

* [Collections] - Changed from self.collectionView to passed in collectionView param in delegate methods. Added check for nil _styler and divide by zero for column count
2017-08-03 14:13:26 -07: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
Yurii Samsoniuk
3c92cfe80c Fallback to default cell background color on nil. (#1630) 2017-07-12 12:53:13 -04:00
Gauthier Ambard
0b905c647d [Collections] Do not invalidate layout for all gesture beginning (#1623)
If Swipe-to-Dismiss is enabled on a collection, all gestures different from swipe-to-dismiss trigger UIGestureRecognizerStateEnded on the swipe-to-dismiss gesture.
This commit modifies the cancellation of the gesture by not invalidating the layout if the dismissal has not started.

This closes #1613
2017-07-12 12:48:49 -04:00
Robert Moore
fa10d655d7 Remove uses of typeof and the ?: operator (#1601)
Make the code base more portable by replacing some GNU extension code
with C99-compatible versions.

* Replace shortcut ?: operator with explicit middle (true) terms
* Remove pointer inequality checks in conditionals
* (Cleanup) Change to #include for <tgmath.h> based on style guide

Closes #846
2017-07-11 17:39:45 -04:00
Adrian Secord
4dba0dfff8 Add -Wstrict-prototypes and fix errors. (#1532) 2017-06-19 17:33:37 -04:00
Randall Li
266a716f60 Fix imports to use umbrella imports (#1529)
* [ColorThemes] Use umbrella header instead of MDCColorScheme

* [Application] Use umbrella header instead of class header

* [Button] use umbrella header in private header

* [Typography] use umbrella header in private header

* icons using umbrella header in individual icon class

* [Icons] added header to umbrella header

* [collection] umbrella header instead of class header in test

* [Collections] use umbrella header in private header

* [ActivityIndicator] use umbrella header in private header

* [ButtonBar] use umbrella header in private header

* [Dialog] use umbrella header in private header

* [featurehighlight] use umbrella header in private header

* [snackbar] use umbrella header in private header

* [textFields] use umbrella header in private header

* [thumbtrack] use umbrella header in private header

* [Overlay] use umbrella header in private header

also removed spurious ’s’ at end of MaterialOverlay.h file

* [slider] use umbrella header in private header

* [buttonBar] use umbrella header in private header

* [slider] use umbrella header in test

* [Overlay] fixed overlay reference to use umbrella header
2017-06-19 15:57:48 -04:00
Randall Li
3e0bf2f069 white space nit 2017-05-25 15:45:16 -04:00
Scott Hyndman
eed028eacb [Docs] Adds API documentation roots and tidies up here and there. (#1425)
* [Docs] Marks component files as API documentation roots.

Used by the site generator to determine where to build API docs. I
marked everything built by the previous version.

* [Docs] Adds a prefix to all Material guidelines links.

* [Docs] Adds API doc links to some components.
2017-05-12 16:03:56 -04:00
Chris Cox
52ea84adbd Fixes indent. (#1428) 2017-05-11 14:23:28 -04:00
Chris Cox
33ceb64ee6 [Collections] Fixes SwipeToDismiss ability to swipe when not editing. Closes #1207, #1300, #1301. (#1427) 2017-05-11 12:17:38 -04:00
Scott Hyndman
80dab378de [Docs] Fixes a couple broken links. (#1418) 2017-05-10 13:56:32 -04:00
Scott Hyndman
1571a1b9ee [Docs] Nests components in the navigation as spec'd. (#1404)
Also took the opportunity to remove an unneeded liquid style
application.
2017-05-09 11:49:44 -04:00
Scott Hyndman
1bec0a903a [Docs] Misc. cleanup (#1403)
* [Docs] Changes an icon list class name.

* [Docs] Adds annotations to all installation code snippets.

* [Docs] Fixes screenshot sizes in PageControl README.

* [Docs] Fixes a broken link on the homepage.

* [Docs] Adds a stable repository branch field to the site metadata.

Used to link to the GitHub source tree.

* [Docs] Specify platform in docs root title.
2017-05-08 18:05:05 -04:00
Adrian Secord
b2b433f366 [Collections] Updated screenshot. (#1383) 2017-05-05 16:48:15 -04:00
Felix Emiliano
3a4c859f37 [Collections] Temporarily expose cellWidthAtSection: in MDCCollectionViewController.h (#1358)
* Added cellWidthAtSection: to .h

* [Collections] Temporarily expose cellWidthAtSection: in MDCCollectionViewController.h
2017-05-03 16:44:50 -04:00
Scott Hyndman
4a011e75a5 [Docs] Docstravaganza (#1330)
* [Docs] Adds platform configuration for the doc site.

* [Docs] Adds path metadata for documentation site.

This field is used to determine where the file will appear in the
doc site.

* [Docs] Updates Material guideline links to latest URL.

material.google.com -> material.io/guidelines

* [Docs] Introduces a separate component index for the docsite.

* [Docs] Changes the directory used for site generation.

* [Docs] Moves documentation-site-only Markdown into its own directory.

* [Docs] Changes material.io links to use https.

* [Docs] Renames the howto and contributing docsite sections to docs.

* [Docs] Adds a navTitle field to the collection editing/styling pages.

* [Docs] Changes the FAQ heading to be one size bigger.

* [Docs] Changes the tutorial title.

* [Docs] Adds icons to three more components.

* [Docs] Introduces a root component directory called /catalog/.

* [Docs] Adds an icon to the AnimationTiming component.

* [Docs] Adds an icon for the typography component.

* [Docs] Reformats the docsite index.
2017-05-01 17:27:38 -04:00
ianegordon
f018e09afe Eliminate static analyzer warnings. Simplify Collection supplementary views (#1316) 2017-04-17 17:46:55 -04:00
Will Larche
3f99ed2dd9 [All] replacing ~~~ with ```. (#1324) 2017-04-17 17:06:37 -04:00
Scott Hyndman
0913aa9aaf [Docs]: Updated link list classes. (#1320)
Link lists now use BEM notation across the board. It's more verbose, but is
aligned with the conventions of MDC-web and the docs site.
2017-04-13 17:25:23 -04:00