Skip to content

Commit

Permalink
[Tabs] Remove unused/duplicate method. (#7793)
Browse files Browse the repository at this point in the history
`applySelectionTemplateToSelectionViewForItemView:` is a duplicate of `updateSelectionIndicatorToIndex:` and was added by accident. No code calls it and it can be safely removed.

Part of #7748
  • Loading branch information
Robert Moore committed Jul 8, 2019
1 parent 8b028b2 commit 32905f3
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions components/Tabs/src/TabBarView/MDCTabBarView.m
Expand Up @@ -663,35 +663,6 @@ - (void)didTapItemView:(UITapGestureRecognizer *)tap {
}
}

- (void)applySelectionTemplateToSelectionViewForItemView:(UIView *)itemView {
if (!itemView) {
return;
}
// Extract content frame from item view.
CGRect selectionIndicatorBounds = CGRectStandardize(itemView.bounds);
CGRect contentFrame = selectionIndicatorBounds;
if ([itemView conformsToProtocol:@protocol(MDCTabBarViewIndicatorSupporting)]) {
UIView<MDCTabBarViewIndicatorSupporting> *supportingView =
(UIView<MDCTabBarViewIndicatorSupporting> *)itemView;
contentFrame = supportingView.contentFrame;
}

// Construct a context object describing the selected tab.
UITabBarItem *item = self.items[[self.itemViews indexOfObject:itemView]];
MDCTabBarViewPrivateIndicatorContext *context =
[[MDCTabBarViewPrivateIndicatorContext alloc] initWithItem:item
bounds:selectionIndicatorBounds
contentFrame:contentFrame];

// Ask the template for attributes.
id<MDCTabBarViewIndicatorTemplate> template = self.selectionIndicatorTemplate;
MDCTabBarViewIndicatorAttributes *indicatorAttributes =
[template indicatorAttributesForContext:context];

// Update the selection indicator.
[self.selectionIndicatorView applySelectionIndicatorAttributes:indicatorAttributes];
}

/// Sets _selectionIndicator's bounds and center to display under the item at the given index with
/// no animation. May be called from an animation block to animate the transition.
- (void)updateSelectionIndicatorToIndex:(NSUInteger)index {
Expand Down

0 comments on commit 32905f3

Please sign in to comment.