Brion VIBBER has uploaded a new change for review. https://gerrit.wikimedia.org/r/88163
Change subject: Category "loading..." message behavior and appearance. ...................................................................... Category "loading..." message behavior and appearance. Now consistent with description's loading message behavior. Change-Id: I507ad02b3776f3448bc9fdc2506b838fd10df634 --- M Commons-iOS/DetailScrollViewController.h M Commons-iOS/DetailScrollViewController.m M Commons-iOS/en.lproj/MainStoryboard.storyboard 3 files changed, 35 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/commons refs/changes/63/88163/1 diff --git a/Commons-iOS/DetailScrollViewController.h b/Commons-iOS/DetailScrollViewController.h index be046a5..c8958f5 100644 --- a/Commons-iOS/DetailScrollViewController.h +++ b/Commons-iOS/DetailScrollViewController.h @@ -44,6 +44,7 @@ @property (weak, nonatomic) IBOutlet UILabel *categoryLabel; @property (weak, nonatomic) IBOutlet UILabel *categoryListLabel; @property (weak, nonatomic) IBOutlet UILabel *addCategoryLabel; +@property (weak, nonatomic) IBOutlet UILabelDynamicHeight *categoryLoadingMsgLabel; @property (weak, nonatomic) IBOutlet UIView *titleContainer; @property (weak, nonatomic) IBOutlet UIView *descriptionContainer; diff --git a/Commons-iOS/DetailScrollViewController.m b/Commons-iOS/DetailScrollViewController.m index 9b3d4dc..9b86d0d 100644 --- a/Commons-iOS/DetailScrollViewController.m +++ b/Commons-iOS/DetailScrollViewController.m @@ -226,6 +226,9 @@ [self configureForSelectedRecord]; [self configureHideKeyboardButton]; + // Apply the style used by category labels to the category "Loading..." placeholder + [self styleCategoryLabel:self.categoryLoadingMsgLabel]; + //[self.view randomlyColorSubviews]; } @@ -407,6 +410,8 @@ // Get categories and description if (record.complete.boolValue) { self.descriptionTextLabel.text = [MWMessage forKey:@"details-description-loading"].text; + self.categoryLoadingMsgLabel.text = [MWMessage forKey:@"details-category-loading"].text; + dispatch_async(dispatch_get_main_queue(), ^(void) { [self getPreviouslySavedDescriptionForRecord:record]; [self getPreviouslySavedCategoriesForRecord:record]; @@ -939,6 +944,9 @@ NSMutableArray *categoryLabels = [[NSMutableArray alloc] init]; + // No longer need the "Loading..." category placeholder + [self.categoryLoadingMsgLabel removeFromSuperview]; + // Every view which gets constrained by this method is also created by this method // with the exeption of self.categoryLabel. This means views created here can be // constrained here without having to worry about a new constraint conflicting with @@ -973,12 +981,7 @@ UILabelDynamicHeight *label = [[UILabelDynamicHeight alloc] initWithFrame:CGRectZero]; label.translatesAutoresizingMaskIntoConstraints = NO; label.text = categoryString; - [label setFont:[UIFont systemFontOfSize:14.0f]]; - label.textColor = [UIColor whiteColor]; - label.backgroundColor = [UIColor clearColor]; - label.borderColor = [UIColor clearColor]; - label.paddingColor = DETAIL_NON_EDITABLE_TEXTBOX_BACKGROUND_COLOR; - [label setPaddingInsets:DETAIL_CATEGORY_PADDING_INSET]; + [self styleCategoryLabel:label]; [self.categoryContainer addSubview:label]; [categoryLabels addObject:label]; @@ -1036,6 +1039,16 @@ [self.categoryContainer layoutIfNeeded]; } +-(void)styleCategoryLabel:(UILabelDynamicHeight *)label +{ + [label setFont:[UIFont systemFontOfSize:14.0f]]; + label.textColor = [UIColor whiteColor]; + label.backgroundColor = [UIColor clearColor]; + label.borderColor = [UIColor clearColor]; + label.paddingColor = DETAIL_NON_EDITABLE_TEXTBOX_BACKGROUND_COLOR; + [label setPaddingInsets:DETAIL_CATEGORY_PADDING_INSET]; +} + - (NSString *)categoryShortList { // Assume the list will be cropped off in the label if it's long. :) diff --git a/Commons-iOS/en.lproj/MainStoryboard.storyboard b/Commons-iOS/en.lproj/MainStoryboard.storyboard index 7b8fefe..cd09b8e 100644 --- a/Commons-iOS/en.lproj/MainStoryboard.storyboard +++ b/Commons-iOS/en.lproj/MainStoryboard.storyboard @@ -1231,8 +1231,8 @@ <rect key="frame" x="0.0" y="0.0" width="320" height="480"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <subviews> - <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ehb-uI-yRM" userLabel="Scroll Container"> - <rect key="frame" x="0.0" y="0.0" width="320" height="506"/> + <view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ehb-uI-yRM" userLabel="Scroll Container"> + <rect key="frame" x="0.0" y="-330" width="320" height="531"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jhZ-zd-ki7" userLabel="Title Container"> @@ -1353,7 +1353,7 @@ </constraints> </view> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fx9-U5-jNG" userLabel="Category Container"> - <rect key="frame" x="20" y="425" width="280" height="61"/> + <rect key="frame" x="20" y="425" width="280" height="86"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <subviews> <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Categories" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="240" translatesAutoresizingMaskIntoConstraints="NO" id="jUg-Wa-cMl"> @@ -1363,13 +1363,23 @@ <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> <nil key="highlightedColor"/> </label> + <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Loading..." lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="240" translatesAutoresizingMaskIntoConstraints="NO" id="dyF-FO-sE1" userLabel="Loading Message Placeholder" customClass="UILabelDynamicHeight"> + <rect key="frame" x="20" y="49" width="240" height="17"/> + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> + <fontDescription key="fontDescription" type="system" pointSize="14"/> + <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> + <nil key="highlightedColor"/> + </label> </subviews> <color key="backgroundColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/> <constraints> <constraint firstItem="jUg-Wa-cMl" firstAttribute="leading" secondItem="fx9-U5-jNG" secondAttribute="leading" constant="20" symbolic="YES" id="Eir-BG-oWC"/> <constraint firstItem="jUg-Wa-cMl" firstAttribute="top" secondItem="fx9-U5-jNG" secondAttribute="top" constant="20" symbolic="YES" id="GuJ-RG-cpo"/> + <constraint firstAttribute="trailing" secondItem="dyF-FO-sE1" secondAttribute="trailing" constant="20" symbolic="YES" id="Gub-aD-Am6"/> + <constraint firstItem="dyF-FO-sE1" firstAttribute="top" secondItem="jUg-Wa-cMl" secondAttribute="bottom" constant="8" symbolic="YES" id="UKZ-ct-1Bc"/> <constraint firstAttribute="trailing" secondItem="jUg-Wa-cMl" secondAttribute="trailing" constant="20" symbolic="YES" id="fbi-kd-6SU"/> - <constraint firstAttribute="bottom" secondItem="jUg-Wa-cMl" secondAttribute="bottom" constant="20" symbolic="YES" id="u19-D6-Yye"/> + <constraint firstItem="dyF-FO-sE1" firstAttribute="leading" secondItem="fx9-U5-jNG" secondAttribute="leading" constant="20" symbolic="YES" id="uxr-TL-Iqy"/> + <constraint firstAttribute="bottom" secondItem="dyF-FO-sE1" secondAttribute="bottom" constant="20" symbolic="YES" id="ytA-ja-q5t"/> </constraints> </view> </subviews> @@ -1404,6 +1414,7 @@ <connections> <outlet property="categoryContainer" destination="fx9-U5-jNG" id="e2I-cl-ZSs"/> <outlet property="categoryLabel" destination="jUg-Wa-cMl" id="8yR-OG-vWN"/> + <outlet property="categoryLoadingMsgLabel" destination="dyF-FO-sE1" id="nwo-Ty-SsO"/> <outlet property="descriptionContainer" destination="ChD-4f-cDJ" id="Kag-oJ-QIL"/> <outlet property="descriptionLabel" destination="CZQ-bf-MDt" id="5Ys-xU-tlY"/> <outlet property="descriptionPlaceholder" destination="7ez-E3-hMg" id="Lmn-FU-s50"/> @@ -1950,8 +1961,6 @@ <image name="mockBadPhoto.png" width="237" height="286"/> <image name="mockPageLogo.png" width="64" height="106"/> <image name="mockPagePhoto.png" width="134" height="103"/> - <image name="photo-button-bg.png" width="72" height="72"/> - <image name="photo-button-bg.png" width="72" height="72"/> <image name="photo-button-bg.png" width="72" height="72"/> <image name="settings.png" width="30" height="30"/> </resources> -- To view, visit https://gerrit.wikimedia.org/r/88163 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I507ad02b3776f3448bc9fdc2506b838fd10df634 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/commons Gerrit-Branch: master Gerrit-Owner: Brion VIBBER <br...@wikimedia.org> Gerrit-Reviewer: Mhurd <mh...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits