Skip to content

Commit 541d8d0

Browse files
author
Junius Gunaratne
committed
Make sure Pesto header logo is centered on rotate
Reviewers: traviskaufman, #material_components_ios_owners, ajsecord Reviewed By: #material_components_ios_owners, ajsecord Projects: #material_components_ios Differential Revision: http://codereview.cc/D132
1 parent c2e207c commit 541d8d0

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

demos/Pesto/Pesto.xcodeproj/project.pbxproj

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -112,25 +112,25 @@
112112
DEBEDF301C3EF5D5004B614B /* Main.storyboard */,
113113
DEBEDF2A1C3EF5D5004B614B /* PestoAppDelegate.h */,
114114
DEBEDF2B1C3EF5D5004B614B /* PestoAppDelegate.m */,
115+
C91F6A481C62BC0400EB4BA8 /* PestoAvatarView.h */,
116+
C91F6A491C62BC0400EB4BA8 /* PestoAvatarView.m */,
115117
DE381E181C457CE300019C1D /* PestoCardCollectionViewCell.h */,
116118
DE381E191C457CEE00019C1D /* PestoCardCollectionViewCell.m */,
119+
DE3620631C73A0710026DF5D /* PestoCollectionViewController.h */,
120+
DE3620641C73A0850026DF5D /* PestoCollectionViewController.m */,
121+
DEA791011C751D00006301CC /* PestoData.h */,
122+
DEA791021C751D0D006301CC /* PestoData.m */,
117123
DE5EF8651C404DFD00D2D4B9 /* PestoDetailViewController.h */,
118124
DE5EF8661C404E0E00D2D4B9 /* PestoDetailViewController.m */,
119-
DE381E3E1C45A9FB00019C1D /* PestoSideView.h */,
120-
DE381E3F1C45A9FB00019C1D /* PestoSideView.m */,
121-
C9A855291C4EDFAA003CADF7 /* PestoSettingsViewController.h */,
122-
C9A8552A1C4EDFAA003CADF7 /* PestoSettingsViewController.m */,
123-
C91F6A481C62BC0400EB4BA8 /* PestoAvatarView.h */,
124-
C91F6A491C62BC0400EB4BA8 /* PestoAvatarView.m */,
125+
DEA791061C752B74006301CC /* PestoFlexibleHeaderContainerViewController.h */,
126+
DEA791041C752B6A006301CC /* PestoFlexibleHeaderContainerViewController.m */,
125127
C91F6A4E1C63A80F00EB4BA8 /* PestoRemoteImageService.h */,
126128
C91F6A4F1C63A80F00EB4BA8 /* PestoRemoteImageService.m */,
127-
DEA791011C751D00006301CC /* PestoData.h */,
128-
DEA791021C751D0D006301CC /* PestoData.m */,
129+
C9A855291C4EDFAA003CADF7 /* PestoSettingsViewController.h */,
130+
C9A8552A1C4EDFAA003CADF7 /* PestoSettingsViewController.m */,
131+
DE381E3E1C45A9FB00019C1D /* PestoSideView.h */,
132+
DE381E3F1C45A9FB00019C1D /* PestoSideView.m */,
129133
DEBEDF271C3EF5D5004B614B /* Supporting Files */,
130-
DE3620631C73A0710026DF5D /* PestoCollectionViewController.h */,
131-
DE3620641C73A0850026DF5D /* PestoCollectionViewController.m */,
132-
DEA791061C752B74006301CC /* PestoFlexibleHeaderContainerViewController.h */,
133-
DEA791041C752B6A006301CC /* PestoFlexibleHeaderContainerViewController.m */,
134134
);
135135
path = Pesto;
136136
sourceTree = "<group>";

demos/Pesto/Pesto/PestoCollectionViewController.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ - (BOOL)prefersStatusBarHidden {
5555
return YES;
5656
}
5757

58+
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
59+
duration:(NSTimeInterval)duration {
60+
CGRect headerFrame = _flexHeaderContainerVC.headerViewController.headerView.bounds;
61+
_logoView.center = CGPointMake(headerFrame.size.width / 2.f,
62+
headerFrame.size.height / 2.f);
63+
_logoSmallView.center = CGPointMake(headerFrame.size.width / 2.f,
64+
headerFrame.size.height / 2.f);
65+
}
66+
5867
#pragma mark - UICollectionViewDataSource
5968

6069
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView

0 commit comments

Comments
 (0)