11 Commits

Author SHA1 Message Date
Nobody
a5fd8319a9 Fixed up imports and nullability for ButtonBar
PiperOrigin-RevId: 490068172
2022-11-21 14:14:42 -08:00
Jeff Verkoeyen
1abdf16760 Optimizing imports
PiperOrigin-RevId: 357185990
2021-02-12 07:36:41 -08:00
Robert Moore
cab960098b
[ButtonBar] Use Starlark macros. (#8161)
Adds more Starlark macro usage in the BUILD file. This makes releasing easier.

Part of #8150
2019-08-01 15:46:42 -04: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
056e4701f0
Make pod install work on Cocoapods 1.6.0.beta.2 (#5966)
# Original PR description:

On Cocoapods version 1.6.0 beta 2 we get an error on pod install because certain test targets don't have any sources to compile. This PR adds some skeleton unit test source files to get that working. Is everyone okay with these (for now) basically empty files?

Closes #5825

# FInal PR description:

The original aim of this PR was to get the project working with the Cocoapods 1.6 beta.

I initially didn't know where to begin getting it to work, so I used `pod lib lint` to get answers. `pod lib lint` had issues with the following things:

1. test_specs not having any sources to compile. This was due to our pattern of putting unit test test_specs inside of parent test_specs that didn't have anything else.

To address this I did two things. First, I moved away from the nested test_spec pattern. Now, instead of "Subspec/tests/unit_tests" it's "Subspec/UnitTests". This is more in line with the style Cocoapods uses [here](http://blog.cocoapods.org/CocoaPods-1.6.0-beta/). Secondly, I added some dummy files for things like UIMetrics and MaterialMath.

2. Importing headers across modules without using framework style imports.

I added framework style imports. This required some additional rewrite rules in the kokoro script.

3. Dependencies across subspecs being implicit.

I made them explicit by adding dependency statements to the podspecs where needed. 

`pod lib lint` didn't take issue with this, but I also saw that `MaterialComponents` was depending on `MaterialComponentsBeta` in various places. For example, all the theming extensions were in beta, but the tests for them weren't. I moved the tests to test_specs within the beta extensions. This required some directory structure changes. These changes then required some BUILD file changes. Making BUILD file changes made me realize that some swift unit tests weren't being accounted for by bazel. I took care of this too.

This PR also fixes some swift debugging stuff--"po" statements that weren't working before now do. I didn't rigorously verify this, but I also think this PR will lead to faster clean build times? It kinda seemed like it was while I was working on it.
2019-01-11 10:08:05 -05:00
featherless
8806821243
[ButtonBar] Add a Theming extension. (#5843)
This change makes use of MDCContainerScheme to provide a single theming-related API for ButtonBar.

Includes example updates unit tests.

This change is the first in a series of changes that will be required to add Theming extension support to AppBar:

- [x] ButtonBar
- [ ] NavigationBar
- [ ] HeaderStackView
- [ ] FlexibleHeader
- [ ] AppBar
2018-12-04 09:40:12 -05: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
Ali Rabbani
3c112ae350 [ButtonBar] Make left/right insets for image and text buttons consistent (#3397)
Internal testing of this PR is done in cl/193415210. This is a behavior change for text button insets in MDCButtonBar.

NOTE: This doesn't *change* insets for text buttons that are the only button in the bar on iPad, since it still adds a 12pt inset on both sides for it. on iPhone, the additional inset for edge buttons is 4pt, which results in a 16pt inset on the edge side(s).

Before screenshots:
[Text buttons on both sides](https://user-images.githubusercontent.com/2232489/38957009-57ca20fa-4327-11e8-9f62-a92a61c7f20f.png)
[Text button on one side](https://user-images.githubusercontent.com/2232489/38957010-57d6b784-4327-11e8-8971-2c565833052d.png)

After screenshots:
[Text buttons on both sides](https://user-images.githubusercontent.com/2232489/38957016-5c719ee4-4327-11e8-886c-a7b6bdece4b5.png)
[Text button on one side](https://user-images.githubusercontent.com/2232489/38957017-5c7ebd36-4327-11e8-868b-5fde087eb382.png)

closes #3342
2018-04-23 14:40:25 -04:00
Ali Rabbani
9947b8fa2b [ButtonBar] Fix insets for the trailing button bar (#3324)
Fix button insets used in MDCNavigationBar's trailing button bar. 

Internal testing of this PR is done in cl/192473549.

closes #2851
closes #3315
2018-04-12 14:53:57 -04:00
Robert Moore
0ee27517d0 [ButtonBar] Make ButtonBarButton insets in method (#1797)
Refactoring App Bar button builder to be more testable/modular.  Pulling
out a method to create the content edge insets for a button in a button
bar.
2017-08-14 16:36:01 -04:00
Robert Moore
1441a01113 [ButtonBar] Refactor ButtonBarBuilder for testing (#1796)
* [ButtonBar] Refactor ButtonBarBuilder for testing

Pulling out part of the ButtonBarBuilder logic to start making it more
testable.  Extracting the initial configuration of MDCButton from a
UIBarButtonItem into a class method and adding unit tests.
2017-08-14 14:59:12 -04:00