5124 Commits

Author SHA1 Message Date
Yarden Eitan
a8d3794de3
[NavigationDrawer] Added a state system to the Nav Drawer (#5520)
Context:
To allow us to create APIs for our users to set different appearances based on the different states the drawer can be in, we need to create an initial state system.

The Problem:
Without defining a state for our drawer, we won't be able to differentiate between different presentations the drawer may be in, and then alter the drawer's appearance effectively.

The Fix:
Provide a state enum as part of MDCBottomDrawerController, that is read only, and is set using a delegate that is initially set by the internal implementation.

Testing:
Unit Tests + Tested on an iPhone X and iPhone 7 with smaller and bigger preferredContentSize to imitate different states.

Related Bugs:
Closes #5524
2018-10-30 13:27:17 +02:00
guylivneh
bfa674da94 [NavigationDrawer] Fix the init of the MDCBottomDrawerViewController to use the designated inits (#5546)
Fix the init of the MDCBottomDrawerViewController to use the designated inits.
2018-10-30 13:22:47 +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
featherless
531b372815
[CI] Fix the test_all script. (#5538)
## Prior to this change

Our test_all script was using an Xcode schemes search and filter to identify any test schemes that exist in the repository and test them. Unfortunately, the script was not also testing to confirm that it found at least *some* tests, meaning if it did not find any tests it would silently succeed.

The script was essentially optimized for us adding multiple test schemes in the future. In practice, the frequency with which we add new test schemes is low (we've added only one in the past year via MaterialComponentsAlpha).

## The root cause

With d238c86d47eb072617d285106147ace613321aee, our Xcode test scheme names changed and our scheme search was no longer returning our unit test schemes, resulting in test_all succeeding even though it hadn't run any tests.

## After this change

The test_all script will explicitly test specific schemes. If these schemes change or move in the future, this script will fail until we also update the script's schemes.

This script now also pipes the test output through xcpretty if it is available.

Closes https://github.com/material-components/material-components-ios/issues/5539
2018-10-26 15:29:01 -04:00
Cody Weaver
92c8f03d30
Fix pod name (#5532)
### Context
In working on #5519 I tried to import "MaterialComponents/schemes/ColorScheme" and "MaterialComponents/schemes/TypographyScheme". Neither of these pods exist and you would get an error.

```bash

[!] CocoaPods could not find compatible versions for pod "MaterialComponents/schemes/ColorScheme":
  In Podfile:
    MaterialComponents/schemes/ColorScheme

None of your spec sources contain a spec satisfying the dependency: `MaterialComponents/schemes/ColorScheme`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.
```
### The problem
We are adding an extra "scheme" at the end of the podname.
### The fix
Remove extra "scheme" at the end of the podname.

### Test
1. Create a fake project
2. Set your `Podfile` to:

```bash
pod 'MaterialComponentsAlpha', 
:git => 'https://github.com/codeman7/material-components-ios.git', 
:branch => 'schemes'
```
2018-10-26 09:16:15 -04:00
Cody Weaver
07ed3771dc
[ActionSheet] Fix rotation bug (#5505)
### Context
In development of MDCActionSheet I thought it was necessary to have this extra work for `viewWillTransitionToSize:withTransitionCoordinator:`. After putting this into production it is no longer necessary and is causing bugs.

### The problem
ActionSheet doesn't layout correctly after a rotation

### The fix
Remove the extra work in `viewWillTransitionToSize:withTransitionCoordinator:` and let `layoutSubviews` handle layout.

### Testing
This was tested in iOS 11.1 and iOS 12 for iPhone X, iPhone XS Max, and iPad (Split View, Regular)

### Related bugs
Closes #5409 

### Screenshots
| Before | After |
| - | - |
|![simulator screen shot - iphone x - 2018-10-24 at 12 47 31](https://user-images.githubusercontent.com/7131294/47447197-fb842400-d78a-11e8-9724-4272c27395d3.png)|![simulator screen shot - iphone x - 2018-10-24 at 12 45 59](https://user-images.githubusercontent.com/7131294/47447227-076fe600-d78b-11e8-86b6-a59f7ba735c9.png)|

**_Note:_** Screenshot is generated from an iPhone X on iOS 12 starting from portrait, rotating to landscape and back to portrait.
2018-10-25 10:06:59 -04:00
rami-a
1d9b984cb3
[AppBar] Initial frame wrong in MDCAppBarViewController for iPad split screen (#5497)
### Context
When the migration from MDCAppBar to MDCAppBarViewController occurred, a small piece of code was left out, specifically in `addSubviewsToParent`.
### The problem
When running the catalog app in split screen on iPad and viewing the examples for MDCAppBarViewController, the App Bar is not sized correctly and overflows outside of the bounds.
### The fix
Re-add the frame width modifying logic from `addSubviewsToParent` into `didMoveToParentViewController:parent` for MDCAppBarViewController.
### Related bugs
closes #5479, b/118126496

### Screenshots
| Before | After |
| - | - |
|![before](https://user-images.githubusercontent.com/2364772/47369472-c35ce280-d6b1-11e8-9526-045b60b271e2.png)|![after](https://user-images.githubusercontent.com/2364772/47369481-c8219680-d6b1-11e8-9b6c-750aa78e5c57.png)|
2018-10-25 09:27:56 -04:00
Robert Moore
410f2f55e7 [List Items] Improve BiDi example performance. (#5506)
The example showing how to use MDF Internationalization's language
direction code was somewhat inefficient, calling the method twice on the
same string. Instead it should be called once and the result checked.

In manual testing, dropped overhead from 0.8% of Main Thread time to
0.4% while scrolling the example.
2018-10-24 19:05:12 -04:00
rami-a
479eaa84af
[Snackbar] Update MDCSnackbarColorThemer to set correct background color to match the spec (#5517)
### The problem
MDCSnackbarColorThemer is not aligned with the values for the background color from the spec and it should not appear transparent.

### The fix
Update the themer to blend the 2 colors from the spec to ensure Snackbar is aligned to the spec.

### Related bugs
Closes #5512 

### Screenshots
| Before | After |
| - | - |
|![mdc snackbar old](https://user-images.githubusercontent.com/2364772/47450771-18712500-d794-11e8-812d-9e70f6c795a5.png)|![mdc snackbar new](https://user-images.githubusercontent.com/2364772/47450792-20c96000-d794-11e8-9f3e-48169ddda5f9.png)|

**Note:** I rewrote the unit tests in Obj-c because of an issue with comparing colors that have alpha channels.
2018-10-24 15:56:03 -04:00
Andrew Overton
49b29af661
Use ListThemer for List example (#5502)
## The problem:

The Stereo cell example wasn't using the List Themer.

## The solution:

Make the Stereo cell example use the List Themer.

I didn't include before and after screenshots because there is no visual change.

Closes #5501.
2018-10-24 15:55:50 -04:00
Jeff Verkoeyen
941da20a44 Merge branch 'release-candidate' into develop 2018-10-24 14:25:47 -04:00
Jeff Verkoeyen
b10ea77f84 Bump the version. 2018-10-24 11:03:54 -04:00
Jeff Verkoeyen
edb2fd1f0c Update changelog. 2018-10-24 11:03:02 -04:00
Jeff Verkoeyen
0ec38a5242 Automatic changelog preparation for release. 2018-10-24 10:47:54 -04:00
Yarden Eitan
03691cad8e
[BottomSheet] [Shape]! Update to the Bottom Sheet Shape Themer (#5503)
** This is a breaking change to the Shape Scheme **

Based on recent conversations with design, there has been some updates to the way we theme our bottom sheet using shapes. Namely, the discussions revolved around the different states the sheet can be shaped in, and the different variations of sheets having different shape mappings ([Standard Bottom Sheet](https://material.io/design/components/sheets-bottom.html#standard-bottom-sheet) and [Modal Bottom Sheet](https://material.io/design/components/sheets-bottom.html#modal-bottom-sheet).

In conclusion, it has been decided that for the case of the Modal Bottom Sheet (our current bottom sheet), we map the top 2 corners to the Large Component Shape category when the sheet isn't in a full screen state. When the sheet is in full screen, we should not map it or shape it at all.
2018-10-24 07:45:37 -04:00
Andrew Overton
d1961ea5d7
Add RTL arabic text to list example (#5500)
## The problem:

There wasn't any RTL text in our List example!

## The solution:

I added some RTL text to our List example.

Closes #5498

### Before:
![simulator screen shot - iphone x - 2018-10-23 at 11 28 37](https://user-images.githubusercontent.com/8020010/47372425-bb07a600-d6b7-11e8-997f-ba19d17dc85b.png)

### After:
![simulator screen shot - iphone x - 2018-10-23 at 11 28 02](https://user-images.githubusercontent.com/8020010/47372426-bb07a600-d6b7-11e8-86b1-e088a8737102.png)
2018-10-23 16:52:33 -04:00
Gabe Giosia
f5a7a0d474 [MDCSlider] Allow setting exclusiveTouch on Sliders. (#5326)
reopening GH-5237

Exclusivetouch allows the developer to stop multitouch interactions within a window that are undesirable. https://developer.apple.com/documentation/uikit/uiview/1622453-exclusivetouch

closes #5236
2018-10-23 15:47:41 -04:00
Cody Weaver
fb59ac5f1b
[BottomSheet] Respect safe area after upward nudge (#5486)
### Context
ActionSheet is using MDCBottomSheet presentation controller which uses `MDCSheetContainerView` within the method `safeAreaInsetsDidChange` the `MDCSheetContainerView` would subtract the top safe area inset from the scrollView frame. This caused components using this presentation controller to have the correct layout initially but after a user interacts with it they wouldn't layout correctly.
### The problem
After the bottom sheet rebounds from an upward nudge it doesn't respect the safe area
### The fix
Remove the subtraction from the scrollView's frame.
### Related bugs
b/117286643, #5331

### Videos
| Before | After |
| - | - |
|![before](https://user-images.githubusercontent.com/7131294/47359992-25aae880-d69c-11e8-81fd-7c6675130e93.gif)|![after](https://user-images.githubusercontent.com/7131294/47360004-2b083300-d69c-11e8-864c-bc2022459f25.gif)|
2018-10-23 11:18:48 -04:00
Felix Emiliano
f375ef350d [Collections] Updates MDCCollectionViewEditor panning to use cell's center property instead of transform to update its position (#5329)
Note that this solution (using the cell's center property to update its position) is recommended by Apple documentation:
"Use this property to scale or rotate the view's frame rectangle within its superview's coordinate system. (To change the position of the view, modify the center property instead.)"
https://developer.apple.com/documentation/uikit/uiview/1622459-transform?language=objc

The bug is fixed when the cell's position is updated using the center property instead of using an offset in addition to the transform property.

Closes #5328
2018-10-23 11:10:47 -04:00
Felix Emiliano
f62f5369ec Ensures that the cell snapshot generated by MDCCollectionViewEditor reflects changes made to the cell (#5336)
If explicitly setting this boolean to YES is a concern due to performance (there is no visible degradation of performance with this change in place), at the very least a property in the MDCCollectionViewEditing protocol should allow clients using the MDCCollectionViewController to control whether or not the snapshot captures the latest state of the cell.

Closes #5335
2018-10-23 11:10:36 -04:00
rami-a
1ecf3e341a
Add dragons example for appbar that demonstrates issue #5412 (#5471)
This change is to help us fix a client-blocking bug by providing an example that reproduces the issue in #5412
2018-10-23 10:08:14 -04:00
Julien Poumailloux
e96d185e2e [List] SelfSizingStereoCell should invalidate its layout on re-use (#5439)
This change adds a call to -setNeedsLayout in -prepareForReuse. Without this call, the cell may not re-do a layout pass on re-use, causing truncation of the labels.

closes https://github.com/material-components/material-components-ios/issues/5436
2018-10-23 09:33:53 -04:00
Andrew Overton
14f66dc426
Do not enforce label text alignment based off effective user interface layout direction (#5475)
The problem:

We were enforcing label text alignment based off effective user interface layout direction.
As a result, if the system language was English and you created an Arabic label (with its textAlignment set to Right) the label would ultimately end up with a textAlignment of Left.

The solution:

Don't set textAlignment from within the cell. Leave it to the client.

Closes #5472.

Before:
![simulator screen shot - iphone x - 2018-10-22 at 16 23 26](https://user-images.githubusercontent.com/8020010/47317932-b50eb800-d618-11e8-999d-19aad687dbf2.png)

After:
![simulator screen shot - iphone x - 2018-10-22 at 16 23 58](https://user-images.githubusercontent.com/8020010/47317931-b50eb800-d618-11e8-9ae1-c70d4af7f3ae.png)
2018-10-23 09:31:26 -04:00
Andrew Overton
b47b889166
Allow stereo cell labels to take up all available space (#5476)
The problem:

The label wasn't taking up all available space. That way, with sufficiently short text, a right aligned Arabic label would appear to be left aligned. See before and after pics from the view debugger below.

The solution:

Allow stereo cell labels to take up all available space.

Before:
<img width="565" alt="screen shot 2018-10-22 at 4 42 29 pm" src="https://user-images.githubusercontent.com/8020010/47318438-11260c00-d61a-11e8-9c25-c541dfabf9ca.png">

After:
<img width="561" alt="screen shot 2018-10-22 at 4 43 40 pm" src="https://user-images.githubusercontent.com/8020010/47318437-11260c00-d61a-11e8-8c93-a9594970aa63.png">

Closes #5473.
2018-10-23 09:31:08 -04:00
Jeff Verkoeyen
30fe5bb319 Merge branch 'release-candidate' into develop 2018-10-23 09:29:34 -04:00
Cody Weaver
dd79e5c6b1
[Dialogs] Refactor test to use setup and teardown (#5482)
### Context
In working on #5296 I noticed a lot of the test had repeated code that can be pulled into a `setup` function. Additionally some of the test were missing _Given_, _When_, and _Then_ statements so those were added. This change hopefully makes this code more readable to future maintainers. I also noticed some of the test had extra work in the _Given_ that wasn't necessary so I removed that.
### The problem
Repeated steps in the _Given_ section of the test
### The fix
Implement the `setup` and `teardown` functions as well as add missing _Given_, _When_, and _Then_ comments.

### Related bugs
This isn't related to any bugs this is just something that I saw that could be improved.
2018-10-23 09:16:21 -04:00
Yarden Eitan
5dafdbaa86
graduate navigation drawer from Beta to Ready (#5470)
This PR is the last step in graduating the Navigation Drawer component from Beta to Ready.

We have resolved all the outstanding issues in the Navigation Drawer Project here: https://github.com/material-components/material-components-ios/projects/85 and hotlist: 1230549 .
The only outstanding issue is the unit tests ( #5466 , #5465 ) which were approved and are pending due to GitHub issues causing CI not to run.

We are essentially migrating here the NavigationDrawer component from the MaterialComponentsAlpha podspec to the MaterialComponents podspec so it can be used publicly using the normal means of installing our Pod.

This PR is blocked and can land once #5466 and #5465 land.

Closes #5333
2018-10-23 01:26:46 -04:00
Cody Weaver
690b81efdd
[NavigationDrawer] Test content height surplus and scrolls to reveal (#5466)
### Context
NavigationDrawer is missing unit test. One of the _heavy lifting_ functions is `cacheLayoutCalculation`, which has many side effects. One of those side effects is setting the `contentHeightSurplus`. `contentHeightSurplus` effects `scrollsToReveal` so those test were also added. 

**_Note:_** I didn't add any comments in the test but those may be necessary to give future maintainers context on why the test are a given result.

### Related issues
#4911 
### Related PR
#5465
2018-10-22 17:11:56 -04:00
Jeff Verkoeyen
5455a4fede Use template format in examples. 2018-10-22 16:46:01 -04:00
Jeff Verkoeyen
28a10204e3 Newlines. 2018-10-22 16:29:07 -04:00
Jeff Verkoeyen
21eb446963 Bump the version to 67.2.0. 2018-10-22 16:27:46 -04:00
Jeff Verkoeyen
635a5d565d Add an example. 2018-10-22 16:25:53 -04:00
Yarden Eitan
f535f99cf0
[Docs] Added Shape Scheme to the top level schemes doc (#5469)
* Addition of the shape scheme to the top level schemes GitHub doc
* Changed the component in the example code to Button as AppBar isn't shape-able.
2018-10-22 16:20:57 -04:00
Jeff Verkoeyen
37dff0e1e6 Generate release notes. 2018-10-22 16:20:17 -04:00
Galia Kaufman
325772ba5e [Dialogs] Theming action buttons in DialogThemer (#5416)
Adding semantic emphasis to Dialog actions which allows conditional theming of buttons. The MDCDailogScheme now has a button scheme which can be used to theme buttons according to their action's assigned emphasis.
Issue: b/117608629
Design Review document (go/gmdc-ios-dialogs-design-doc).
2018-10-22 16:12:52 -04:00
Cody Weaver
c7d4f27d0c [Dialogs] Fix elevation to use MDCShadowElevation
### Context
In working on #5296 and #5301 I used `CGFloat` instead of `MDCShadowElevation`. We have the `MDCShadowElevation` data type strictly for this exact use case and I missed that. This goes back and fixes those changes to match all other components. This shouldn't cause any changes in behavior but screenshots are added to make sure. Clients should be unaffected by this change even if they were using a custom elevation. 
```objc
dialog.elevation = 2;
```
Will work the same as before.

### The problem
MDCAlertController (and all related classes) used `CGFloat` instead of `MDCShadowElevation`.

### The fix
Replace `MDCShadowElevation` with `CGFloat`.

| Before | After |
| - | - |
|![simulator screen shot - iphone xs max - 2018-10-19 at 08 43 51](https://user-images.githubusercontent.com/7131294/47219484-e8cdb180-d37c-11e8-8a5f-1df485420582.png)|![simulator screen shot - iphone xs max - 2018-10-19 at 08 39 31](https://user-images.githubusercontent.com/7131294/47219488-ecf9cf00-d37c-11e8-8f52-a309752b5cdb.png)|
2018-10-22 16:12:43 -04:00
Galia Kaufman
9122fc2fcb [Dialogs] Upgrade buttons class to MDCButton (b/117543195) (#5401)
Switching MDCAlertController buttons from MDCFlatButton, which is being deprecated, to MDCButton.
Issue: b/117543195
TAP test: CL/217698229
Also see: #4739
2018-10-22 16:12:37 -04:00
Jeff Verkoeyen
33839217d3 Automatic changelog preparation for release. 2018-10-22 16:01:48 -04:00
Cody Weaver
b2c690d209
[NavigationDrawer] Add test for contentHeaderTopInset and presentingViewBounds (#5465)
### Content
NavigationDrawer is missing unit test. One of the _heavy lifting_ functions is `cacheLayoutCalculation`, which has many side effects. One of those side effects is setting the `contentHeaderTopInset`. In cacheLayoutCalculations there is two paths to set `contentHeaderTopInset` one is with scrollable content and one is without scrollable content. If the content isn't scrollable then the `contentHeaderTopInset` is the size of the `presentingViewBounds.size.height` minus the `headerViewController.preferredContentSize.height` and the `contentViewController.preferredContentSize.height`. If the content is scrollable then the `contentHeaderTopInset` is the size of the `presentingViewBounds` * `initialDrawerFactor`.  

### Work in the PR
Test `presentingViewBounds`

Test `contentHeaderTopInset` 
-  Scrollable
   - With large headerViewController
   - With large contentViewController
   - With large contentViewController and headerViewController
- Non-scrollable
  - With only a headerViewController
  - With only a contentViewController
  - With both a contentViewController and a headerViewController
  - With no contentViewController or headerViewController

### Remaining Work
For `cacheLayoutCalculations` we still need to test `contentHeightSurplus`
### Related issues
#4911
2018-10-22 15:20:18 -04:00
Galia Kaufman
d55d7ab9f2
[Dialogs] Theming action buttons in DialogThemer (#5416)
Adding semantic emphasis to Dialog actions which allows conditional theming of buttons. The MDCDailogScheme now has a button scheme which can be used to theme buttons according to their action's assigned emphasis.
Issue: b/117608629
Design Review document (go/gmdc-ios-dialogs-design-doc).
2018-10-22 12:31:03 -04:00
Yarden Eitan
d7f566994a
[Docs] Adds the shape themer API to the supporting components using the doc generation (#5464)
This PR adds the shape theming API documentation using the doc generation script improvements that were added in PR #5463 .

To achieve this, I added into the .vars files of the supported components the missing variables, and ran the script `scripts/apply_all_templates`. Then I ran `scripts/generate_readme component` for the components that have been added the `shape-theming.md` file, so it is seen in the actual README.md of the component.

Specifically, Bottom Sheet was using the old method of documentation, and wasn't using the right generation method, so it's doc content was just copied to the right location to allow its generation to work well as well.

Closes #5319
2018-10-19 17:05:50 -04:00
Yarden Eitan
71711cb2df
added shape theming to the scripting generation (#5463)
This add the shape theming doc generation for our components. Same as we did for color, we are adding the shape theming template so then it can be easily generated for our docs. I will generate the shape theming docs for our components in a follow up PR.
2018-10-19 16:32:33 -04:00
Cody Weaver
f925ce48db
[NavigationDrawer] Add unit test for height related properties (#5461)
### Context
We currently are missing a lot unit test for NavigationDrawer. In order to keep the PR's manageable I have decided to break them up into related groups. This group is the two properties that look at the headerViewControllers.preferredContentSize.height and tests those two.
### The problem
We are missing a lot of unit test for NavigationDrawer
### The fix
Add test for `topHeaderHeight` and `contentHeaderHeight`

### Bugs
Related to #4911
2018-10-19 16:05:34 -04:00
rami-a
70457a398a
[NavigationDrawer] Add Color Themer support (#5458)
### The problem

BottomDrawer previously had no color themer support

### The fix

This change adds a color themer for BottomDrawer. Additionally this adds unit tests and updates the example to use the color themer. The guidelines indicate the content and header should utilize the semantic surface color, so that is what the themer applies to the BottomDrawer. 

**Note:** The drawer should be configured with its header and content ViewControllers before applying the theme.

### Related issues

Closes #4910 

### Code snippet

#### Swift
```
    let bottomDrawerViewController = MDCBottomDrawerViewController()
    bottomDrawerViewController.contentViewController = contentViewController
    bottomDrawerViewController.headerViewController = headerViewController
    MDCBottomDrawerColorThemer.applySemanticColorScheme(colorScheme,
                                                        toBottomDrawer: bottomDrawerViewController)
```

#### ObjC
```
MDCBottomDrawerViewController *bottomDrawer = [[MDCBottomDrawerViewController alloc] init];
bottomDrawer.contentViewController = contentViewController
bottomDrawer.headerViewController = headerViewController
[MDCBottomDrawerColorThemer applySemanticColorScheme:self.colorScheme
                                      toBottomDrawer:bottomDrawer];
```
2018-10-19 15:36:58 -04:00
Yarden Eitan
83fffdb4cc
[Shapes] Added initial documentation for Shape Theming (#5460)
### Context
After releasing the Shape Theming code, this provides initial documentation for how to use shape theming, and its API.

### The problem
We lack documentation on what is Shape Theming, and how do you use it.

### The fix
An Initial doc outlining shape theming.

### Bug
Closes #4605 
Closes #4606
2018-10-19 15:26:26 -04:00
Yarden Eitan
58380e7c75
[NavigationDrawer] fix drawer not dismissing in full screen on 32 bit devices (#5454)
### Context
This is a bug fix to finalize the VoiceOver full screen presentation of the drawer, and allows the full screen presentation of the drawer to work correctly on all devices on Landscape as well.

### The problem
Up until today we have been using FLT_EPSILON as a number for comparison, but on 32 bit devices, in certain numbers that take more bits than others, the floating point precision loses the FLT_EPSILON. Example:
```
(lldb) po 20.f + FLT_EPSILON
20

(lldb) po 0 + FLT_EPSILON
0.00000011920929
```

### The fix
The EPSILON number is set to a significant enough number to allow easy comparison, and not get "lost" when added/subtracted into `CGFloat`s. Because the numbers using the epsilon are numbers that represent screen points, this new number also is small enough to not alter any visual changes due to it changing the screen points too drastically.

### Bug
Closes #5442 

### Tests
Tested on an iPhone 4S, iPhone 5, iPhone X, iPhone 7, portrait, landscape, VO on/off, iOS 8.1, 10, 12, on all Nav Drawer examples by dragging the drawer to see accurate dismissal.
2018-10-19 13:43:53 -04:00
Cody Weaver
596f72b395
[NavigationDrawer] Add Fakes files for tests (#5453)
### Context
In #5423 my thinking was that we would need to test MDCBottomDrawerViewController but majority of the test are going to be related to MDCBottomDrawerContainerViewController. We may still want to test MDCBottomDrawerViewController so that is why I haven't completely removed that file for tests. But, we need fakes in a couple places so this adds _Fakes_ files so that code can be shared.

### The problem
We need fakes for test in MaterialNavigationDrawer because we can't present and that code should be shared.

### The fix
Add a `MDCNavigationDrawerFakes` files so we can have fakes and they can be shared across test files.

### Related bugs
#4911
2018-10-19 12:31:27 -04:00
Cody Weaver
f18085def5
[Dialogs] Fix elevation to use MDCShadowElevation
### Context
In working on #5296 and #5301 I used `CGFloat` instead of `MDCShadowElevation`. We have the `MDCShadowElevation` data type strictly for this exact use case and I missed that. This goes back and fixes those changes to match all other components. This shouldn't cause any changes in behavior but screenshots are added to make sure. Clients should be unaffected by this change even if they were using a custom elevation. 
```objc
dialog.elevation = 2;
```
Will work the same as before.

### The problem
MDCAlertController (and all related classes) used `CGFloat` instead of `MDCShadowElevation`.

### The fix
Replace `MDCShadowElevation` with `CGFloat`.

| Before | After |
| - | - |
|![simulator screen shot - iphone xs max - 2018-10-19 at 08 43 51](https://user-images.githubusercontent.com/7131294/47219484-e8cdb180-d37c-11e8-8a5f-1df485420582.png)|![simulator screen shot - iphone xs max - 2018-10-19 at 08 39 31](https://user-images.githubusercontent.com/7131294/47219488-ecf9cf00-d37c-11e8-8f52-a309752b5cdb.png)|
2018-10-19 10:05:56 -04:00
=
d57bd2777a Revert "adjust code wrapper tags on bottom sheet read me (#5404)"
This reverts commit dcdd925166d5d8838c0b31721d00d5b250b444c4.
2018-10-18 16:54:10 -04:00
Galia Kaufman
c793fcf753
[Dialogs] Upgrade buttons class to MDCButton (b/117543195) (#5401)
Switching MDCAlertController buttons from MDCFlatButton, which is being deprecated, to MDCButton.
Issue: b/117543195
TAP test: CL/217698229
Also see: #4739
2018-10-18 16:05:51 -04:00