129 Commits

Author SHA1 Message Date
Jeff Verkoeyen
fbb1f20aa2 Internal change
PiperOrigin-RevId: 332151481
2020-09-16 21:01:21 -07:00
Bryan Oltman
1b68b48522 [ProgressView] Remove request for VoiceOver focus in MDCProgressView's setHidden.
PiperOrigin-RevId: 323676726
2020-07-28 16:26:57 -07:00
Andrew Overton
07c46757cc Replace material.io API doc links with links to the relevant header f…
This PR replaces API links containing "/api-docs/" with links to suitable header files in GitHub because the site previously linked to is being taken down and replaced with something that won't handle API docs.

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

COPYBARA_INTEGRATE_REVIEW=https://github.com/material-components/material-components-ios/pull/10045 from andrewoverton:replace-mio-api-docs-with-github-links 0d6e56cc11d0c147366a4f6cde829d8b51567ecc
PiperOrigin-RevId: 323424362
2020-07-27 13:09:23 -07:00
Wenyu Zhang
be54e35951 [MDCProgressView] Fix indeterminate animation being removed before it is presented on screen.
PiperOrigin-RevId: 321083086
2020-07-13 19:57:05 -07:00
Wenyu Zhang
a411506026 [ProgressView] Reverse the start point and end point of indeterminate progress stroke to make it aligning with the animation direction.
PiperOrigin-RevId: 318494534
2020-06-26 10:15:20 -07:00
Wenyu Zhang
39de3e3efb [ProgressView] Fix RTL support on MDCProgressGradientView.
PiperOrigin-RevId: 318144506
2020-06-24 14:46:24 -07:00
Wenyu Zhang
989635ba8b [ProgressView] Reimplement animation on indeterminate mode to meet specification.
PiperOrigin-RevId: 318119106
2020-06-24 12:38:37 -07:00
Wenyu Zhang
00a6cab90b [ProgressView] Remove setMode:animated:completion API.
PiperOrigin-RevId: 317304615
2020-06-19 07:35:03 -07:00
Andrew Overton
685082b9a7 [ProgressView] Change float to CGFloat
PiperOrigin-RevId: 317107039
2020-06-18 08:29:53 -07:00
Wenyu Zhang
d5b47fca05 [ProgressView] Make indeterminate progress view example showing how transition looks.
PiperOrigin-RevId: 316958915
2020-06-17 13:58:19 -07:00
Nobody
1a75f9dbbb Add and indeterminate state to the progress bar.
PiperOrigin-RevId: 315687797
2020-06-10 07:43:47 -07:00
Wenyu Zhang
9c480c21a4 [ProgressView] Add support for gradient progress bar.
PiperOrigin-RevId: 310977753
2020-05-12 15:11:46 -04:00
Wenyu Zhang
7ea4449645 [ProgressView] Change progressTintColor and trackTintColor to nullable.
PiperOrigin-RevId: 310612107
2020-05-08 12:59:48 -07:00
Wenyu Zhang
14bdd278b4 Update expected translated string value for Progress localization test.
PiperOrigin-RevId: 309880028
2020-05-04 21:56:28 -07:00
Nobody
e035d70f50 Project import generated by Copybara.
PiperOrigin-RevId: 309039129
2020-04-29 17:00:59 +00: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
Yarden Eitan
a8a560da42 [ProgressView] Adding default accessibility label
PiperOrigin-RevId: 302624787
2020-03-24 02:38:42 -07:00
Nobody
58a181306f [ProgressView] Adding default accessibility label
PiperOrigin-RevId: 301788026
2020-03-19 04:46:12 -07:00
Yarden Eitan
8fe34d13e0 [ProgressView] Adding default accessibility label
PiperOrigin-RevId: 301786524
2020-03-19 04:33:10 -07:00
Wenyu Zhang
ae5515ea4a [ProgressView] Remove MDCProgressViewMotionSpec.
PiperOrigin-RevId: 301417528
2020-03-17 11:38:36 -07:00
Jeff Verkoeyen
2fb26e01b1 [ProgressView] Allow the progress view to be sized to fractional points.
This allows the progress view to more smoothly represent fractional progress and to take advantage of multi-pixel points on devices with retina displays.

