Currently any time we want to call `resolveColorWithTraitCollection` we have to call the lines below.
```objc
UIColor *foo = [self dynamicColor];
#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0)
if (@available(iOS 13.0, *)) {
return [foo resolvedColorWithTraitCollection:traitCollection];
}
#endif
```
after this change we will just have
```objc
UIColor *foo = [self dynamicColor];
return [foo mdc_resolvedColorWithTraitCollection:traitCollection];
```
This will make the codebase much cleaner as we add these resolve calls throughout the codebase.
All components should have a top-level umbrella header for their includes.
This allows easier refactoring of classes and files within the component.
Creating an umbrella for Color and using it outside the component.
Part of #8086
This method is copied from the one in MDCSemanticColorScheme.
We need to add it here for a clear structure and to avoid depending on the scheme target for low level elevation classes. (This method intuitively doesn't need to exist under scheme).
DynamicColor is not only useful inside color scheme class, but also in some other classes (dragon controller) as a utility method. A new UIColor category is created in this PR to facilitate it.
* Pull the functionality of UIColor+MDC into MDCThumbTrack.
MDCThumbTrack is now the only class using this behaviour, so three extra files have been removed now that they are no longer necessary.
* Fixed colon alignment.
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
Summary:
Initial ThumbTrack commit.
This is a private component.
Note that math functions are not finalized, pending testing in third_party.
Reviewers: randallli, ajsecord, featherless, #material_components_ios_owners
Reviewed By: randallli, ajsecord, featherless, #material_components_ios_owners
Subscribers: randallli, ajsecord
Projects: #material_components_ios_owners
Differential Revision: http://codereview.cc/D17