28 Commits

Author SHA1 Message Date
Jeff Verkoeyen
ec44b12ee9 Internal change
PiperOrigin-RevId: 394725753
2021-09-03 11:44:01 -07:00
Jeff Verkoeyen
b3fa42005b Optimizing imports
PiperOrigin-RevId: 356966407
2021-02-11 07:12:37 -08:00
Bryan Oltman
5da1486c9f [Slider] Add call to [super prepareForReuse] in example.
PiperOrigin-RevId: 331836270
2020-09-15 13:06:13 -07:00
Wenyu Zhang
e5c046c89a [Slider] Update Slider example to conform to minimum touch size by change frame.
PiperOrigin-RevId: 325465640
2020-08-07 10:56:48 -07:00
Bryan Oltman
de482d077a [Slider] Remove supplemental directory from examples.
PiperOrigin-RevId: 322598360
2020-07-22 10:09:20 -07:00
afweiss
46efae77c6 [Slider] Allowing Full Haptics for Discrete Sliders (#7765)
* haptics for slider

* updating formatting and style for slider haptics

* updated formatting for slider tests

* updating slider test name

* adding full haptics option for discrete sliders

* updated formatting for full haptics

* updating full haptics

* updating formatting for discrete haptics

* fixing formating
2019-07-09 09:18:08 -04:00
afweiss
2674c8cd13 [Slider] Haptics For Slider (#7738)
This adds haptics for sliders. The haptics for sliders are opt-out and cause a light vibration when the slider reaches the min or max value. These decisions were made to match apples implementation of haptics for sliders.
2019-07-01 15:55:13 -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
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
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
Cody Weaver
a5a8ba0c74
[Slider] Update examples for safeAreaInsets and schemes (#4897)
Update examples to respect safe area and be themed with MDCTypographyScheme and MDCSemanticColorScheme. This change also allows us to see the slider within the storyboard example and works with rotation for the other examples layout.

| Before | After |
|:-------|:------|
| ![comparedportbefore](https://user-images.githubusercontent.com/7131294/44680471-cddd6180-aa0b-11e8-976e-e765219e3003.png) | ![comparedportafter](https://user-images.githubusercontent.com/7131294/44680437-be5e1880-aa0b-11e8-8e4d-10c4e0738a28.png)|
| ![autolayoutbefore5](https://user-images.githubusercontent.com/7131294/44680488-da61ba00-aa0b-11e8-9ebc-92506f8b16c4.png) | ![autolayoutafter5](https://user-images.githubusercontent.com/7131294/44680505-e3528b80-aa0b-11e8-949b-14ea2c459ae5.png)|
|![autolayout5before](https://user-images.githubusercontent.com/7131294/44680542-01b88700-aa0c-11e8-9c8c-d676638c3aa9.png) | ![autolayout5after](https://user-images.githubusercontent.com/7131294/44680550-054c0e00-aa0c-11e8-8297-211e75e5da1f.png) |







Closes #3794
2018-08-28 10:57:54 -04:00
Cody Weaver
f3e2183204
[Slider] Respect safe area (#4912)
Make examples respect safe area.

Closes #3721
2018-08-28 05:52:48 -04:00
John Detloff
0c0ce4248e
Initialize default color and typography schemes in examples (#4200)
Ensure a default colorScheme and typographyScheme is initialized for examples.
2018-05-21 12:44:43 -04:00
Yarden Eitan
7f7bc36202
[Catalog] Expose colorScheme + typographyScheme properties for all examples to use app wide theming (#3478)
Made colorScheme and typographyScheme properties in the class interfaces for all our examples.
Moved theming away from example inits and into viewDidLoad
Small update for slider example to allow it to grab the theming properly.
Related Pivotal: https://www.pivotaltracker.com/story/show/156616695
2018-04-25 15:15:17 -04:00
featherless
0cc6b487ae
[Slider] Add umbrella headers for all extension targets. (#3474)
Also updated all imports to make use of the umbrella headers.

Pivotal story: https://www.pivotaltracker.com/story/show/157045283
2018-04-24 15:53:31 -04:00
John Detloff
3c139cc00d
[Slider] Update color themer (#3375)
Before:
![screen shot 2018-04-16 at 4 47 37 pm](https://user-images.githubusercontent.com/1418389/38834465-8c2ca684-4196-11e8-8536-d08e537c4bf2.png)
![screen shot 2018-04-16 at 4 47 42 pm](https://user-images.githubusercontent.com/1418389/38834466-8c35342a-4196-11e8-822a-a2d1aa3a767a.png)
![screen shot 2018-04-16 at 4 47 48 pm](https://user-images.githubusercontent.com/1418389/38834467-8c406b4c-4196-11e8-9e76-5792b31adf2d.png)

After:
![screen shot 2018-04-16 at 4 46 34 pm](https://user-images.githubusercontent.com/1418389/38834461-8c11b3c4-4196-11e8-902d-08e02fe5e8b7.png)
![screen shot 2018-04-16 at 4 46 41 pm](https://user-images.githubusercontent.com/1418389/38834462-8c1bb266-4196-11e8-9645-3a72bd4e1b8c.png)
![screen shot 2018-04-16 at 4 46 49 pm](https://user-images.githubusercontent.com/1418389/38834464-8c252b0c-4196-11e8-90a3-afb01d4af4ce.png)

https://www.pivotaltracker.com/story/show/156169452
2018-04-18 10:51:16 -04:00
Robert Moore
3cbd58837b
[Slider] Add tick color API (#3344)
The Slider needs a way to support custom colors for the discrete value "ticks"
within both the filled and unfilled portions of the track.  They should also
be customizable across states (to support disabled colors).

**Before**
![slider-tick-ex-before](https://user-images.githubusercontent.com/1753199/38699189-5acc6590-3e65-11e8-8078-a92f7f4b52dc.png)

**After**
![slider-tick-ex-after](https://user-images.githubusercontent.com/1753199/38699194-5eacb89a-3e65-11e8-8b46-c607a013730b.png)


Partially implements #3137
Pivotal story: https://www.pivotaltracker.com/story/show/155525171
14f043b
2018-04-12 16:25:49 -04:00
Robert Moore
b7d2999215
[Slider] Add inkColor, thumbColorForState:, trackFillColorForState: (#3310)
Instead of a single `color` property that maps back to multiple properties in
MDCThumbTrack, MDCSlider should make each of these properties explicit.  This
includes:

* Ink color
* Thumb color
* Track fill color
* Track background color

For `thumbColor`, `trackFillColor`, and `trackBackgroundColor`, the values are adjustable per-state
(e.g., for `.disabled`).

Partially implements #3137
Pivotal link: https://www.pivotaltracker.com/story/show/155525171
2018-04-12 08:51:04 -04:00
Robert Moore
2b37db4c90
[Slider] Fix green Slider example color (#3292)
The "Green slider without hollow circle at 0" was not green.

**Before**
![green-slider-before](https://user-images.githubusercontent.com/1753199/38504890-ead30a42-3be3-11e8-97e9-19e453fa55fd.png)


**After**
![green-slider-after](https://user-images.githubusercontent.com/1753199/38505104-656848e4-3be4-11e8-97a3-67be059168e1.png)
2018-04-09 14:14:49 -04: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
Junius Gunaratne
2873e798f2 [Themes] Add ability to change catalog theme (#1477)
Discussed merge with Ian offline. Issues with Travis CI may be resolved once the PR is merged.

* Add color to tiles.

* Add theming to catalog

* Update text field tile.

* Implementation method signatures should match those in header.

* Update MDCDrawFunc typedef

* Pass color scheme through NSNotification

* Add component theming

* Add tabbar themer

* Update tab example to use UIAppearance

* Theme sliders based on UIAppearance proxy

* Allow any class conforming to MDCColorScheme

* Override navigation bar color theme for imagery example.

* Update AppBar and ButtonBar color theming

* Update button bar themer comment

* Update button theming

* Remove theme imports where not necessary.

* Fix case of private
2017-06-23 11:36:48 -04:00
Scott Hyndman
4a011e75a5 [Docs] Docstravaganza (#1330)
* [Docs] Adds platform configuration for the doc site.

* [Docs] Adds path metadata for documentation site.

This field is used to determine where the file will appear in the
doc site.

* [Docs] Updates Material guideline links to latest URL.

material.google.com -> material.io/guidelines

* [Docs] Introduces a separate component index for the docsite.

* [Docs] Changes the directory used for site generation.

* [Docs] Moves documentation-site-only Markdown into its own directory.

* [Docs] Changes material.io links to use https.

* [Docs] Renames the howto and contributing docsite sections to docs.

* [Docs] Adds a navTitle field to the collection editing/styling pages.

* [Docs] Changes the FAQ heading to be one size bigger.

* [Docs] Changes the tutorial title.

* [Docs] Adds icons to three more components.

* [Docs] Introduces a root component directory called /catalog/.

* [Docs] Adds an icon to the AnimationTiming component.

* [Docs] Adds an icon for the typography component.

* [Docs] Reformats the docsite index.
2017-05-01 17:27:38 -04:00
Max Luzuriaga
eebab2557d [Slider] ThumbHollowAtStart property better named with obj-c conventions
Summary: Leaves setter as `slider.thumbHollowAtStart` but makes getter `slider.isThumbHollowAtStart`.

Reviewers: O1 Material components iOS, iangordon

Reviewed By: O1 Material components iOS, iangordon

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1525
2016-08-24 12:01:36 -04:00
Max Luzuriaga
14e1943f44 [Slider] Rename thumbIsHollowAtStart to isThumbHollowAtStart
Summary: Per Junius' suggestion, this name fits better with the convention of BOOL var names.

Reviewers: O1 Material components iOS, randallli, junius

Reviewed By: O1 Material components iOS, randallli, junius

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1520
2016-08-24 10:12:51 -04:00
Max Luzuriaga
19ab4675a6 [Slider] Property for whether or not thumb is hollow at minimum value
Summary:
Adds `thumbIsHollowAtStart` property to MDCSlider, to support usages where you don't need the thumb view to be hollow when `slider.value == slider.minimumValue`, i.e. when the slider is used as a scrubber in an audio or video file.

Also adds an example of this property being `NO` to the primary slider example view controller.

{F6417}

Reviewers: O1 Material components iOS, randallli

Reviewed By: O1 Material components iOS, randallli

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1518
2016-08-23 15:46:01 -04:00
Max Luzuriaga
72088f48cb [Slider] Expanded slider demo within a collection view.
Summary:
Switched the default demo for MDCSlider to a new view controller that displays several different types of sliders in a collection view format. Serves as an example of how to use a slider in this context, as collection views are often used for settings screens where sliders are most likely to appear.

Also shows off new options for the slider, such as displaying the discrete value label or not, and setting an anchor value to draw the track from.

{F6385}

Reviewers: O1 Material components iOS, randallli

Reviewed By: O1 Material components iOS, randallli

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1486
2016-08-23 15:21:00 -04:00