Skip to content

Commit

Permalink
[BottomNavigation] Move MDCBottomNavigationBarController to main podspec
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 326698570
  • Loading branch information
andrewoverton authored and material-automation committed Aug 14, 2020
1 parent 3022102 commit b22eef5
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 83 deletions.
21 changes: 20 additions & 1 deletion MaterialComponents.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ Pod::Spec.new do |mdc|
]
component.exclude_files = [
"components/#{component.base_name}/src/MDCBottomNavigationBarController.*",
"components/#{component.base_name}/src/MaterialBottomNavigationBeta.h"
"components/#{component.base_name}/src/MaterialBottomNavigation+BottomNavigationController.h"
]
component.resources = [
"components/#{component.base_name}/src/Material#{component.base_name}.bundle"
Expand Down Expand Up @@ -341,6 +341,25 @@ Pod::Spec.new do |mdc|
end
end

mdc.subspec "BottomNavigation+BottomNavigationController" do |component|
component.ios.deployment_target = '10.0'
component.public_header_files = [
"components/#{component.base_name.split('+')[0]}/src/MDCBottomNavigationBarController.h",
"components/#{component.base_name.split('+')[0]}/src/MaterialBottomNavigation+BottomNavigationController.h",
]
component.source_files = [
"components/#{component.base_name.split('+')[0]}/src/MDCBottomNavigationBarController.*",
"components/#{component.base_name.split('+')[0]}/src/MaterialBottomNavigation+BottomNavigationController.h",
]
component.dependency "MaterialComponents/BottomNavigation"
component.test_spec 'UnitTests' do |unit_tests|
unit_tests.source_files = [
"components/#{component.base_name.split('+')[0]}/tests/unit/MDCBottomNavigationBarControllerTests.m",
"components/#{component.base_name.split('+')[0]}/tests/unit/MDCBottomNavigationBarControllerDelegateTests.m"
]
end
end

mdc.subspec "BottomNavigation+Theming" do |extension|
extension.ios.deployment_target = '10.0'
extension.public_header_files = "components/#{extension.base_name.split('+')[0]}/src/#{extension.base_name.split('+')[1]}/*.h"
Expand Down
41 changes: 0 additions & 41 deletions MaterialComponentsBeta.podspec

This file was deleted.

1 change: 0 additions & 1 deletion MaterialComponentsExamples.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ Pod::Spec.new do |s|

s.resources = ['components/*/examples/resources/*', 'components/private/*/examples/resources/*', 'components/schemes/*/examples/resources/*']
s.dependency 'MaterialComponents'
s.dependency 'MaterialComponentsBeta'
s.public_header_files = ['components/*/examples/*.h', 'components/*/examples/supplemental/*.h', 'components/private/*/examples/*.h', 'components/schemes/*/examples/*.h']
end
1 change: 0 additions & 1 deletion MaterialComponentsSnapshotTests.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ Pod::Spec.new do |s|
s.platform = :ios, '10.0'
s.requires_arc = true
s.dependency 'MaterialComponents'
s.dependency 'MaterialComponentsBeta'
s.dependency 'MaterialComponentsExamples'

# Top level sources are required. Without them, unit test targets do not show up in Xcode.
Expand Down
2 changes: 0 additions & 2 deletions catalog/MDCCatalog.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,6 @@
"${BUILT_PRODUCTS_DIR}/MDFTextAccessibility/MDFTextAccessibility.framework",
"${BUILT_PRODUCTS_DIR}/MaterialCatalog/MaterialCatalog.framework",
"${BUILT_PRODUCTS_DIR}/MaterialComponents/MaterialComponents.framework",
"${BUILT_PRODUCTS_DIR}/MaterialComponentsBeta/MaterialComponentsBeta.framework",
"${BUILT_PRODUCTS_DIR}/MaterialComponentsExamples/MaterialComponentsExamples.framework",
"${BUILT_PRODUCTS_DIR}/MaterialComponentsSnapshotTests/MaterialComponentsSnapshotTests.framework",
"${BUILT_PRODUCTS_DIR}/MotionAnimator/MotionAnimator.framework",
Expand All @@ -433,7 +432,6 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MDFTextAccessibility.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MaterialCatalog.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MaterialComponents.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MaterialComponentsBeta.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MaterialComponentsExamples.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MaterialComponentsSnapshotTests.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MotionAnimator.framework",
Expand Down
2 changes: 0 additions & 2 deletions catalog/MDCDragons.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@
"${BUILT_PRODUCTS_DIR}/MDFInternationalization/MDFInternationalization.framework",
"${BUILT_PRODUCTS_DIR}/MDFTextAccessibility/MDFTextAccessibility.framework",
"${BUILT_PRODUCTS_DIR}/MaterialComponents/MaterialComponents.framework",
"${BUILT_PRODUCTS_DIR}/MaterialComponentsBeta/MaterialComponentsBeta.framework",
"${BUILT_PRODUCTS_DIR}/MaterialComponentsExamples/MaterialComponentsExamples.framework",
"${BUILT_PRODUCTS_DIR}/MotionAnimator/MotionAnimator.framework",
"${BUILT_PRODUCTS_DIR}/MotionInterchange/MotionInterchange.framework",
Expand All @@ -217,7 +216,6 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MDFInternationalization.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MDFTextAccessibility.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MaterialComponents.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MaterialComponentsBeta.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MaterialComponentsExamples.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MotionAnimator.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MotionInterchange.framework",
Expand Down
8 changes: 2 additions & 6 deletions catalog/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ target "MDCCatalog" do
'Banner+Theming/UnitTests',
'BottomAppBar/UnitTests',
'BottomNavigation/UnitTests',
'BottomNavigation+BottomNavigationController/UnitTests',
'BottomNavigation+Theming/UnitTests',
'BottomSheet/UnitTests',
'ButtonBar/UnitTests',
Expand Down Expand Up @@ -86,9 +87,6 @@ target "MDCCatalog" do
'Themes/UnitTests',
'Typography/UnitTests',
]
pod 'MaterialComponentsBeta', :path => '../', :testspecs => [
'BottomNavigation/UnitTests',
]
pod 'MaterialComponentsSnapshotTests', :path => '../', :testspecs => [
'SnapshotTests'
]
Expand All @@ -103,7 +101,6 @@ target "MDCActionExtension" do
project 'MDCCatalog.xcodeproj'
pod 'MaterialComponentsExamples', :path => '../'
pod 'MaterialComponents', :path => '../'
pod 'MaterialComponentsBeta', :path => '../'
pod 'CatalogByConvention', "~> 2.5"
pod 'MaterialCatalog', :path => 'MaterialCatalog/'

