88 Commits

Author SHA1 Message Date
Yarden Eitan
7aee1fb68a
add missing .jazzy.yaml files (#4939)
Re-ran our generate .yaml script.
2018-08-28 20:40:32 -04:00
Robert Moore
a09f2f7bc1 [Switch] Document the use of UISwitch (#4714)
iOS does not implement Material Switches because the iOS native UISwitch should be used instead. This is captured in the cross-platform adaptation guidelines.

Closes #3862
2018-08-06 16:57:11 -04:00
sfdexter
3e68e9761f Placeholder documentation for future components and guidance (#3568) 2018-04-27 19:05:00 -04:00
Adrian Secord
ab151cdc65 Delete MDCSwitch. (#990)
* Removed MDCSwitch.

* Remove Switch from the podspec and update pods.
2016-12-09 11:27:01 -05:00
Will Larche
1080e89422 [Documentation] Putting Swift snippets before Objc (#960)
* [ActivityIndicator] Swift first in README

* [AnimationTiming] Swift first in readme.

* [AppBar] Swift first in readme.

* [ButtonBar] Swift first in readme.

* [Buttons] Swift first in readme.

* [CollectionLayoutAttributes] Swift first in readme

* [Collections] Swift first in readme.

* [Dialogs] Swift first in readme.

* [FeatureHighlight] Swift first in readme.

* [FlexibleHeader] Swift first in readme.

* [FontDiskLoader] Swift first in readme.

* [HeaderStackView] Swift first in readme.

* [Ink] Swift first in readme.

* [NavigationBar] Swift first in readme.

* [OverlayWindow] Adding missing site comments. Swift first in readme.

* [PageControl] Swift first in readme.

* [Palettes] Swift first in readme.

* [ProgressView] Swift first in readme.

* [RobotoFontLoader] Swift first in readme.

* [ShadowElevations] Swift first in readme.

* [ShadowLayer] Swift first in readme.

* [Slider] Swift first in readme.

* [Snackbar] Swift first in readme.

* [SpritedAnimationView] Swift first in readme.

* [Switch] Swift first in readme.

* [Typography] Swift first in readme.

* [ShadowLayer] Reducing font size in readme.

* [Switch] Reducing font size in readme.
2016-12-07 10:31:34 -05:00
Adrian Secord
b9fdbd6b11 Deprecated Switch and removed its examples. (#951) 2016-12-06 15:44:51 -05:00
Louis Romero
e7198c41e3 Fix the hero video appearance in GitHub. (#916)
* Comment image

* Handle site vs GitHub distinction. Also updates the alt texts to match the component.
2016-12-01 12:52:26 -05:00
Will Larche
5ca7c0bcf8 [Readme] Removing dead link in components. 2016-11-30 13:32:06 -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
Adrian Secord
9509c41826 Internal change 138179679. (#866) 2016-11-18 14:24:23 -05:00
Adrian Secord
6aae38dfa7 Added haptic feedback to MDCSwitch (#812)
* [Switch] Added haptic feedback to match UISwitch.

* Added runtime protection.

* Integrated feedback from larche's PR #750.

* Removed haptic tap from the prepareHapticFeedback method.
2016-10-28 14:02:45 -04:00
Chuck Hays
ceeba25968 [MDCSwitch] Update objective-c example to match swift (#777)
Updates MDCSwitch objective-c docs to match the swift selector name.
2016-10-19 12:11:33 -04:00
Sylvain Defresne
6f7b4ebf2b Update colours of MDCSwitch when changing tint color. (#758)
Fix the issue that the tint color was only respected when the switch
changes from off to on state and update the catalog to set the tint
color after changing the switch state to on.

See issue https://github.com/google/material-components-ios/issues/757.
2016-10-17 15:21:56 -04:00
Adrian Secord
c2b4b3d258 Fixed Xcode 7 analyzer warnings about leaking CGPaths in MDCSwitch.
Reviewers: O1 Material components iOS, samnm

Reviewed By: O1 Material components iOS, samnm

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1674
2016-09-27 17:36:03 -04:00
Sam Morrison
90d54bcd55 [MDCSwitch] Only dispatch control events for user generated changes
Reviewers: ajsecord, O1 Material components iOS

Reviewed By: ajsecord, O1 Material components iOS

Subscribers: iangordon

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1668
2016-09-27 16:18:11 -04:00
Sam Morrison
19a06ed425 Change MDCSlider and MDCSwitch to use NSSecureCoding
Reviewers: O1 Material components iOS, ajsecord

Reviewed By: O1 Material components iOS, ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1670
2016-09-27 15:54:15 -04:00
Sam Morrison
cd1ac75d8f Optimize and simplify MDCSwitch
Summary:
... by removing the MDCThumbTrack dependency. There should be absolutely zero functional changes to the switch other than it being faster to render.

Most of the changes here are based off of MDCThumbTrack, namely the touch handling.

For a 2 second animation of 40 switches:
* Original MDCSwitch renders an average of 33.6 frames
* Fast MDCSwitch renders an average of 98.5 frames
* UISwitch renders an average of 118.7 frames

The time to instantiate each of the sets of 40 switches was similar, although due to the fast MDCSwitch depending on image tinting it is the slowest to instantiate. It would not be unreasonable to cache tinted images if this becomes a performance concern.

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

Reviewed By: randallli, ajsecord, O1 Material components iOS, iangordon

Subscribers: randallli, iangordon

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1524
2016-09-20 15:46:38 -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
Sam Morrison
f19a6c92a1 Remove SKDisplayLinkInterface left over in MDCSwitch stress test
Reviewers: O1 Material components iOS, ajsecord

Reviewed By: O1 Material components iOS, ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1609
2016-09-12 18:02:28 -04:00
Sam Morrison
63d907e24e Stress test for MDCSwitch
Reviewers: randallli, O1 Material components iOS, iangordon, ajsecord

Reviewed By: randallli, O1 Material components iOS, iangordon, ajsecord

Subscribers: ajsecord, randallli

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1593
2016-09-12 17:54:26 -04:00
Will Larche
7a4c71801f Api docs links were broken in READMEs
Summary:
[Site] Api docs in README files are now explicit.
closes https://github.com/google/material-components-ios/issues/690

Reviewers: O1 Material components iOS, shepj

Reviewed By: O1 Material components iOS, shepj

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1552
2016-08-29 18:31:23 -04:00
Justin Shephard
f53506ea28 Site_Readme_Links - Added Jekyll conditional with links to site/github documentation
Summary:
Merge branch 'develop' into Site_Readme_Links

Site_Readme_Links - Change of variable name

Site_Readme_Links - Spelling correction on FontDiskLoader

Reviewers: O1 Material components iOS, randallli

Reviewed By: O1 Material components iOS, randallli

Subscribers: randallli

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1507
2016-08-23 10:54:23 -04:00
Justin Shephard
685ea43198 MDC_#546 - Start of separation of README.md and yaml
Summary: Created separate README.md and README.yaml files to remove the odd display of the md in GitHub.

Reviewers: O1 Material components iOS, ajsecord

Reviewed By: O1 Material components iOS, ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1496
2016-08-18 16:55:20 -04:00
Ian Gordon
8ab45d01b3 Add RTL support to Switch
Summary: If we are in RTL mode, set the Switch's transform to flip.

Test Plan:
Verified Catalog-Switch-MDCSwitchandUISwitch
iPhone 6 Sim - iOS 8
iPhone 6 Sim - iOS 9
iPhone 5 - iOS 8
iPhone 6 - iOS 9

Reviewers: ajsecord, O1 Material components iOS

Reviewed By: ajsecord, O1 Material components iOS

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1462
2016-08-12 15:24:21 -04:00
Ian Gordon
934b367452 Switch init cleanup.
Test Plan: Catalog works as expected on iPhoneSim 6 - iOS 9.

Reviewers: O1 Material components iOS, randallli

Reviewed By: O1 Material components iOS, randallli

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1457
2016-08-11 15:32:15 -04:00
Max Luzuriaga
09b9fcc739 [Switch] Custom accessibility labels
Summary:
Add two properties, `onAccessibilityLabel` and `offAccessibilityLabel` to MDCSwitch to allow users of the switch to specify their own accessibility labels other than the default ones.

Also fixed the existing behavior, which was attempting to get labels out of MaterialSwitch.bundle, which wasn't working the way we were doing it. This meant that no labels were showing up for the Switch whatsoever. I fixed that and kept it as default behavior.

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

Reviewed By: ajsecord, randallli, iangordon, O1 Material components iOS

Subscribers: iangordon, ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1354
2016-08-11 10:44:59 -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
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
Max Luzuriaga
7cfaf9b096 [ThumbTrack] Slider and Switch implement isTracking UIControl method
Summary:
Before, Sliders and Switches would always return `NO` for the UIControl method `-isTracking`. Now this method passes through to the thumb track, which is then determined by whether or not the user is dragging the thumb.

Reason for this change is to keep parity with UISlider/UISwitch and because at least one internal team relies on this functionality in their existing slider usage.

Reviewers: O1 Material components iOS, randallli

Reviewed By: O1 Material components iOS, randallli

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1287
2016-07-21 11:31:24 -04:00
Justin Shephard
9f328d5eca MDC_#524 - Fixed RTL support for SwitchTypicalUseSupplemental
Reviewers: O1 Material components iOS, ajsecord

Reviewed By: O1 Material components iOS, ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1193
2016-07-14 15:21:19 -04:00
Max Luzuriaga
fba387153f [Slider] Make thumb view hollow when on the minimum value.
Summary:
Makes thumb view hollow when the thumb is on the minimum value. Animates into this state when you move the thumb to the minimum value.

{F5135}

This update includes a sizable refactor of how MDCThumbTracks are updated. I split up the three phases of updating the views into:

1. No-animation block
2. Main animation block
3. Secondary animation block

The first applies changes that you want to see reflected instantly, the second does the main animation of moving the thumb and "on" layer, and the third handles the secondary animation of the thumb animating into this hollow minimum value state. This animation is more generally defined as the animations on the thumb that occur after the thumb reaches its position on the track.

Callers can now specify when they update the thumb whether they want the thumb move to be animated, and separately whether the thumb should animate after arriving at its destination. This way, we can handle the difference between taps on the track, drags of the thumb, and code-based non-animation updates. With taps we want both to be animated, with dragging we want only secondary update to be animated, and if you call `-updateValue:` directly, neither should be animated.

This refactor accounts for those cases, and makes the code a little easier to understand in my opinion.

Closes #555

Relies on D956

Reviewers: ajsecord, O1 Material components iOS, randallli

Reviewed By: ajsecord, O1 Material components iOS, randallli

Subscribers: ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D963
2016-06-23 11:49:56 -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
25ea19e76a updated examples and readme to use new swift selector syntax
Summary:
Updated project to use new swift #selector syntax

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

Reviewers: featherless, O1 Material components iOS

Reviewed By: featherless, O1 Material components iOS

Subscribers: featherless

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D938
2016-06-06 15:43:37 -04:00
Adrian Secord
4b3b06d2ce [Website] Added hero videos to component README.md files.
Part of https://github.com/google/material-components-ios/issues/365.

Summary:
Part of https://github.com/google/material-components-ios/issues/365.

Added new files, removed old screenshots and videos.
Updated README.md references to videos/screenshots.

Reviewers: #mdc_ios_owners, junius

Reviewed By: #mdc_ios_owners, junius

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D835
2016-05-05 16:40:48 -04:00
Ian Gordon
17f46bfe53 [Switch] Add icons on the thumbview
Reviewers: tschweitzer, #mdc_ios_owners, randallli

Reviewed By: #mdc_ios_owners, randallli

Subscribers: randallli, iangordon

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D771
2016-05-03 15:24:59 -04:00
Adrian Secord
f65f9e2ac4 Remove command prompt ('$') from command-line examples so they can be trivially copied and pasted.
Reviewers: #mdc_ios_owners, cjcox

Reviewed By: #mdc_ios_owners, cjcox

Subscribers: cjcox

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D795
2016-04-29 10:56:10 -04:00
Jeff Verkoeyen
21d5cf1d04 Global find-and-replace of 'kMDC' with 'k'.
Summary: Closes https://github.com/google/material-components-ios/issues/435.

Reviewers: ajsecord, #mdc_ios_owners

Reviewed By: ajsecord, #mdc_ios_owners

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D759
2016-04-26 15:20:18 -04:00
Yiran Mao
2b6f7f40a7 Correct links for deploy on various deployment environment.
- Change API reference link to relative link
  - Correct links to other components, all links to other components should end with "/"
  - Update icon-links on home, tutorial and components page
2016-04-26 12:37:06 -04:00
Adrian Secord
c15fd0c5c1 Set the switch's ink's max ripple radius to the spec value.
Summary: Fixes https://github.com/google/material-components-ios/issues/456.

Reviewers: #mdc_ios_owners, iangordon

Reviewed By: #mdc_ios_owners, iangordon

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D761
2016-04-26 12:14:10 -04:00
Junius Gunaratne
ebd1fbd14c [Catalog] Make example titles consistent, use Component Name
Reviewers: iangordon, featherless, #mdc_ios_owners

Reviewed By: featherless, #mdc_ios_owners

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D674
2016-04-19 18:06:37 -04:00
randallli
1a7d800cc9 [Switch] Added swift example to catalog and readme.
Summary: work on https://github.com/google/material-components-ios/issues/318

Reviewers: ajsecord, #mdc_ios_owners

Reviewed By: ajsecord, #mdc_ios_owners

Subscribers: ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D655
2016-04-18 17:57:20 -04:00
Ian Gordon
c92a9510bc [Switch] Rename label from slider to switch.
Reviewers: junius, #mdc_ios_owners, randallli

Reviewed By: #mdc_ios_owners, randallli

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D645
2016-04-18 16:24:35 -04:00
Jeff Verkoeyen
977626313e Update .jazzy.yaml module property.
Summary: This property name changed in jazzy 0.6.0 from `module_name` to `module`.

Reviewers: ajsecord, #mdc_ios_owners

Reviewed By: ajsecord, #mdc_ios_owners

Subscribers: ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D619
2016-04-15 11:32:09 -04:00
Jeff Verkoeyen
ad228a1544 Revert "Remove obsolete jazzy.yaml files."
This reverts commit fffb75e91e8ab5b979dba7a7fec661d1a058bb11.
2016-04-14 20:29:29 -04:00
Yiran Mao
fffb75e91e Remove obsolete jazzy.yaml files. 2016-04-14 15:30:57 -04:00
Junius Gunaratne
e700bf58ee [Catalog and Switch] Update switch demo, move layout code to supplemental, update switch color
Summary: Screenshot http://codereview.cc/M22

Reviewers: featherless, #mdc_ios_owners, ajsecord

Reviewed By: #mdc_ios_owners, ajsecord

Subscribers: larche

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D608
2016-04-14 11:34:58 -04:00
Will Larche
2ab08f4133 [Catalog & Examples] Added navigationBar example in Swift (Supplemental POC) and corrected slight mistake in Catalog by Convention logic.
Summary: Merge branch 'develop' of https://github.com/google/material-components-ios into develop

Reviewers: ajsecord, featherless, #mdc_ios_owners

Reviewed By: ajsecord, featherless, #mdc_ios_owners

Subscribers: featherless, ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D587
2016-04-13 14:56:49 -04:00
Adrian Secord
ac38382e86 Updated top-level "Documentation" to "Components".
Reviewers: #mdc_ios_owners, randallli

Reviewed By: #mdc_ios_owners, randallli

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D599
2016-04-13 14:48:12 -04:00
Jeff Verkoeyen
06c44a0e47 Addressing linter warnings.
Summary:
Mostly line length warnings.
Also removed the empty PageControlExampleUITests.m.

Reviewers: randallli, #mdc_ios_owners, ajsecord

Reviewed By: randallli, #mdc_ios_owners, ajsecord

Subscribers: ajsecord

Projects: #material_components_ios

Differential Revision: http://codereview.cc/D567
2016-04-12 14:34:23 -04:00