56 Commits

Author SHA1 Message Date
featherless
b9404ded10
Revert "Add compile time flag for import style (#2562)" (#2612)
This reverts commit 6791dc4993d3a0ffa11735eeeef0583102621d52.
2017-12-06 11:22:17 -05:00
Louis Romero
6791dc4993
Add compile time flag for import style (#2562)
Closes #2550
2017-12-04 10:06:31 -08:00
Yarden Eitan
f9e187feb4 [Cleanup] remove checks for iOS8 and above as we now only support iOS8+ (#2555) 2017-12-02 22:08:00 -05:00
Junius Gunaratne
7dc9470943 [Themers] Add nullability to themers (#2551)
* Add nullability to themers

* Wrap optional
2017-12-01 17:31:41 -05:00
Sylvain Defresne
c3615fa300 Use framework-style imports. (#2428)
* Use framework-style imports.

MDFInternationalization is built as a framework, so use the style
recommended to import from the framework (#import <...>).

MotionAnimator and MotionInterchange mixed the normal style import
and the framework style import; settle them on the framework style.

* Update MDCActivityIndicator.m

Re-order to match our style guide.

* Update MDCBottomNavigationBar.m

Re-order to match our style guide.

* Update MDCBottomNavigationItemView.m

Re-order to match style guide.

* Update MDCBottomAppBarView.m

* Update MDCButtonBar.m

* Update MDCAppBarButtonBarBuilder.m

* Update MDCAppBarButtonBarBuilder.m

* Update MDCCollectionViewCell.m

* Update MDCAlertController.m

* Update NavigationBarIconsExample.m

* Update MDCNavigationBar.m

* Update MDCItemBarCell.m

* Update MDCTextField.m

* Update MDCThumbTrack.m
2017-11-17 10:39:48 -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
Will Larche
d9e0811a81 [Themer] Updating the protocol generic syntax. (#2440) 2017-11-16 07:59:18 -05:00
Yurii Samsoniuk
06671d1889 [BottomBar] Migrated to MDFi18n. (#2245)
* [BottomBar] Migrated to MDFi18n.

* Swapped dependencies from MDCRTL to MDFi18n
2017-10-26 11:28:46 -04:00
Justin Shephard
03f9eea016 [ButtonBar] - Update setting of insets to use size classes and device type (#1936) 2017-09-07 12:32:48 -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
0ee27517d0 [ButtonBar] Make ButtonBarButton insets in method (#1797)
Refactoring App Bar button builder to be more testable/modular.  Pulling
out a method to create the content edge insets for a button in a button
bar.
2017-08-14 16:36:01 -04:00
Robert Moore
1441a01113 [ButtonBar] Refactor ButtonBarBuilder for testing (#1796)
* [ButtonBar] Refactor ButtonBarBuilder for testing

Pulling out part of the ButtonBarBuilder logic to start making it more
testable.  Extracting the initial configuration of MDCButton from a
UIBarButtonItem into a class method and adding unit tests.
2017-08-14 14:59:12 -04:00
Robert Moore
28f6159e98 [ButtonBar] Remove macro for bit masks (#1795)
Layout hints for the first/last button bar items were using a macro to
check the flag.  Macros are not preferred and should be replaced
wherever possible.

References #1682
2017-08-14 10:15:05 -04:00
ianegordon
68d21a901e [Themer] Avoid deprecation warning on iOS 9+ targets (#1700) 2017-07-26 15:27:45 -04:00
Sam Morrison
4c84b99f2b [Buttons] Deprecate customTitleColor and remove auto-accessibility from setTitleColor (#1609)
* Prefer setTitleColor:forState over customTitleColor

* Mark customTitleColor as deprecated

* Replace customTitleColor implemention

* Replace doc-comment of customTitleColor

* Don't encode customTitleColor

* Remove outdated todo

* Remove outdated comment

* Replace more customTitleColor uses with setTitleColor:forState:

* Update button styles
2017-07-17 16:45:59 -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
Sam Morrison
f437664163 Fix MDCButtonBarColorThemer imports 2017-06-29 15:51:12 -04:00
Junius Gunaratne
2873e798f2 [Themes] Add ability to change catalog theme (#1477)
Discussed merge with Ian offline. Issues with Travis CI may be resolved once the PR is merged.

* Add color to tiles.

* Add theming to catalog

* Update text field tile.

* Implementation method signatures should match those in header.

* Update MDCDrawFunc typedef

* Pass color scheme through NSNotification

* Add component theming

* Add tabbar themer

* Update tab example to use UIAppearance

* Theme sliders based on UIAppearance proxy

* Allow any class conforming to MDCColorScheme

* Override navigation bar color theme for imagery example.

* Update AppBar and ButtonBar color theming

* Update button bar themer comment

* Update button theming

* Remove theme imports where not necessary.

* Fix case of private
2017-06-23 11:36:48 -04:00
Junius Gunaratne
cda52f4e6b [Themers] Add app bar color themer (#1503)
* Add app bar color themer.

* Add dependency for the component it is theming

* Color flexible header instead of nav bar.
2017-06-21 13:19:22 -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
Junius Gunaratne
71d441a065 Component themers and usage example for catalog (#1443)
Adding color scheme component themers.
2017-05-30 17:28:03 -04:00
Adrian Secord
7ba66bf09c Formatted all Objective-C sources with clang-format. (#1133) 2017-01-05 10:17:24 -05:00
Justin Shephard
00733fa42c [ButtonBar] - Adding NSCoding compliance to component, IBDesignable, nullability qualifiers (#980) 2016-12-08 12:04:16 -05:00
Adrian Secord
2997e50c4c Updated refs to GitHub repo with new location. (#885)
* Updated refs to GitHub repo with new location.

* Reverted chagnes to JSON files.
2016-11-22 14:32:50 -05:00
Louis Romero
853a3c5d75 [ButtonBar] Better disabled look (#704)
* [ButtonBar] Better disabled look

This change makes disabled buttons easier to discern, as they were too close to the enabled state.

Before: https://cloud.githubusercontent.com/assets/197492/18784195/d57a803a-8190-11e6-917c-5ad193ae1a0a.png
After: https://cloud.githubusercontent.com/assets/197492/18784199/d7a4a908-8190-11e6-8358-d012c7cdfc7d.png

Closes https://github.com/google/material-components-ios/issues/703.

* Improve the disabled alpha value for text accessibility

Bumped to 0.45 to pass the basic accessibility contrast ratio test on a white background.
2016-09-30 16:35:37 -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
Louis Romero
7550398b6c Port the rendering mode when flipping on iOS 8 and below.
Summary:
The rendering mode is lost when an image is flipped with
-[UIImage imageWithCGImage:scale:orientation:].
When that would happen, actually render the image with it's orientation and
scale, port the template mode, and return that copy.

Closes https://github.com/google/material-components-ios/issues/592.

Test Plan:
Check that back arrow in Catalog is correctly flipped relative to the layout
direction.

Reviewers: randallli, O1 Material components iOS, iangordon

Reviewed By: randallli, O1 Material components iOS, iangordon

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1034
2016-06-28 17:09:25 +02:00
Adrian Secord
da7177c74e Applied the results of arc lint --everything. Again.
Reviewers: O1 Material components iOS, randallli

Reviewed By: O1 Material components iOS, randallli

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1039
2016-06-27 12:00:12 -04:00
Eric Li
976e1d6b43 ≈Prevent buttons from redrawing every time a tint color changes by inlining functionality. Prevent incorrect behavior of nav label getting tint.
Summary:
Prevents MDCNav buttons from redrawing on tint change by inlining functionality. Prevent MDCNav labels from changing color with tint.

Should close:
https://github.com/google/material-components-ios/issues/598
https://github.com/google/material-components-ios/issues/600
https://github.com/google/material-components-ios/issues/591

Reviewers: featherless, O1 Material components iOS, randallli, ajsecord

Reviewed By: O1 Material components iOS, randallli, ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1030
2016-06-24 16:28:43 -04:00
Louis Romero
bec7ec4010 Remove code handling SDK olders than iOS 9.
Summary:
Xcode 7 and iOS 9 SDK are requirement to use Material Components.
This commit removes the code that handles building with an SDK older
than the iOS 9 SDK (i.e. Base SDK).

Note that this does not change anything regarding the Deployment target,
i.e. the minimum OS version an app can run on.

Test Plan: Build with Xcode 7 and above, run with all OS versions from iOS 7 to iOS 10..

Reviewers: O1 Material components iOS, iangordon

Reviewed By: O1 Material components iOS, iangordon

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1024
2016-06-23 22:10:19 +02:00
Justin Shephard
34bad428ee MDC_#492 - Audit for Objective-C Generics
Summary:
Implementation of generics throughout component header & implementation files.
- Where applicable, added generics to collection objects

Files Changed:
MDCActivityIndicator.m
MDCAppBar.m
MDCButtonBar.h
MDCButtonBar.m
MDCAppBarButtonBarBuilder.m
MDCButton.
MDCCollectionViewController.m
MDCCollectionViewFlowLayout.m
MDCCollectionViewStyling.h
MDCInkLayer.m
MDCNavigationBar.h
MDCNavigationBar.m
MDCPageControl.m
MDCPageControlTrackLayer.m
MDCPalettes.m
MDCSpritedAnimationView.m

---
Closes https://github.com/google/material-components-ios/pull/594
GitHub author: ShepJGoogle

!![[https://github.com/google/material-components-ios/pull/594 | This is a child of GitHub pull request #594]]!!.

Reviewers: O1 Material components iOS, #mdc_ios_owners, github-bot

Reviewed By: O1 Material components iOS, #mdc_ios_owners

Subscribers: ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1029
2016-06-23 15:43:37 -04:00
Justin Shephard
9432c19d40 MDC_#512 - Outdated comment mentions non-existing MDCButtonBar+Builder.h
Summary:
Replaced deprecated category mention of MDCButtonBar+Builder.h with updated class MDCAppBarButtonBarBuilder.h

Files Changed:
MDCButtonBar.h

---
Closes https://github.com/google/material-components-ios/pull/597
GitHub author: ShepJGoogle

!![[https://github.com/google/material-components-ios/pull/597 | This is a child of GitHub pull request #597]]!!.

Reviewers: O1 Material components iOS, #mdc_ios_owners, github-bot

Reviewed By: O1 Material components iOS, #mdc_ios_owners

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1028
2016-06-23 14:15:45 -04:00
Eric Li
9cf321366b Prevent incorrect baseline shift when updating button bar buttons.
Summary:
Fix incorrect baseline shifting in button bar buttons.

Fixes: https://github.com/google/material-components-ios/issues/588

Reviewers: randallli, featherless, O1 Material components iOS

Reviewed By: featherless, O1 Material components iOS

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1014
2016-06-21 16:45:18 -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
Eric Li
a08b0a2dc9 visual fix to issue #534 by applying a clear color to button rather than nil
Summary: See: https://github.com/google/material-components-ios/issues/534

Reviewers: cjcox, featherless, O1 Material components iOS

Reviewed By: featherless, O1 Material components iOS

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D950
2016-06-08 13:07:55 -04:00
Louis Romero
759c8d7729 [NavigationBar][ButtonBar] Always set a default value for layoutDirection.
Summary:
Prior to this CL, layoutDirection could be left uninitilized to 0. Being
explicit is more future-proof.

Closes https://github.com/google/material-components-ios/issues/544.

Also support building with older SDKs

Test Plan: Build and run on iOS 8. Nothing should have changed.

Reviewers: featherless, O1 Material components iOS, randallli

Reviewed By: O1 Material components iOS, randallli

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D905
2016-05-26 20:47:35 +02:00
Louis Romero
20bcf06d71 Hotfix for release.
Summary: semanticContentAttribute is only available on iOS 9.

Test Plan: Launch Catalog on iOS 8.

Reviewers: iangordon, O1 Material components iOS

Reviewed By: iangordon, O1 Material components iOS

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D902
2016-05-25 22:27:21 +02:00
Ian Gordon
8ce80041a4 Re-add previous enum values.
Reviewers: randallli, O1 Material components iOS, featherless

Reviewed By: O1 Material components iOS, featherless

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D901
2016-05-25 15:24:53 -04:00
Louis Romero
fa171656af [ButtonBar] MDCButtonBar default layout direction is based on the system's.
Summary:
Prior to iOS 9, the default is LTR.
On iOS 9 and above, it's based on the system setting, read according to
https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPInternational/SupportingRight-To-LeftLanguages/SupportingRight-To-LeftLanguages.html#//apple_ref/doc/uid/10000171i-CH17-SW2

Closes https://github.com/google/material-components-ios/issues/526.

Test Plan:
- Set Application Language to Right to Left Pseudolanguage.
- Open Catalog > Button Bar.
-> Buttons should be laid out: SECOND ACTION | ACTION.

Reviewers: featherless, ajsecord, #mdc_ios_owners

Reviewed By: ajsecord, #mdc_ios_owners

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D884
2016-05-21 02:01:59 +02:00
Louis Romero
56561b40b6 [ButtonBar]? Layout bar button items based on the layout position.
Summary:
When the layout position is trailing, button items are now laid out in the
reverse order, to match UINavigationBar implementation.

This closes https://github.com/google/material-components-ios/issues/516.

Test Plan:
Have a button bar with MDCButtonBarLayoutPositionTrailing and 2 buttons.
Buttons should be laid out in the reverse order.

Reviewers: junius, #mdc_ios_owners, ajsecord

Reviewed By: #mdc_ios_owners, ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D875
2016-05-21 02:00:56 +02:00
Louis Romero
0ca536cf6c Reload the buttons when the tintColor changes.
Summary: Follow-up with https://github.com/google/material-components-ios/issues/511

Test Plan:
Apply the patch in #511
and check that Catalog > AppBar > AppBar (Swift) has all bar elements red.

Reviewers: #mdc_ios_owners, featherless

Reviewed By: #mdc_ios_owners, featherless

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D883
2016-05-19 23:32:44 +02:00
Louis Romero
39bda0a607 Propagate the NavigationBar tint color to the bar button items.
Summary: Closes https://github.com/google/material-components-ios/issues/511

Test Plan:
Apply the patch in https://github.com/google/material-components-ios/issues/511
and check that Catalog > AppBar > AppBar (Swift) has all bar elements red.

Reviewers: ajsecord, #mdc_ios_owners, featherless

Reviewed By: #mdc_ios_owners, featherless

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D862
2016-05-12 00:43:39 +02:00
Jeff Verkoeyen
f7c84317ec [ButtonBar] Remove deprecated APIs.
Summary:
No apparent usage in the following blocking clients:

- Google.

Deleting these deprecated APIs as a result.

Reviewers: ajsecord, #mdc_ios_owners

Reviewed By: ajsecord, #mdc_ios_owners

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D847
2016-05-11 14:11:26 -04:00
Junius Gunaratne
b6a7142a8f [ButtonBar] Add padding property to button bar buttons and position property to button bar
Reviewers: randallli, featherless, #mdc_ios_owners

Reviewed By: featherless, #mdc_ios_owners

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D826
2016-05-05 12:10:39 -04:00
Jeff Verkoeyen
e3a56fe962 [ButtonBar] Check UIBarButtonItem global appearance configuration when creating the buttons.
Summary: Related to https://github.com/google/material-components-ios/issues/370.

Reviewers: randallli, #mdc_ios_owners, larche

Reviewed By: randallli, #mdc_ios_owners, larche

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D625
2016-04-16 00:10:05 -04:00
Jeff Verkoeyen
792c128c8b [ButtonBar] Icon-only buttons use unbounded ink. Buttons with text us bounded ink.
Summary: Closes https://github.com/google/material-components-ios/issues/328.

Reviewers: #mdc_ios_owners, ajsecord

Reviewed By: #mdc_ios_owners, ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D576
2016-04-12 14:40:25 -04:00
Adrian Secord
2e247f2977 Renamed commonInit methods.
Summary: Fixes https://github.com/google/material-components-ios/issues/159.

Reviewers: featherless, #mdc_ios_owners

Reviewed By: featherless, #mdc_ios_owners

Subscribers: featherless

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D508
2016-04-07 10:46:00 -04:00
Adrian Secord
105810c544 Exposed ink style and max ripple radius and modified MDCButtonBarButton.
Summary: Fixes https://github.com/google/material-components-ios/issues/228.

Reviewers: #mdc_ios_owners, featherless

Reviewed By: #mdc_ios_owners, featherless

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D507
2016-04-07 10:39:41 -04:00
Jeff Verkoeyen
f086f125a5 [ButtonBar] Document sizeThatFits: behavior.
Reviewers: ajsecord, #mdc_ios_owners

Reviewed By: ajsecord, #mdc_ios_owners

Subscribers: ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D431
2016-03-31 10:38:26 -04:00