46 Commits

Author SHA1 Message Date
Randall Li
a5f0f579d5 [Schemes] Change deprecation warning to add scriptable potential.
PiperOrigin-RevId: 490265704
2022-11-22 09:46:39 -08:00
Jeff Verkoeyen
3180c15e86 [schemes] Optimize imports
PiperOrigin-RevId: 466547078
2022-08-09 20:05:09 -07:00
Jeff Verkoeyen
b2bbd50350 Mark all To Be Deprecated APIs as Deprecated.
PiperOrigin-RevId: 460478209
2022-07-12 09:13:52 -07:00
Wenyu Zhang
cbcea1c2cd [Schemes] Annotate "to be deprecated" symbols for scheme related components.
PiperOrigin-RevId: 457600261
2022-06-27 17:07:11 -07:00
Jeff Verkoeyen
fbf2f90376 [BottomSheet] Delete the ShapeThemer library.
Also removed examples that made use of the ShapeThemer and removed all of the ShapeScheme examples.

PiperOrigin-RevId: 404270856
2021-10-19 08:45:05 -07:00
Jeff Verkoeyen
c34de39e30 Internal change.
PiperOrigin-RevId: 397316843
2021-09-17 07:45:01 -07:00
Jeff Verkoeyen
1abdf16760 Optimizing imports
PiperOrigin-RevId: 357185990
2021-02-12 07:36:41 -08:00
Jeff Verkoeyen
63988b35da Optimizing imports
PiperOrigin-RevId: 356966165
2021-02-11 07:09:58 -08:00
Jeff Verkoeyen
fbb1f20aa2 Internal change
PiperOrigin-RevId: 332151481
2020-09-16 21:01:21 -07:00
Yarden Eitan
719d688119 [Shapes] Add test demonstrating issue with calling borderWidth multiple times with same value.
PiperOrigin-RevId: 322911175
2020-07-23 18:30:36 -07:00
Wenyu Zhang
a3381717f7
Fix the bazel BUILD files and snapshot that were restored unintentionally.(#9983) 2020-04-29 11:00:00 -04:00
Randall Li
0100cfe414 [MDC-iOS/BottomSheet] Fix dismissOnDraggingDownSheet behavior
The bottom sheet incorrectly allowed the sheet to be drag dismissed when `dismissOnDraggingDownSheet` was set to NO.

This change permits the gesture to dismiss to begin but prevents it from actually closing the sheet.

https://github.com/material-components/material-components-ios/issues/9723

Closes https://github.com/material-components/material-components-ios/pull/9885

PiperOrigin-RevId: 307802500
2020-04-22 06:21:26 -07:00
Jeff Verkoeyen
8abbb099a9 Delete all bazel support.
We no longer support bazel.

This PR deletes everything related to bazel support from our repo.

Closes https://github.com/material-components/material-components-ios/pull/9968

PiperOrigin-RevId: 306227127
2020-04-13 07:13:47 -07:00
Bryan Oltman
14c9d903cf
[Buttons] Deletes deprecated MDCFloatingButtonShapeThemer (#9746)
* [Buttons] Deletes deprecated MDCFloatingButtonShapeThemer

* Remove MDCFloatingButtonShapeThemer from tests

* Update docs

* clang
2020-02-18 10:12:36 -05:00
Bryan Oltman
f44e5d679d
[Cards] Delete Themer classes (#9197)
Deletes the deprecated Card shape and color themers. These files were removed from .podspec and BUILD files in https://github.com/material-components/material-components-ios/pull/9141

Fixes #9098
Fixes #9097
Fixes #9096
Fixes #9095
2019-12-09 12:41:31 -05:00
Robert Moore
8eb7296dab
[Catalog] Fix container scheme properties. (#9192)
Making remaining examples use protocol for container schemes to match the
project's expected convention.

Found while reviewing #9188
2019-12-09 10:48:25 -05:00
Bryan Oltman
f848eaf5ee
[Chips] Delete Themers (#9028)
* [Chips] Delete Themers

* clang

* Delete MDCChipViewTypographyThemer, update BUILD file

* Use correct MDCChipViewColorThemer applySemanticColorScheme implementation for applyThemeWithColorScheme

* Delete Chip imports from Shape BUILD file

* Delete Chips themers from podspec

* Preserve example behavior

* Fix Shape scheme BUILD file
2019-12-05 14:12:21 -05:00
featherless
8b9f0bbea6 [Cards] Deprecate the ShapeThemer extension. (#8697)
Part of https://github.com/material-components/material-components-ios/issues/8429
2019-10-30 19:46:20 -04:00
Robert Moore
08ee58bcb3 [Shape] Use Starlark macros in BUILD file. (#8209)
Using more macros to make it easier to perform releases.

Part of #8150
2019-08-02 19:59:19 -07:00
Yarden Eitan
c4d24627ee
updated jazzy yaml files to include framework root (#6750)
We have had errors when generating the docs using jazzy specifically around components giving a fatal error around not finding imports when depending on other components. This is because each component for jazzy is isolated and on its own unless we provide the framework root. This caused our website generator to crash each time and fail to generate a new website.

This should resolve this problem.

QA=
Before the fix when running the website generator we got these errors:
```
/material-components-ios/components/BottomAppBar/src/MDCBottomAppBarView.h:17:9: fatal error: 'MaterialButtons.h' file not found
building site
building search index
^C/Library/Ruby/Gems/2.3.0/gems/rouge-3.1.1/lib/rouge/lexer.rb:458:in `load': Interrupt
	from /Library/Ruby/Gems/2.3.0/gems/rouge-3.1.1/lib/rouge/lexer.rb:458:in `load_lexer'
	from /Library/Ruby/Gems/2.3.0/gems/rouge-3.1.1/lib/rouge.rb:50:in `block in <top (required)>'
	from /Library/Ruby/Gems/2.3.0/gems/rouge-3.1.1/lib/rouge.rb:49:in `each'
	from /Library/Ruby/Gems/2.3.0/gems/rouge-3.1.1/lib/rouge.rb:49:in `<top (required)>'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/lib/jazzy/jazzy_markdown.rb:2:in `require'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/lib/jazzy/jazzy_markdown.rb:2:in `<top (required)>'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/lib/jazzy/doc.rb:7:in `require'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/lib/jazzy/doc.rb:7:in `<top (required)>'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/lib/jazzy/config.rb:5:in `require'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/lib/jazzy/config.rb:5:in `<top (required)>'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/lib/jazzy.rb:1:in `require'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/lib/jazzy.rb:1:in `<top (required)>'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/bin/jazzy:13:in `require'
	from /Library/Ruby/Gems/2.3.0/gems/jazzy-0.9.3/bin/jazzy:13:in `<top (required)>'
	from /usr/local/bin/jazzy:22:in `load'
	from /usr/local/bin/jazzy:22:in `<top (required)>'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:74:in `load'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:74:in `kernel_load'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli/exec.rb:28:in `run'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli.rb:463:in `exec'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli.rb:27:in `dispatch'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/cli.rb:18:in `start'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/exe/bundle:30:in `block in <top (required)>'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
	from /Library/Ruby/Gems/2.3.0/gems/bundler-2.0.1/exe/bundle:22:in `<top (required)>'
	from /usr/local/bin/bundle:22:in `load'
	from /usr/local/bin/bundle:22:in `<main>'
/material-components-site-generator/scripts/lib/reporter.js:36
      throw e;
      ^

Error: Command failed: bundle exec jazzy         --output "/material-components-site-generator/.stage/ios/catalog/bottomnavigation/api-docs/"         --theme "/material-components-site-generator/ios-api-docs-src/theme"         --head '/components'         --use-safe-filenames
    at checkExecSyncError (child_process.js:601:13)
    at execSync (child_process.js:641:13)
    at JazzyApiGenerator.build (/material-components-site-generator/scripts/lib/jazzy-api-generator.js:34:5)
    at PlatformSite.generateApiDocs (/material-components-site-generator/scripts/lib/platform-site.js:212:17)
    at platformSites.forEach (/material-components-site-generator/scripts/build:86:14)
    at Array.forEach (<anonymous>)
    at reporter.step (/material-components-site-generator/scripts/build:85:21)
    at Reporter.step (/material-components-site-generator/scripts/lib/reporter.js:32:22)
    at Object.<anonymous> (/material-components-site-generator/scripts/build:84:14)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3
```
Now we no longer get fatal errors or crash when running the script.
2019-03-01 16:52:02 -05:00
Yarden Eitan
10abd4524d
[Shapes] Move shapes from components/private to components/ - Part 3 (last part) (#6734)
This is the third and last part of the migration of moving the Shape libraries away from the private/ folder. Continuation to PR: #6664 and #6495

Tracking bug, progress and more details can be found here: #6494

This resolves #6494

Because Shapes and ShapeLibrary have been used in production and are an integral part of the shape scheme and theming. Moreover, with to stop the confusion of clients that the library should not be imported as it is under private, we want to migrate the Shape libs to be under components/ instead of components/private.

The migration will be a 7 step migration to not break clients internally.
**We have completed steps 1 to 6, This PR concludes step 7 and the entire migration**

1. move the folders to the new directory.
2. Make the old component's BUILD and Podspec targets depend on the new component (and nothing else).
3. Delete all implementation files from the old component.
4. Replace the contents of the old component's headers with import statements to the new component's header. If the new component has headers that match the old component's, then the new component's headers will need to be named uniquely for a period of time to allow clients to migrate over.
5. Once all clients have migrated from the old component, delete the old component. This is a breaking change.
6. If you had to create temporary header names in the new component, then in a separate release add the new headers that you want the new component to use. Move the content of the old headers into the new headers and replace the old headers with an import of the new headers. Migrate clients to the desired headers.
7. Once all clients have moved off of the old headers, delete the old headers.
2019-02-28 16:54:58 -05:00
Yarden Eitan
de5d200599
[Shapes] Move shapes from components/private to components/ (#6495)
This is the first part of the migration of moving the Shape libraries away from the private/ folder.

Tracking bug, progress and more details can be found here: #6494 

"Because Shapes and ShapeLibrary have been used in production and are an integral part of the shape scheme and theming. Moreover, with to stop the confusion of clients that the library should not be imported as it is under private, we want to migrate the Shape libs to be under components/ instead of components/private.

The migration will be a 7 step migration to not break clients internally.

1. move the folders to the new directory.
2. Make the old component's BUILD and Podspec targets depend on the new component (and nothing else).
3. Delete all implementation files from the old component.
4. Replace the contents of the old component's headers with import statements to the new component's header. If the new component has headers that match the old component's, then the new component's headers will need to be named uniquely for a period of time to allow clients to migrate over.
5. Once all clients have migrated from the old component, delete the old component. This is a breaking change.
6. If you had to create temporary header names in the new component, then in a separate release add the new headers that you want the new component to use. Move the content of the old headers into the new headers and replace the old headers with an import of the new headers. Migrate clients to the desired headers.
7. Once all clients have moved off of the old headers, delete the old headers.

Passes bazel build and pod build locally.
2019-01-28 17:51:27 -05:00
Cody Weaver
a9b92e4c53
[Shape] Add examples to BUILD file (#6404)
Closes #6229
2019-01-17 09:16:19 -05:00
rami-a
c604f9fd35
[Chips] Update chips examples to use theming extension (#6096)
### Context
As the team pivots to using theming within extensions we continue this work with Chips.

### The problem
We currently do not utilize the theming extension for chips examples

### The fix
* This change updates all the chips examples to use the new chips theming extension.
* Additionally, this updates the shape example to use the new chips theming extension.

### Bug
Closes #6083
2018-12-21 13:13:45 -05:00
featherless
003cf8bcd9
[automated] Make mdc_unit_test_suite's name explicit. (#6080)
This change was automatically generated by running a find replace of the following strings:

```
mdc_unit_test_suite(

mdc_unit_test_suite(
    name = "unit_tests",
```

And then running buildifier to enforce style:

    find . -name BUILD | xargs ~/buildifier
2018-12-20 12:36:05 -05:00
rami-a
b380bca14e Fix for release-candidate merge issue with develop (#6068)
It appears when the release-candidate was merged back into develop, some code changes were lost/reverted unintentionally. 

See for the details here: 026a2005e7

This change brings all the necessary changes back into develop. Specifically around the cards theming extension and the updated Card theming examples.

This issue appears to stem from the fact that these 2 PRs landed in develop after the release-candidate was branched:
#6048
#6049
2018-12-19 23:14:29 -05:00
Robert Moore
11a74d41ac Revert "[Cards] Add theming extension for Cards component (#6033)"
This reverts commit fdaf872c605cab44a4579cb8b7f0ea168c445318. The
container scheme import is missing in a Swift example.

```
material_components_ios/components/Cards/examples/EditReorderCollectionViewController.swift:38:24 use of undeclared type 'MDCContainerScheming'
  var containerScheme: MDCContainerScheming {
                       ^~~~~~~~~~~~~~~~~~~~
```
Reopens #6030
2018-12-19 14:59:14 -05:00
rami-a
fdaf872c60
[Cards] Add theming extension for Cards component (#6033)
### Context
As the team pivots to using theming within extensions we continue this work with Cards.

### The problem
We currently do not theme cards using a theming extension

### The fix
* Add theming extension for MDCCard and MDCCardCollectionCell
* Write unit tests for new extension
* Update existing examples to utilize the extension

### Bug
Closes #6030 

### Screenshots
Everything should be exactly the same visually.

| Before | After |
| - | - |
|![simulator screen shot - iphone 7 - 2018-12-17 at 13 59 52](https://user-images.githubusercontent.com/2364772/50110092-65f39680-0207-11e9-9a32-02161f7b2df4.png)|![simulator screen shot - iphone 7 - 2018-12-17 at 14 01 51](https://user-images.githubusercontent.com/2364772/50110130-7dcb1a80-0207-11e9-83d9-53bc98ad374b.png)|
2018-12-18 09:38:37 -05:00
rami-a
2bb5f72548
Fix shape example to use new contained button theming (#6034)
When we added support for the theming extension for MDCButtons, we missed an example that is still using the old method.
2018-12-17 15:27:05 -05:00
featherless
dae4e37ea5
[automated] Ran buildifier against all BUILD files. (#5999)
This is an automated change generated by running the following command:

    find . -name BUILD | xargs buildifier

buildifier can be installed from https://github.com/bazelbuild/buildtools

This change formats all of our BUILD files with the buildifier formatter in preparation for us having a BUILD format linter as part of our presubmits and so that we can cleanly run buildozer commands against the codebase.
2018-12-13 11:20:12 -05:00
Wenyu Zhang
0e4da65df8
[Shape] add hash function to MDCCornerTreatment (#5954)
* add hash function to MDCCornerTreatment

* [Shape] add NSCopying support to ShapeCategory (#5946)
2018-12-12 12:08:45 -05:00
Wenyu Zhang
6267009748
[Buttons] Update secondary floating action button themer examples (#5922)
Update examples to use secondary floating button theming extension method instead of calling themer's class methods.

Related https://github.com/material-components/material-components-ios/issues/5844
2018-12-05 14:42:55 -05:00
Andrew Overton
748a9128e3
[Buttons] Add button theming category method for outlined theming (#5878)
This PR adds the MDCButton theming category method for outlined buttons.

Closes #5847.
2018-11-30 11:36:27 -05:00
Robert Moore
6f7513d17e
[Dialogs, Shape] Fix cross-component imports. (#5794)
Some of our examples and component code was depending on other components by
using relative path imports. Instead, they should be relying on the build
system to expose headers and importing those from the include paths.
2018-11-19 15:36:41 -05:00
Robert Moore
595127cd7b
Revert "[Dialogs, Shape] Fix cross-component imports. (#5786)" (#5793)
This reverts commit 58b7e388d458422a0d4e4f30d0f43ad9de73aecb.
2018-11-19 15:14:21 -05:00
Robert Moore
58b7e388d4
[Dialogs, Shape] Fix cross-component imports. (#5786)
* [Dialogs, Shape] Fix cross-component imports.

Some of our examples and component code was depending on other components by
using relative path imports. Instead, they should be relying on the build
system to expose headers and importing those from the include paths.

* Fix additional Dialogs import.

Also some formatting improvements.

* Revert merge conflict in ActionSheetTest.swift

* Fixing import in Alert Typography themer.
2018-11-19 15:13:56 -05:00
Robert Moore
372d6b24f9
No longer using -init for Color Scheme. (#5734)
{MDC iOS} No longer using `-init` for Color Scheme.

Based on the discussions in go/mdc-ios-theming, we should not use the `-init` default initializer. Instead, we should use an explicit set of defaults.

Search regex: '\[\[MDCSemanticColorScheme alloc\] init\]'
2018-11-12 12:54:47 -05:00
Robert Moore
03f3351ad5
Global replace of single-precision floats with CGFloat casts. (#5718)
Replacing all non-integral, single-precision floating point literals with double-precision values explicitly cast to CGFloat.  For example, `0.1f` should become `(CGFloat)0.1`.

Regex used:
```
([0-9]*\.)([0-9]*?)([1-9]+)([0-9]*?)[fF]
```

PiperOrigin-RevId: 220683126
2018-11-12 10:50:01 -05:00
Robert Moore
74a27253e8
Global replace of integral single-precision literals with integer literals. (#5709)
Global replace of integral single-precision literals with integer literals.

Regular expression used:
```perl
/[^\w]([0-9]+)\.[0]*[fF]/$1/
```
2018-11-08 14:02:04 -05:00
Yarden Eitan
83fffdb4cc
[Shapes] Added initial documentation for Shape Theming (#5460)
### Context
After releasing the Shape Theming code, this provides initial documentation for how to use shape theming, and its API.

### The problem
We lack documentation on what is Shape Theming, and how do you use it.

### The fix
An Initial doc outlining shape theming.

### Bug
Closes #4605 
Closes #4606
2018-10-19 15:26:26 -04:00
Yarden Eitan
956761ed4d
[Shapes] Addition of a shape theming example to our dragons (#5239)
This closes #5146 .

This example allows our users to set each one of the Scheme's categories, Small Surface, Medium Surface, and Large Surface. It also allows the user to toggle the baseline overrides for the components that override the scheme like FAB and Chips. You can see how the scheme changes updates the different components.

See below gif:
![gifshapedragons](https://user-images.githubusercontent.com/4066863/46034469-b35fdc00-c0ce-11e8-9168-fa3853a53a40.gif)
2018-09-26 13:44:13 -04:00
Yarden Eitan
bfc674a631
[Shape]! Terminology updates to the Shape Scheme (#5247)
**<><>This is a breaking change<><>**

There are slight terminology updates to the current Shape Scheme. 

First, we are staying with the Cut notion for cut corners rather than Angled. This is on par with our current naming of the CutCornerTreatment.

Secondly, we are moving from the term S/M/L Surface to S/M/L Component for the scheme categories.
2018-09-26 13:01:08 -04:00
Yarden Eitan
f43e3e7386
[Shape Scheme] Addition of Unit Tests for the Shape Scheme (#5137)
This resolves #5047
2018-09-17 11:31:40 -04:00
Yarden Eitan
75ddb21ed0
[Shapes] merge MDCShapeCorner and MDCCornerTreatment into one (#5090)
This will allow us to set percentage support for a corner treatment as a follow up PR. Reason being is that the MDCCornerTreatment is part of the shape of the component itself, and hence has control to set the value of the corner when it is right in the lifecycle and the frame has been set. If we keep the percentage value setting in the Shape Themer, then the themer could be applied too early in the lifecycle and thus take a percentage off a 0 value (frame height).

Overall this simplifies the API and causes less duplication.

The other approach would be to *also* add percentage support to MDCCornerTreatment and leave MDCShapeCorner as is, but that would just make it too cumbersome and redundant.
2018-09-11 17:01:58 -04:00
Yarden Eitan
c01cd70170
[ShapeLibrary] Make the new CornerTreatment initializers use concrete types (#5076)
This PR changes the recent addition of convenience initializers of MDCCornerTreatments to become a certain instance subclass to use concrete types rather than a generic NSNumber with parsing. This resolves #5063
2018-09-10 15:41:50 -04:00
Yarden Eitan
97b830a1e3
[Shapes] Initial Shape Scheme implementation (#5014)
This PR implements the initial Shape Scheme that is essential for allowing shape theming for components (*this doesn't include any themers and that will be included as a separate PR once this is approved*). More information can be seen in go/mdc-ios-shape-theming and go/material-shapes-eng

This closes #4609 #4612 #4613
2018-09-06 13:35:05 -04:00