Bgerstle has uploaded a new change for review. https://gerrit.wikimedia.org/r/216903
Change subject: fix visual & fnl lang picker regressions ...................................................................... fix visual & fnl lang picker regressions - Language filtering (filter both localized lang name & autonym) - Rounded edit pencil in webview footer - Bottom spacing of webview footer (restored 30-top & 35-bottom space constraints) Bug: T97780 Change-Id: Idff071211a9ed17a8f7c74c06f03baad714481cd --- M Wikipedia/Categories/UIView+WMFRoundCorners.h M Wikipedia/Categories/UIView+WMFRoundCorners.m M Wikipedia/View Controllers/Languages/LanguagesViewController.m M Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.m M Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.xib M Wikipedia/View Controllers/WebView/WebViewController.m 6 files changed, 27 insertions(+), 23 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/03/216903/1 diff --git a/Wikipedia/Categories/UIView+WMFRoundCorners.h b/Wikipedia/Categories/UIView+WMFRoundCorners.h index e657532..9e2cf19 100644 --- a/Wikipedia/Categories/UIView+WMFRoundCorners.h +++ b/Wikipedia/Categories/UIView+WMFRoundCorners.h @@ -5,6 +5,14 @@ @interface UIView (WMF_RoundCorners) +/// Round all corners of the receiver, making it circular. +- (void)wmf_roundCorners; + +/** + * Round the given corners of the receiver. + * @param corners The corners to apply rounding to. + * @param radius The radius to apply to @c corners. + */ - (void)wmf_roundCorners:(UIRectCorner)corners toRadius:(float)radius; @end diff --git a/Wikipedia/Categories/UIView+WMFRoundCorners.m b/Wikipedia/Categories/UIView+WMFRoundCorners.m index 66e3e4c..4053d50 100644 --- a/Wikipedia/Categories/UIView+WMFRoundCorners.m +++ b/Wikipedia/Categories/UIView+WMFRoundCorners.m @@ -5,9 +5,11 @@ @implementation UIView (WMF_RoundCorners) -- (void)wmf_roundCorners:(UIRectCorner)corners toRadius:(float)radius { // Use for rounding *specific* corners of a UIView. - // Based on http://stackoverflow.com/a/5826745/135557 +- (void)wmf_roundCorners { + self.layer.cornerRadius = self.frame.size.width / 2.f; +} +- (void)wmf_roundCorners:(UIRectCorner)corners toRadius:(float)radius { UIBezierPath* maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:corners cornerRadii:CGSizeMake(radius, radius)]; diff --git a/Wikipedia/View Controllers/Languages/LanguagesViewController.m b/Wikipedia/View Controllers/Languages/LanguagesViewController.m index e33a098..b051f7d 100644 --- a/Wikipedia/View Controllers/Languages/LanguagesViewController.m +++ b/Wikipedia/View Controllers/Languages/LanguagesViewController.m @@ -147,9 +147,9 @@ } else { filteredLanguages = [self.languagesData bk_select:^BOOL (NSDictionary* lang) { // TODO: use proper model object and refactor this into an instance method - return [lang[@"name"] wmf_isEqualToStringIgnoringCase:self.filterString] + return [lang[@"name"] wmf_caseInsensitiveContainsString:self.filterString] || [lang[@"canonical_name"] wmf_caseInsensitiveContainsString:self.filterString] - || [lang[@"code"] wmf_isEqualToStringIgnoringCase:self.filterString]; + || [lang[@"code"] wmf_caseInsensitiveContainsString:self.filterString]; }]; } @@ -167,8 +167,7 @@ return ![preferredLanguagesSection.languages containsObject:evaluatedObject]; }]]; - self.sections = [@[preferredLanguagesSection, otherLanguagesSection] -bk_select:^BOOL (LanguagesTableSectionViewModel* section) { + self.sections = [@[preferredLanguagesSection, otherLanguagesSection] bk_select :^BOOL (LanguagesTableSectionViewModel* section) { return section.languages.count > 0; }]; diff --git a/Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.m b/Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.m index 88102ec..ecc9624 100644 --- a/Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.m +++ b/Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.m @@ -13,6 +13,7 @@ #import "UIColor+WMFHexColor.h" #import "UIViewController+ModalPresent.h" //#import "UIView+Debugging.h" +#import "UIView+WMFRoundCorners.h" #pragma mark Font sizes @@ -48,21 +49,15 @@ - (void)viewDidLoad { [super viewDidLoad]; - - [self adjustConstraintsScaleForViews: - @[self.lastModGlyphLabel, self.lastModLabel]]; - - //[self.view randomlyColorSubviews]; -} - -- (void)viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; + [self adjustConstraintsScaleForViews:@[self.lastModGlyphLabel, self.lastModLabel]]; [self roundGlyphButtonCorners]; + //[self.view randomlyColorSubviews]; } #pragma mark Style - (void)roundGlyphButtonCorners { + [self.lastModGlyphLabel wmf_roundCorners]; self.lastModGlyphLabel.clipsToBounds = YES; } diff --git a/Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.xib b/Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.xib index f4606c8..69ff8c7 100644 --- a/Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.xib +++ b/Wikipedia/View Controllers/WebView/Footer/SubFooters/Options/WMFOptionsFooterViewController.xib @@ -14,14 +14,14 @@ </placeholder> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> - <rect key="frame" x="0.0" y="0.0" width="441" height="125"/> + <rect key="frame" x="0.0" y="0.0" width="441" height="152"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="co2-1E-fU5"> - <rect key="frame" x="20" y="20" width="401" height="85"/> + <rect key="frame" x="20" y="30" width="401" height="87"/> <subviews> <label opaque="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zuf-2Y-bSx" userLabel="Last Modified Glyph Label" customClass="WikiGlyphLabel"> - <rect key="frame" x="8" y="21" width="43" height="43"/> + <rect key="frame" x="8" y="22" width="43" height="43"/> <gestureRecognizers/> <constraints> <constraint firstAttribute="height" constant="43" id="DBA-Ac-KZs"/> @@ -35,7 +35,7 @@ </connections> </label> <label opaque="NO" contentMode="left" horizontalHuggingPriority="252" text="" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GB1-DG-j0o" userLabel="Last Modified Label" customClass="PaddedLabel"> - <rect key="frame" x="60" y="21" width="333" height="40"/> + <rect key="frame" x="60" y="22" width="333" height="40"/> <gestureRecognizers/> <constraints> <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="40" id="E8z-Uj-bM6"/> @@ -72,13 +72,13 @@ </subviews> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <constraints> - <constraint firstItem="co2-1E-fU5" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="20" symbolic="YES" id="7u2-fw-zub"/> + <constraint firstItem="co2-1E-fU5" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="30" id="7u2-fw-zub"/> <constraint firstAttribute="centerX" secondItem="co2-1E-fU5" secondAttribute="centerX" id="Bgf-PO-lPh"/> <constraint firstItem="co2-1E-fU5" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="8" id="KFy-wE-jKj"/> <constraint firstAttribute="centerY" secondItem="co2-1E-fU5" secondAttribute="centerY" id="OBS-sa-54Z"/> <constraint firstItem="co2-1E-fU5" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" constant="20" symbolic="YES" id="TzX-mO-bVl"/> <constraint firstAttribute="centerX" secondItem="co2-1E-fU5" secondAttribute="centerX" id="U9e-2t-vJb"/> - <constraint firstAttribute="bottom" secondItem="co2-1E-fU5" secondAttribute="bottom" constant="20" symbolic="YES" id="ehD-Kr-PJd"/> + <constraint firstAttribute="bottom" secondItem="co2-1E-fU5" secondAttribute="bottom" constant="35" id="ehD-Kr-PJd"/> <constraint firstAttribute="trailing" secondItem="co2-1E-fU5" secondAttribute="trailing" constant="20" symbolic="YES" id="jeb-OZ-48i"/> <constraint firstAttribute="trailing" secondItem="co2-1E-fU5" secondAttribute="trailing" constant="6" id="xfd-uC-2hW"/> </constraints> @@ -88,11 +88,12 @@ <mask key="constraints"> <exclude reference="Bgf-PO-lPh"/> <exclude reference="KFy-wE-jKj"/> + <exclude reference="OBS-sa-54Z"/> <exclude reference="U9e-2t-vJb"/> <exclude reference="xfd-uC-2hW"/> </mask> </variation> - <point key="canvasLocation" x="347.5" y="286.5"/> + <point key="canvasLocation" x="177.5" y="273"/> </view> <tapGestureRecognizer id="Ixc-vZ-ad3"> <connections> diff --git a/Wikipedia/View Controllers/WebView/WebViewController.m b/Wikipedia/View Controllers/WebView/WebViewController.m index 28663f4..e630366 100644 --- a/Wikipedia/View Controllers/WebView/WebViewController.m +++ b/Wikipedia/View Controllers/WebView/WebViewController.m @@ -1726,7 +1726,6 @@ if (!self.session.currentArticle.isMain) { NSString* lastModifiedByUserName = (lastModifiedBy && !lastModifiedBy.anonymous) ? lastModifiedBy.name : nil; -// [self.footerViewController updateLanguageCount:langCount]; [self.footerViewController updateLastModifiedDate:lastModified userName:lastModifiedByUserName]; [self.footerViewController updateReadMoreForArticle:article]; [self.footerViewController updateLegalFooterLocalizedText]; -- To view, visit https://gerrit.wikimedia.org/r/216903 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idff071211a9ed17a8f7c74c06f03baad714481cd Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Bgerstle <bgers...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits