254 Commits

Author SHA1 Message Date
Yarden Eitan
6df22d2cd6
Update MaterialComponents podspec to separate extensions from component. Breaking change, please see description when sending out a new release (#2748)
* [Catalog] Update catalog readme to reflect podspec filename change

* upate podspec

* update spec to extension

* more specific dependency

* added documentation
2018-01-02 16:51:58 -05:00
ianegordon
ab4e4ea0da [Buttons] Cleanup (#2759) 2017-12-22 11:00:47 -05:00
Robert Moore
30a1be6d9c
[Buttons] Fix docs/art for Floating Button layout (#2745)
The Floating Button changed layout last week, but I forgot to update the docs
and ASCII art.
2017-12-18 20:47:53 -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
26f02a360c
[Buttons] Extended FAB leading-align text and no minimum width (#2732)
For shorter text, the extended FAB looks better without a minimum and with a
leading alignment of text.

Closes #2731
2017-12-14 23:11:19 -05:00
ianegordon
4befe61f74
[Buttons] Add a custom font property (#2715)
* [Button] Add custom font properties

* Add example and tests

* Add sample supporting custom font and dynamic type

* Clean up tests

* Fix C&P error in Copyright date.

* Remove outdated warning

* Fix misuse of standardFont and simplify scale invocation.
2017-12-14 11:48:17 -05:00
featherless
1631d8e45d
Revert "[Buttons] Re-enable legacy ink. (#2657)" (#2664)
This reverts commit aae4264e412a8db537bfe43d39cf3c3abd48436e.
2017-12-08 16:54:34 -05:00
Robert Moore
6469bad9dc [Buttons] Rename MDCFloatingButton updateShapeForcingLayout (#2625)
"Forcing" wasn't the right phrasing, it only prevents layout updates if "NO".
Using a gerund, "forcing", also doesn't match the style of methods. Gerunds are preferred for
protocols.

Closes #2571
2017-12-08 14:30:58 -05:00
Randall Li
00611df7bd
[Buttons] Corrected imports in examples. (#2645)
* [Buttons] Corrected imports in examples.

PiperOrigin-RevId: 175377616

* added import UIKit
2017-12-08 11:40:03 -05:00
featherless
aae4264e41
[Buttons] Re-enable legacy ink. (#2657)
This is a partial revert of c9d1b7163db9f09c62f2acc596e54897a8b1282b.
2017-12-07 20:55:21 -05:00
Robert Moore
c360db7e94
[Buttons] Improve FloatingButton documentation (#2578)
* [Buttons] Improve FloatingButton documentation

* Rename `internalLayoutSpacingInsets` to `internalLayoutInsets`
* Add comments to outline the layout code in the implementation
* Update header documentation to provide more detail about how the new
  setters affect layout.

Closes #2566
2017-12-07 08:39:47 -05:00
Robert Moore
58f9854760
[Buttons] Add unit tests for Floating Button layout (#2577)
A few more unit tests to verify the layout behavior of MDCFloatingButton.

Closes #2570
2017-12-07 08:39: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
featherless
b9404ded10
Revert "Add compile time flag for import style (#2562)" (#2612)
This reverts commit 6791dc4993d3a0ffa11735eeeef0583102621d52.
2017-12-06 11:22:17 -05:00
Robert Moore
0b91616d9a
[Buttons] Add BUILD file for kokoro (#2599)
* [Buttons] Add BUILD file for kokoro
2017-12-05 16:25:26 -05:00
Robert Moore
c35ddaa873
[Buttons] Rename imageTitleSpace (#2565)
The previous name, imageTitleSpacing sounds too much like a protocol name,
one that would adjust the space between things.

Amends #2563
Implements #2495
2017-12-05 09:03:21 -05:00
Robert Moore
f01c39d050 [Buttons] Readability for newlines (#2568)
Moving assignment/boolean operators to previous lines.

PR feedback for #2563
2017-12-04 18:09:05 -05:00
Louis Romero
6791dc4993
Add compile time flag for import style (#2562)
Closes #2550
2017-12-04 10:06:31 -08:00
Robert Moore
2d8333d7d8 [Buttons] Extended FAB (#2563)
* [Buttons] Remove .largeIcon shape from FloatingButton (#2513)

The LargeIcon shape is not required, since the same behavior (support
for 36-point images) can be achieved by setting the contentEdgeInsets to
.zero.

Also updates one of the button examples to use a 36-point icon.

* [Buttons] Add extended FAB layout code (#2528)

Creating (internal for now) the required properties and layout code to support
the extended FAB. Unit tests to confirm the behavior and some minor
adjustments to existing values like default contentEdgeInsets values.

Implements #2495

* [Buttons] Expose Extended FAB properties (#2543)

Making the new properties public and also migrating away from simple
property setters to the new forShape:inMode: setters required for
UIAppearance support.

* minimumSize
* maximumSize
* contentEdgeInsets
* hitAreaInsets

Implements #2495

* [Buttons] Add basic Floating Button example (#2554)

Includes automatic adjustment of extended/normal layout depending on size
classes.

Demonstrates #2495

* [Buttons] Update README for Extended FAB (#2561)

The README includes usage examples for the FAB. Adding a section to
demonstrate how to configure the FAB in its different shapes and modes.

Documents #2495
2017-12-04 12:55:55 -05:00
Junius Gunaratne
c9d1b7163d [Ink] Enable updated ink on MDCButton, add support for shadowPaths (#2530)
* Enable updated ink on MDCButton, add support for shadowPaths

* Only change frame inset when legacy ink is used

* Update formatting

* Create mask layer once

* Update animation and opacity based on designer feedback

* Remove commented animations

* Move constants
2017-12-01 19:03:35 -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
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
Robert Moore
4f9f95a244 [Buttons] Update layer elevation only on change (#2484)
When a button's elevation is assigned, it animates a change to the underlying
shadow elevation.  However, this causes animation "jumps" when elevations for
multiple states are being assigned simultaneously. Instead of blindly
assigning the new value to the layer, a check for a change should be performed
instead.

Closes #2483
2017-11-20 11:10:03 -05:00
featherless
d1b31cab6a Automated header standardization by the kokoro script. (#2472)
This change was generated by running and canceling `./.kokoro`. This enforces our use of framework-style imports throughout the project.
2017-11-17 19:56:24 -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
Robert Moore
108aa31fb9 [Buttons] Fix example storyboard module (#2427)
The Storyboard example had the wrong module name (catalog) instead of
the "examples" module.

Closes #2425
2017-11-15 11:59:16 -05:00
Robert Moore
4e02cc19b8
[Buttons] Deprecate -cornerRadius method (#2256)
Buttons should no longer use the subclassing method `-cornerRadius` and
should instead depend on the backing layer's `cornerRadius` property.

Closes #2255
2017-11-07 19:07:02 -05:00
Robert Moore
5bba61686c
[Buttons] Add properties minimumSize, maximumSize (#2254)
Material Guidelines specify that buttons should have minimum sizes, and
in some cases maximum sizes (e.g., floating buttons).

Closes #2253
2017-11-03 07:38:50 -04:00
Martin Petrov
f98a9d42ed @objc annoaing catalog by convention (#2305) 2017-10-30 10:24:17 -04:00
Martin Petrov
3762aecee3 use modern selectors (#2207) 2017-10-17 10:29:14 -04:00
Cody Weaver
1c7c9cd541 Update layout constraint to offset buttons by 20pt upwards, move catalog functions into extension (#2194) 2017-10-16 22:47:40 -04:00
Adrian Secord
16a572b3ff Merge branch 'release-candidate' 2017-10-12 14:30:33 -04:00
Sam Morrison
4ff00d3b2a [Buttons] Remove test broken on travis (#2147) 2017-10-10 18:17:51 -04:00
Adrian Secord
f49aaa823c Change MDCButton to use MDCShadowElevation type instead of CGFloat. Fixes #2105. 2017-10-10 12:19:34 -04:00
Sam Morrison
75e343d0fb [Buttons] Add tests for MDCButton+Subclassing behaviors (#2136)
* [Buttons] Add tests for MDCButton+Subclassing behaviors

* // Given
2017-10-10 11:27:16 -04:00
Robert Moore
7d80d4677a [Buttons] Restore alpha when re-enabled (#2095)
* [Buttons] Restore alpha when re-enabled

When re-enabled, MDCButton previously set its alpha avalue to 1 instead
of the previously-set value.

Closes #1964

* Setting _enabledAlpha in -setAlpha:
2017-10-05 16:03:57 -04:00
Cody Weaver
4e4c06fd8d [Swiftlint][Buttons] Refactor ButtonsStoryboardAndProgrammatic.swift (#2060)
Reduce the length of `viewDidLoad` and move Catalog by Convention methods into an extension.

Closes #2048
2017-09-28 20:40:49 +09:00
Robert Moore
d44164290f [Catalog] Fix button examples (#2047)
The FAB in Typical Use was misaligned, resulting in a blurry image. The
Storyboard and Swift example had misaligned buttons due to
safeAreaInsets on iOS 11.
2017-09-27 23:58:17 +09:00
Adrian Secord
fb32dccf2d Replace usage of new with alloc init to match the style guide. (#2033)
https://github.com/google/styleguide/blob/gh-pages/objcguide.md#avoid-new
2017-09-25 10:46:44 -04:00
Robert Moore
d19632cf0f [Buttons] Support colored shadows (#1965)
* [Buttons] Support colored shadows

Adding new method to set a shadow color for each UIControlState.

* Fixing unit test for control state checking

* Fixing some unit tests failing on iPhone 4s/iOS 8.3

* Removing log

* Always initializing _shadowColors, adding unit test for upgrade path

* Fixing white space
2017-09-14 11:02:51 -04:00
Sam Morrison
0e3b57c785 Revert [Buttons] Deprecate subclassing to set cornerRadius and contentEdgeInsets (#1896) (#1948)
* [Buttons] Deprecate subclassing cornerRadius and defaultContentEdgeInsets

    * Remove unused import

    * Set contentEdgeInsets via UIAppearance

    * Content edge insets comment

    * Use correct value for FAB hit area insets

    * Fix FAB contentEdgeInsets
2017-09-05 14:15:58 -04:00
Sam Morrison
3951775187 [Buttons] Deprecate subclassing to set cornerRadius and contentEdgeInsets (#1896)
* [Buttons] Deprecate subclassing cornerRadius and defaultContentEdgeInsets

* Remove unused import

* Set contentEdgeInsets via UIAppearance

* Content edge insets comment

* Use correct value for FAB hit area insets

* Fix FAB contentEdgeInsets
2017-08-31 15:06:19 -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
Sam Morrison
e0324dd64b [Buttons] Add state-based border color and width (#1878)
* [Buttons] Add state-based border color and width

* Review improvements

* Explicitly cast to CGFloat
2017-08-25 18:04:04 -04:00
Sam Morrison
a1e5f1685d [Buttons] Make uppercaseTitle nondestructive (#1887)
* Rename nontransformedTitles

* [Buttons] Make uppercaseTitle nondestructive

* Update uppercaseTitle comment

* Keep MDCButtonAccessibilityLabelsKey string for backcompat
2017-08-25 12:46:45 -04:00
Robert Moore
15c0836e3d [Buttons] Default hitAreaInsets for FAB (#1866)
The Floating Action Button should have default hitAreaInsets so that it
adheres the minimum touch target in the Material Design guidelines.
This commit introduces a set of default hitAreaInsets for the different
FAB styles as well as a warning if a button's touch target is smaller
than the 48-point minimum.

Closes #223
2017-08-24 18:06:45 -04:00
Adrian Secord
9ee28b637e Merge branch 'release-candidate' 2017-08-23 12:29:22 -04:00
Adrian Secord
5bc8758de5 Porting warning fixes from internal change 166066139. 2017-08-22 17:29:23 -04:00