Expand All @@ -115,7 +112,6 @@ target "MDCDragons" do
project 'MDCDragons.xcodeproj'
pod 'CatalogByConvention', "~> 2.5"
pod 'MaterialComponents', :path => '../'
pod 'MaterialComponentsBeta', :path => '../'
pod 'MaterialComponentsExamples', :path => '../'
use_frameworks!
end
Expand All @@ -124,7 +120,7 @@ post_install do |installer|

mdc_xcconfigs = []
target_support_files_path = File.dirname(installer.pods_project.path) + "/" + "Target Support Files"
subdirectories = ["MaterialComponents", "MaterialComponentsBeta", "MaterialComponentsExamples", "Pods-MDCCatalog"]
subdirectories = ["MaterialComponents", "MaterialComponentsExamples", "Pods-MDCCatalog"]
subdirectories.each do |subdirectory|
subdirectory_path = target_support_files_path + "/" + subdirectory
Dir.foreach(subdirectory_path) do |file|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
// limitations under the License.

import UIKit

import MaterialComponentsBeta.MaterialBottomNavigationBeta
import MaterialComponents.MaterialBottomNavigation
import MaterialComponents.MaterialBottomNavigation_Theming
import MaterialComponents.MaterialBottomNavigation_BottomNavigationController
import MaterialComponents.MaterialBottomNavigation_Theming
import MaterialComponents.MaterialContainerScheme

class BottomNavigationControllerExampleFixedChildViewController: UIViewController {
Expand Down Expand Up @@ -62,11 +61,15 @@ class BottomNavigationControllerExampleScrollableChildViewController: UICollecti
return 1
}

override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
override func collectionView(
_ collectionView: UICollectionView, numberOfItemsInSection section: Int
) -> Int {
return numberOfItems
}

override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
override func collectionView(
_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath
) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath)
let hue = CGFloat(indexPath.row) / CGFloat(numberOfItems)
cell.backgroundColor = UIColor(hue: hue, saturation: 1, brightness: 1, alpha: 1)
Expand Down Expand Up @@ -101,25 +104,29 @@ class BottomNavigationControllerExampleViewController: MDCBottomNavigationBarCon

let flowLayout = UICollectionViewFlowLayout()
flowLayout.estimatedItemSize = CGSize(width: 96, height: 48)
let viewController1 = BottomNavigationControllerExampleScrollableChildViewController(collectionViewLayout: flowLayout)
let viewController1 = BottomNavigationControllerExampleScrollableChildViewController(
collectionViewLayout: flowLayout)
viewController1.collectionView.backgroundColor = containerScheme.colorScheme.primaryColorVariant
viewController1.tabBarItem = UITabBarItem(title: "Item 1", image: UIImage(named: "ic_home"), tag: 0)
viewController1.tabBarItem = UITabBarItem(
title: "Item 1", image: UIImage(named: "ic_home"), tag: 0)

let viewController2 = BottomNavigationControllerExampleFixedChildViewController()
viewController2.containerScheme = containerScheme
viewController2.tabBarItem = UITabBarItem(title: "Item 2", image: UIImage(named: "ic_favorite"), tag: 1)
viewController2.tabBarItem = UITabBarItem(
title: "Item 2", image: UIImage(named: "ic_favorite"), tag: 1)

let viewController3 = UIViewController()
viewController3.view.backgroundColor = containerScheme.colorScheme.surfaceColor
viewController3.tabBarItem = UITabBarItem(title: "Item 3", image: UIImage(named: "ic_search"), tag: 2)
viewController3.tabBarItem = UITabBarItem(
title: "Item 3", image: UIImage(named: "ic_search"), tag: 2)

viewControllers = [ viewController1, viewController2, viewController3 ]
viewControllers = [viewController1, viewController2, viewController3]
}

@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Bottom Navigation", "Bottom Navigation Controller"],
"presentable": false
"presentable": false,
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#import <XCTest/XCTest.h>

#import "MaterialBottomNavigationBeta.h"
#import "MaterialBottomNavigation+BottomNavigationController.h"

/** Delegate that implements no optional APIs. */
@interface MDCBottomNavigationBarControllerDelegateWithNoOptionals
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#import <CoreGraphics/CoreGraphics.h>
#import <XCTest/XCTest.h>

#import <MaterialComponentsBeta/MaterialBottomNavigationBeta.h>
#import "MaterialBottomNavigation+BottomNavigationController.h"

static CGFloat const kDefaultExpectationTimeout = 15;

Expand Down
16 changes: 0 additions & 16 deletions components/private/Beta/src/MaterialBetaComponent.h

This file was deleted.

0 comments on commit b22eef5

Please sign in to comment.