PiperOrigin-RevId: 292342291
2020-01-30 07:22:12 -08:00
Jeff Verkoeyen
c169598704 Revert "[ProgressView] Allow the progress view to be sized to fractional points. (#9438)"
This reverts commit deb93d26d98d4fba1190c9b540791e568880f10e.
2020-01-27 10:27:14 -05:00
featherless
deb93d26d9
[ProgressView] Allow the progress view to be sized to fractional points. (#9438)
This allows the progress view to more smoothly represent fractional progress and to take advantage of multi-pixel points on devices with retina displays.

Closes https://github.com/material-components/material-components-ios/issues/9439#event-2955279250
2020-01-24 09:44:52 -05:00
Andrew Overton
b47266325e
[ProgressView] Delete MDCProgressViewColorThemer (#9231)
Delete MDCProgressViewColorThemer. Closes #9211.
2019-12-10 14:23:58 -05:00
Andrew Overton
c0fc20cce9
Deprecate MDCProgressViewColorThemer (#9203)
Related to b/145204539 (GitHub issue #9211)
2019-12-09 16:50:29 -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
a049592f23
[ProgressView] Add accessibilityLabel (#8775) 2019-11-11 15:21:22 -05:00
featherless
63bb1a8c9f
[ProgressView] Add cornerRadius API. (#7417)
This new API enables clients to customize the corner radius of the filled portion of the progress view. Clients have requested this functionality via https://github.com/material-components/material-components-ios/issues/5429.

Example usage to create a "rounded progress pill" effect:

```objc
progressView.cornerRadius = CGRectGetHeight(progressView.bounds) / 2;
```

This feature request was requested by client team in service to their brand requirements.

This PR adds an example that demonstrates the new behavior. See the associated snapshot tests for a complete suite of screenshots of the new behavior.

## Screenshots

![Simulator Screen Shot - iPhone 7 - 2019-05-20 at 09 13 17](https://user-images.githubusercontent.com/45670/58024150-89d14600-7adf-11e9-9c94-6eb023c7f48e.png)

Closes https://github.com/material-components/material-components-ios/issues/5429
2019-09-16 09:58:13 -04:00
Robert Moore
bbfe5f8193 [ProgressView] Add more Starlark macros. (#8181)
Add more Starlark macro use to the BUILD file. Makes releases easier.

Part of #8150
2019-08-02 08:48:03 -07:00
Cody Weaver
5ebe48ba4e
[ProgressView] Add traitCollectionDidChange block (#8035)
Adds a traitCollectionDidChangeBlock to MDCProgressView, called when its trait collection changes.
2019-07-23 12:04:58 -07:00
Robert Moore
8dcf1e4a56
[*] Remove RTL snapshot method overrides. (#7996)
With #7986, most snapshot tests began overriding a method that had nearly the
same behavior.
2019-07-22 21:11:17 -07:00
Robert Moore
6f2d5eb654
[ProgressView] Provide unique names for methods. (#7824)
ProgressView, its Theming Extension, and its tests all declared the same
method. This can introduce linker or compiler problems. Unique names are
provided based on their contexts.

Follow-up to #7791
2019-07-09 09:58:07 -04:00
Andrew Overton
43920aed56
[ProgressView] Add an MDCProgressView theming extension (#7791)
This PR adds a theming extension for MDCProgressView in support of b/136013554.
2019-07-08 13:11:08 -04:00
featherless
9664fce4b3
[ProgressView] Add cornerRadius snapshot tests. (#7416)
These tests are pre-work for adding support for customizing the corner radius of the filled portion of the progress bar. As-is, these tests demonstrate that customizing the MDCProgressView layer's cornerRadius only affects the outer radius of the progress view and not the filled portion of the progress view.

Part of https://github.com/material-components/material-components-ios/issues/5429
2019-05-20 08:49:14 -04:00
featherless
679870a13f
[ProgressView] Annotate themer APIs with the recommended APIs. (#7231)
Part of https://github.com/material-components/material-components-ios/issues/7108
2019-04-22 20:02:35 +03:00
Robert Moore
018e72e3cf
[ProgressView] Add basic Snapshot tests. (#6825)
Adding Snapshot tests for different progress amounts in LTR and RTL.

Closes #6808
2019-03-11 21:36:33 -04: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
Robert Moore
800188a649
{clang-format} Format the components. (#6347)
This is a follow-up to https://github.com/material-components/material-components-ios/pull/6027

```
find components \( -name "*.h" -or -name "*.m" \) | xargs clang-format -i
```
2019-01-23 11:08:43 -05:00
Andrew Overton
dfbf7802b7
Add ProgressView examples to BUILD file (#6328)
This PR adds ProgressView examples to BUILD files.
Closes #6242.
2019-01-15 06:58:42 -05:00
Yarden Eitan
2803125b2c
ran clang-format (#6027) 2019-01-11 13:23:51 -05:00
Robert Moore
5b1943dd78
[bazel] Use mdc_extension_objc_library in BUILD (#6089)
Changing all component extension targets to use the new macro
`mdc_extension_objc_library` to reduce boilerplate in the target
definitions.
2018-12-20 17:14:19 -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
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
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
Robert Moore
675235ed05
{Tests} Deallocate test objects at the end of tests. (#5397)
Deallocating many of the properties created for each unit test. Since all
XCTestCase instances survive until the end of the test suite, any properties
created for a test will be preserved as well. This frees up around 3.7 MB
(~6%) of memory from the entire test suite, as measured on my desktop.

|Before|After|
|----|----|
|![test-objcs-before](https://user-images.githubusercontent.com/1753199/46813473-c3b9bd00-cd44-11e8-990c-28dff4ab5ad2.png)|![test-objcs-after](https://user-images.githubusercontent.com/1753199/46813481-c7e5da80-cd44-11e8-90e4-2e6d532ebbfb.png)|

See also: https://qualitycoding.org/xctestcase-teardown/

Closes #5395
2018-10-12 08:33:58 -04:00
featherless
2181084272
[automated] Standardize our open source license stanza to what Xcode generates. (#4985)
Removes the need to copy-paste stanzas from other files anymore as we'll rely on #4478 to generate the correct stanza for us instead.

This was an automated change generated by running a find-and-replace regular expression:

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.

 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at

 http://www\.apache\.org/licenses/LICENSE-2\.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

```
/\*
Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.

Licensed under the Apache License, Version 2\.0 \(the "License"\);
you may not use this file except in compliance with the License\.
You may obtain a copy of the License at

http://www\.apache\.org/licenses/LICENSE-2\.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
See the License for the specific language governing permissions and
limitations under the License\.
\*/
```

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at
 http://www\.apache\.org/licenses/LICENSE-2\.0
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

```
// Copyright $1-present the Material Components for iOS authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
```
2018-08-31 12:13:07 -04:00