44 Commits

Author SHA1 Message Date
ianegordon
2a38d42711
[Dialogs] Rounded corner example (#2881)
* [Dialogs] Rounded corner example

* FB
2018-01-31 15:53:02 -05:00
danblakemore
dea8e3c7f4 [Dialogs] Added Example for issue #2860 to Dragons (#2864)
* [Dialogs] Added Example for issue #2860 to Dragons

Added an example to the dialogs examples which shows a dialog from a presented
view controller. Upon dismissal, the content of the view controller (designed to
obviously demark its bounds) shifts due to #2860.

* Changing the dialog content to better illuminate why this example exists.

* Added more informative titles

The presented view controller how has a title which further illustrates the
bounds change since the navigation bar's content shifts too. Also updated the
catalog description.

* Update copyright dates to help kokoro.

Copyright files only during a time range in which they actually existed.
2018-01-26 06:43:33 -08: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
featherless
211ca772ea
[Dialogs] Migrate to Material Motion. (#2481)
This change implements the Material Motion spec for the Dialogs component using the Motion Interchange, Animator, and Transitioning APIs.

Many of the existing APIs will be able to be deprecated or made private in the future, though there is considerable existing downstream client usage of many of these APIs so this will need to be done with some care.

The client migration path for this change will look something like this on average:

```objc
// Old API
_transitionController = [[MDCDialogTransitionController alloc] init];
self.transitioningDelegate = _transitionController;		
self.modalPresentationStyle = UIModalPresentationCustom;

// New API
self.mdm_transitionController.transition = [[MDCDialogTransition alloc] init];
```
2017-11-28 11:08:35 -05:00
Randall Li
2f29f00d86 Fixed some compiler warnings (#2426)
* Added warnings to examples.

* fixed some warnings

* using button sender parameter.

* use button sender in example

* use button sender in example

* removed sender from methods that don’t use it.

* removed sender from methods that don’t use it.

* use button sender in example

* use button sender in example

* use button sender in example

* use button sender in example

* Fixed init of header configurator to use passed in parameter

* removed unused API

* use button sender in example

* Revert "Added warnings to examples."

This reverts commit 91f0480f86cb609c47b00f1346f82de67c31c4e9.

* fixed example: Using the view controllers navigationItem rather than creating a new one.

* removed finished checks from animation blocks in examples.

* reverted id sender checks

* revert id sender check for Flexible header UINavigationBar

* revert clug

* revert clug

* addressing nits

* removed sender check for FeatureHighlightTypicalUseView

* more nits
2017-11-22 10:51:55 -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
ianegordon
53929d8594 [Dialogs] Set Dialog example button to open material.io (#2214)
* Change dialog sample to open URL

* Create a saparate view controller to open the external URL
2017-10-19 10:53:05 -04:00
Adrian Secord
479f7b1141 Remove trailing whitespace everywhere. (#2168) 2017-10-13 11:33:35 -04:00
Will Larche
96fb533554 [Catalog] Fixes improper use of Bundle and assets (#2118)
* [Catalog] Fixing bundle usage in some examples.

* [Examples] Correcting use of assets and bundles.

* [Examples] Formatting.
2017-10-08 15:04:48 -04:00
Robert Moore
a5e28488f9 [Dialogs] Size action buttons during layout (#2065)
Buttons were previously being sized during `viewDidLoad`, which caused
problems if UIAppearance caused changes to contentEdgeInsets. Instead,
the buttons should be sized before layout of the dialog's subviews.

Also fixing some examples that were incorrectly sizing buttons before
layout.

Closes #1943
2017-10-01 15:58:48 -07:00
ruizhao
bd55e33bee [Dialog] Fix alert controller, title and message take half screen even they are nil (#1931)
* [Dialog] Fix alert controller, title and message take half screen even they are nil

When actionScrollView's height exceed the container view's height. If the contentScrollView's height is very small or 0, we are leaving a huge white spaces for contentScrollView.

* Add an example demostrating the new action and body sizing

* Fix formatting, enable Dynamic Type
2017-09-08 12:01:46 -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
22d19b7ae6 [Dialogs] Fix example class warnings (#1850)
A couple of methods were defined in the main class interface but
implemented in the category. They should be defined in the category and
implemented there as well.
2017-08-19 05:41:24 -04:00
Martin Petrov
1e14d41091 Explicitly annotating some known ObjC methods. (#1617)
This improves Swift4 compatibility, see:
https://help.apple.com/xcode/mac/current/#/deve838b19a1
2017-07-10 19:46:22 -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
Martin Petrov
ec1feb81a5 [MDCPalette] Use class properties (#1470)
* Replacing methods with class properties.

* Updating docs to reflect new Swift call style.

* Updating examples.

* Updating ObjC examples to use dot syntax
2017-05-30 08:20:00 -04:00
Randall Li
1c7ca93142 ![ColorThemer] Reorganize source to create separate targets for each color themer. (#1466)
* reorganize the color themer classes so that they are separate targets for each mutator.

* moved source files out of MaterialThemes.

* moved theme examples into their main component locations out of themer’s.

* renamed core subspec to 'Component'
2017-05-26 17:17:55 -04:00
Junius Gunaratne
0cb6ce6d5f Adding MDC themes (#1401)
* Adding MDC themes

* Update feature highlight view color properties

* no message

* Remove loadView

* Move set default color to init

* Dedup color setters

* Remove redundant color sets

* Sync with latest commits

* Update theme example title

* Adding alert theming.

* Add feature highlight private changes

* Remove alert example

* Update themer examples

* Add documentation

* Adding docs

* Formatting and comment updates.

* Create examples of changing theme colors.

* Formatting.

* Formatting
2017-05-12 16:38:49 -04:00
Alastair Tse
4a46c8c19e Monochromatic sweep of all catalog components (#1370)
* Replace MDC all icons

* Update border

* Replace MDCActionExtension icon with new logo

* Update all headers to be white on black

* Make Catalog greyscale to match Material’s style.

* Fix collection tile

* Update all headers to be white on black

* Make Catalog greyscale to match Material’s style.

* Fix collection tile

* WIP: Updating TabBar example to use black/green theme.

* WIP: Monochoroming all examples.

* Switch MDC Catalog to a black and white theme (#1355)

* Replace MDC all icons

* Update border

* Replace MDCActionExtension icon with new logo

* Update all headers to be white on black

* Make Catalog greyscale to match Material’s style.

* Fix collection tile

* Update all headers to be white on black

* Make Catalog greyscale to match Material’s style.

* Fix collection tile

* Fix floats

* Make Catalog greyscale to match Material’s style.

* More black and whiting

* WIP: Snackbar and global style

* Simplify snack bar examples.

* Page control
2017-05-05 16:16:47 -04:00
ianegordon
74e6232777 [Dialogs] Fix AlertController rotation layout (#1306)
No longer uses outdated cached bounds values.
2017-04-05 16:04:41 -04:00
Will Larche
8c5350de31 [All] Formatting. (#1269) 2017-03-22 12:18:15 -04:00
ianegordon
9f92b161db [Dialogs] Add Dynamic Type support to Alert controller (#1213)
* [Button] Add Dynamic Type support

* Cleanup & documentation

* added comment about default value.

* Add basic unit testing

* Use proper constant for comparing FP in unit test

* Remove extra WS

* Cleanup unit tests

* [Dialogs] Add Dynamic Type support to Alert Controller

* Add clarifying documentation.
2017-02-27 15:36:52 -05:00
ianegordon
71d1886636 [Dialogs] Add a non-dismissing example. (#1184)
* [Dialogs] Add a non-dismissing example.

* Fix indent.
2017-02-06 15:20:02 -05:00
Adrian Secord
7ff646b58a [Swiftlint] Moar swiftlint fixes (#1155)
* Quieted swiftlint down in scripts/format_all.

* BONUS clang-format for ObjC code.

* Fixed two stray ObjC warnings (not swiftlint related).

* Fixed remaning swiftlint warnings.

* Fixed typos in Shrine fixes.

* Swift cleanups, again.

This reverts commit 7489fca4e4741ae02b406cdaacaf1dae26e19837.
2017-01-25 17:23:20 -05:00
Adrian Secord
7489fca4e4 Revert "Swift cleanups."
This reverts commit 129789c601a2bb6b09648af953c5433ebe3cebe0.
2017-01-25 16:58:40 -05:00
Adrian Secord
129789c601 Swift cleanups. 2017-01-25 16:56:24 -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
Sam Symons
bb561ac257 [Scripts] SwiftLint integration (#1129)
* Integrate SwiftLint in the Catalog.

* Update the disabled SwiftLint rules.

* Reference a local swiftlint.yml symlink.

This prevents us from getting warnings about code style violations from the other demos.

* Fix SwiftLint violations in the Catalog and Components.

* Ignore the `third_party` directory when running the linter.

We should not have to deal with warnings in code we may not be able to fix easily.

* Integrate SwiftLint into Shrine.

Additionally, fix a number of warnings introduced.

* Run SwiftLint on Travis.

* Enable many of the previously disabled rules and correct them.

* Fix control statement violations from SwiftLint.
2017-01-06 16:37:23 -05:00
ianegordon
2cbfa20b1b [Catalog] Update dialog storyboard to rotate properly (#1031) 2016-12-13 19:38:03 -05:00
Adrian Secord
e93a16ca02 Capitalize "Material" in documentation (#1014)
* s/material design/Material Design/g

* s/material components/Material Components/g

* s/material\([ \t\n]\)/Material\1/g

* s/aterial design/aterial Design/g
2016-12-13 08:06:55 -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
Ian Gordon
7f596f6f2a [Catalog] Restore Xcode 7 compatibility
Summary: Save in backwards compatibility-mode so this is still usable on Xcode 7.

Reviewers: O1 Material components iOS, shepj

Reviewed By: O1 Material components iOS, shepj

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1673
2016-09-27 17:23:47 -04:00
Ian Gordon
0e3b8b2a35 [Dialogs] Add disable background dismiss property
Summary:
This add the ability to disable dialog dismiss on dimmed background view.

Closes MDC-797.

Add documentation

Reviewers: ajsecord, O1 Material components iOS

Reviewed By: ajsecord, O1 Material components iOS

Subscribers: samnm

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1667
2016-09-27 15:07:10 -04:00
Sean O'Shea
ef7d60b174 Some examples are missing super calls to viewDidLoad (#681) 2016-08-25 15:49:00 -04:00
Ian Gordon
1aaa85381d [MDCButton] Add UI_APPEARANCE_SELECTOR to customTextColor.
Summary:
This allows clients to customize the color of the text in the buttons with the appearance proxy.

We should add UIAppearance support to all of our visual elements, but this specific change addresses a need from an internal client.

Test Plan:
Run MDCCatalog
Dialogs-Alert Controller-Show Alert

Note purple button text.
Note other buttons do not have purple text.

Reviewers: ajsecord, O1 Material components iOS

Reviewed By: ajsecord, O1 Material components iOS

Subscribers: ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1484
2016-08-17 13:33:09 -04:00
Sean O'Shea
a944e1f354 Minor formatting issues which mostly impact the catalog app. (#666) 2016-08-11 10:18:49 -04:00
Ian Gordon
26719621fc [Catalog] Add a dialog with an input field for keyboard testing
Reviewers: randallli, O1 Material components iOS, ajsecord

Reviewed By: randallli, O1 Material components iOS, ajsecord

Subscribers: ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1361
2016-08-08 18:38:27 -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
randallli
681cc2b6f7 [Docs] Replaced incorrect name of the product. Material Components *for* iOS
Summary:
s/material components ios/Material Components for iOS/
s/material components for ios/Material Components for iOS/

lint copy edit line length

Reviewers: ajsecord, O1 Material components iOS

Reviewed By: ajsecord, O1 Material components iOS

Subscribers: ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1372
2016-08-01 16:45:12 -07:00
Ian Gordon
1fe4ac3f64 [Dialogs] Add Alert Controller
Summary: This is the initial import of the material spec'd alert controller.

Reviewers: O1 Material components iOS, ajsecord

Reviewed By: O1 Material components iOS, ajsecord

Subscribers: ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1258
2016-07-25 17:12:33 -04:00
Adrian Secord
65a05eed31 Lowercase "material design" in text.
Summary: "Material design" is not capitalized except when referring to the actual Material Design team at Google.

Reviewers: O1 Material components iOS, randallli

Reviewed By: O1 Material components iOS, randallli

Subscribers: randallli, featherless

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1306
2016-07-25 14:13:08 -04:00
Ian Gordon
3742dd4849 [Dialogs] Initial Import
Summary:
Initial import of our modal presentation controller and transition controller.

The interfaces have been previously reviewed in our API Review process.

This will land on the branch feature-dialog.

Test Plan: Example added to catalog.

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

Reviewed By: ajsecord, O1 Material components iOS

Subscribers: samnm, randallli

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1066
2016-07-14 13:57:15 -04:00