18 Commits

Author SHA1 Message Date
Wenyu Zhang
b457b13005 Internal change.
PiperOrigin-RevId: 417635153
2021-12-21 09:32:05 -08:00
Jeff Verkoeyen
dc067749f1 Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 400786978
2021-10-04 12:36:05 -07:00
Randall Li
502bc5d910 Ran a Swift formatter
PiperOrigin-RevId: 395947664
2021-09-10 09:48:14 -07:00
Jeff Verkoeyen
92254ea119 Rename all icons to an ic_<#name#> convention.
PiperOrigin-RevId: 308232277
2020-04-24 04:33:51 -07:00
Cody Weaver
fdf87c5995 [MDC/ColorScheme] Remove usage of init within MDC.
We recommend using `initWithDefaults` and we should follow the recommendation. This change removes all usage of `init` within MDC components in order to let us remove that initializer from the public surface.

PiperOrigin-RevId: 302958447
2020-03-25 13:36:51 -07:00
Andrew Overton
ab8c10bfdf
Don't use MDCBottomDrawerColorThemer (#9204)
Related to #9210
2019-12-10 10:01:58 -05:00
Bryan Oltman
68a65d33d3
[BottomAppBar] Delete deprecated MDCBottomAppBarColorThemer (#9166)
MDCBottomAppBarColorThemer has no internal use and is deprecated.

Fixes #9164
Fixes #9165
2019-12-06 17:10:33 -05:00
Andrew Overton
b4f12284b5 Revert "[NavigationDrawer] Fix over scrolled bottom navigation incorrectly showing the scrim and presenting view (#8618)"
This reverts commit 738682323f54197c3d6244740b2c5e0f2b9f53de.
2019-10-23 14:18:57 -04:00
Randall Li
738682323f
[NavigationDrawer] Fix over scrolled bottom navigation incorrectly showing the scrim and presenting view (#8618)
Fixes the over-scroll of the bottom navigation drawer so that it does not show the scrim and presenting view controller when over-scrolling the content.

We do this by setting the color of the scrim to the background color of the tracking scroll view.

The default scrim color is now exposed.

Before:
![Simulator Screen Shot - iPhone 11 Pro - 2019-10-21 at 16 36 06](https://user-images.githubusercontent.com/943565/67241188-f3ec6f00-f420-11e9-9b60-dcb57c06dbd8.png)


after:
![Simulator Screen Shot - iPhone 11 Pro - 2019-10-21 at 16 33 16](https://user-images.githubusercontent.com/943565/67240972-87717000-f420-11e9-8c03-de59039be43d.png)
![Simulator Screen Shot - iPhone 11 Pro - 2019-10-21 at 16 33 11](https://user-images.githubusercontent.com/943565/67240994-93f5c880-f420-11e9-8500-17359551cd37.png)


This work started with @andrewoverton's https://github.com/material-components/material-components-ios/pull/8612
2019-10-22 10:07:15 -04:00
featherless
a01712388b
[BottomAppBar] Deprecate the ColorThemer. (#8438)
Part of https://github.com/material-components/material-components-ios/issues/8429

There is no internal usage of this API.
2019-09-11 09:00:36 -04:00
Yarden Eitan
efe61588a6
update (#7246)
We need to add @objc annotations to colorScheme and typographyScheme instances in our Swift examples, because we moved to Swift 4.2, the respondsToSelector won't find `setColorScheme:` and `setTypographyScheme:` setters otherwise.
2019-04-23 10:21:14 -04:00
Andrew Overton
c56d5d76d3
Add @objc annotations to get examples to show up in Dragons (#7168)
This is a follow up PR for #7166 adds @objc annotations to Swift catalogMetadata() methods, because the Swift 4 compiler no longer attempts to infer what methods should be visible to Objective-C. As a result of this change in the compiler, no Swift examples were showing up in Dragons after #7166. See this article: https://useyourloaf.com/blog/objc-warnings-upgrading-to-swift-4/ for additional context.
2019-04-17 21:35:43 -04:00
Andrew Overton
b38372192f
Update to Swift 4.2 (#7166)
This PR updates the Swift version to 4.2.

Partially resolves #6874.
2019-04-17 16:59:02 -04:00
Cody Weaver
e2b2240618 [NavigationDrawer] Fix jump when perferredContentSize changes (#5928)
### Context
Currently `MDCBottomDrawerViewController` _jumps_ if the preferredContentSize changes. A client is asking for this _jump_ to not happen but instead the drawer will look the same but have more content. 

#### Conditional checks

1. The check to see if `_contentVCPreferredContentSizeHeightCached` is zero is because on initial layout this value is 0 until we call `cacheLayoutCalculations` which sets this value. 
2. The check to see if `percentageFullScreen > 0.5` is there to make sure we never have an initial drawer factor more than design has specified.

### The problem
`MDCBottomDrawerViewController` _jumps_ if the preferredContentSize changes

### The fix
Set initialDrawerFactor to a custom value so that change doesn't cause a jump.

### Videos
| Before | After |
| - | - |
|![before](https://user-images.githubusercontent.com/7131294/49542847-a0267500-f8a4-11e8-90c9-e5304e5da9a2.gif)|![after](https://user-images.githubusercontent.com/7131294/49542855-a4eb2900-f8a4-11e8-9db3-3b163dbe5e9b.gif)|
2018-12-05 21:26:09 -05:00
Randall Li
487a45d09b add missing imports to MaterialNavigationDrawer+ColorThemer 2018-12-05 20:54:22 -05:00
Yarden Eitan
31e3f33df3
[NavigationDrawer] Add dynamically sizing support for the drawer + performance improvements (#5587)
**Context:**
Clients need the ability to dynamically size their navigation drawer content and have the drawer work appropriately and correctly.

**The Problem:**
Currently we have no mechanism where we let the drawer know that the size of the content has changed and the internal calculations need to be re-calculated and re-applied.

Also, before we were partially listening to the `preferredContentSize` by asking if it has changed every so often using the conditional in the `contentHeightSurplus` getter. Some clients can have a very calculations heavy `preferredContentSize`, which will cause the whole drawer mechanism to lag.

**The Fix:**
Because the `contentViewController` and the `headerViewController` are child view controllers of `MDCBottomDrawerContainerViewController` , we can listen to `preferredContentSizeDidChangeForChildContentContainer` and reset the previously calculated variables and relayout the drawer.

**Testing:**
Unit Test + Tested on an iPhone X and iPhone 7 on all examples, portrait and landscape. A dragons example has been created exactly for the testing of the dynamically changing content size here: #5545 

**Related Bugs:**
Closes #5514
2018-11-08 09:46:22 +02:00
Yarden Eitan
2127004680
automatically disable scrolling (#5586)
**Context:**
Some clients were not aware that their content's scroll view needs to be disabled so the content will not start scrolling while dragging the drawer.

**The Problem:**
Clients need to explicitly set their tracking scroll view scrolling to disabled manually.

**The Fix:**
If a tracking scroll view is provided, set the scrolling to disabled automatically and therefore cause less client confusion

**Testing:**
Unit Test + Tested on an iPhone X on all examples.
2018-11-07 11:12:51 +02:00
guylivneh
08b71a81ee [BottomDrawer] Adding an example for dynamically changing content size (#5545)
Adding an example for dynamically changing content size.
2018-10-29 17:52:24 +02:00