From 40e66874e6ab9000226e825b75d71f91c93e07c0 Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Tue, 28 Jul 2020 13:05:36 -0700 Subject: [PATCH] [Snackbar] Delete deprecated MDCSnackbarFontThemer. PiperOrigin-RevId: 323636613 --- .../src/FontThemer/MDCSnackbarFontThemer.h | 61 ------------------- .../src/FontThemer/MDCSnackbarFontThemer.m | 30 --------- .../FontThemer/MaterialSnackbar+FontThemer.h | 15 ----- .../tests/unit/MDCSnackbarFontThemerTests.m | 57 ----------------- 4 files changed, 163 deletions(-) delete mode 100644 components/Snackbar/src/FontThemer/MDCSnackbarFontThemer.h delete mode 100644 components/Snackbar/src/FontThemer/MDCSnackbarFontThemer.m delete mode 100644 components/Snackbar/src/FontThemer/MaterialSnackbar+FontThemer.h delete mode 100644 components/Snackbar/tests/unit/MDCSnackbarFontThemerTests.m diff --git a/components/Snackbar/src/FontThemer/MDCSnackbarFontThemer.h b/components/Snackbar/src/FontThemer/MDCSnackbarFontThemer.h deleted file mode 100644 index 5f3ba74c884..00000000000 --- a/components/Snackbar/src/FontThemer/MDCSnackbarFontThemer.h +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2018-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. - -#import - -#import "MaterialSnackbar.h" -#import "MaterialThemes.h" - -#pragma mark - Soon to be deprecated - -/** - Used to apply a font scheme to theme to MDCSnackbarMessageView. - - @warning This API will eventually be deprecated. See the individual method documentation for - details on replacement APIs. - Learn more at docs/theming.md#migration-guide-themers-to-theming-extensions - */ -@interface MDCSnackbarFontThemer : NSObject -@end - -@interface MDCSnackbarFontThemer (Deprecated) - -/** - Applies a font scheme to theme to a MDCSnackbarMessageView. - - @warning This API will soon be deprecated. Please consider using MDCSnackbarTypographyThemer - instead. - - @param fontScheme The font scheme to apply to MDCSnackbarMessageView. - @param snackbarMessageView A MDCSnackbarMessageView instance to apply a font scheme. - - @warning This API will eventually be deprecated. There is no replacement yet. - Track progress here: https://github.com/material-components/material-components-ios/issues/7172 - Learn more at docs/theming.md#migration-guide-themers-to-theming-extensions - */ -+ (void)applyFontScheme:(nonnull id)fontScheme - toSnackbarMessageView:(nonnull MDCSnackbarMessageView *)snackbarMessageView; - -/** - Applies a font scheme to theme to a MDCSnackbarMessageView. - - @param fontScheme The font scheme to apply to MDCSnackbarMessageView. - - @warning This API will eventually be deprecated. There is no replacement yet. - Track progress here: https://github.com/material-components/material-components-ios/issues/7172 - Learn more at docs/theming.md#migration-guide-themers-to-theming-extensions - */ -+ (void)applyFontScheme:(nonnull id)fontScheme; - -@end diff --git a/components/Snackbar/src/FontThemer/MDCSnackbarFontThemer.m b/components/Snackbar/src/FontThemer/MDCSnackbarFontThemer.m deleted file mode 100644 index 1aa16b721fd..00000000000 --- a/components/Snackbar/src/FontThemer/MDCSnackbarFontThemer.m +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2018-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. - -#import "MDCSnackbarFontThemer.h" - -@implementation MDCSnackbarFontThemer - -+ (void)applyFontScheme:(nonnull id)fontScheme - toSnackbarMessageView:(nonnull MDCSnackbarMessageView *)snackbarMessageView { - snackbarMessageView.messageFont = fontScheme.body2; - snackbarMessageView.buttonFont = fontScheme.button; -} - -+ (void)applyFontScheme:(nonnull id)fontScheme { - MDCSnackbarManager.messageFont = fontScheme.body2; - MDCSnackbarManager.buttonFont = fontScheme.button; -} - -@end diff --git a/components/Snackbar/src/FontThemer/MaterialSnackbar+FontThemer.h b/components/Snackbar/src/FontThemer/MaterialSnackbar+FontThemer.h deleted file mode 100644 index 8c6e0d0c6ae..00000000000 --- a/components/Snackbar/src/FontThemer/MaterialSnackbar+FontThemer.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2018-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. - -#import "MDCSnackbarFontThemer.h" diff --git a/components/Snackbar/tests/unit/MDCSnackbarFontThemerTests.m b/components/Snackbar/tests/unit/MDCSnackbarFontThemerTests.m deleted file mode 100644 index 9c802357d3e..00000000000 --- a/components/Snackbar/tests/unit/MDCSnackbarFontThemerTests.m +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2018-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. - -#import - -#import "MaterialSnackbar+FontThemer.h" -#import "MaterialSnackbar.h" -#import "MaterialThemes.h" - -@interface MDCSnackbarFontThemerTests : XCTestCase -@end - -@implementation MDCSnackbarFontThemerTests - -- (void)tearDown { - [MDCSnackbarManager dismissAndCallCompletionBlocksWithCategory:nil]; - - [super tearDown]; -} - -- (void)testSnackbarFontThemerUsingUIAppearance { - MDCSnackbarMessage *message = [[MDCSnackbarMessage alloc] init]; - message.text = @"How much wood would a woodchuck chuck if a woodchuck could chuck wood?"; - [MDCSnackbarManager showMessage:message]; - MDCBasicFontScheme *fontScheme = [[MDCBasicFontScheme alloc] init]; - fontScheme.button = [UIFont boldSystemFontOfSize:12]; - fontScheme.body2 = [UIFont systemFontOfSize:13]; - [MDCSnackbarFontThemer applyFontScheme:fontScheme - toSnackbarMessageView:[MDCSnackbarMessageView appearance]]; - XCTAssertEqualObjects([MDCSnackbarMessageView appearance].messageFont, fontScheme.body2); - XCTAssertEqualObjects([MDCSnackbarMessageView appearance].buttonFont, fontScheme.button); -} - -- (void)testSnackbarFontThemer { - MDCSnackbarMessage *message = [[MDCSnackbarMessage alloc] init]; - message.text = @"How much wood would a woodchuck chuck if a woodchuck could chuck wood?"; - [MDCSnackbarManager showMessage:message]; - MDCBasicFontScheme *fontScheme = [[MDCBasicFontScheme alloc] init]; - fontScheme.button = [UIFont boldSystemFontOfSize:12]; - fontScheme.body2 = [UIFont systemFontOfSize:13]; - [MDCSnackbarFontThemer applyFontScheme:fontScheme]; - XCTAssertEqualObjects(MDCSnackbarManager.messageFont, fontScheme.body2); - XCTAssertEqualObjects(MDCSnackbarManager.buttonFont, fontScheme.button); -} - -@end