Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/134736
Change subject: Update to wikiFont adding temp supplemental ios characters. ...................................................................... Update to wikiFont adding temp supplemental ios characters. Change-Id: I09d42ba0e3deb38aeecc279c3e1109b00a48e302 --- M wikipedia/Base.lproj/Main_iPhone.storyboard M wikipedia/Defines/WMF_WikiFont_Chars.h M wikipedia/Fonts/WikiFont.ttf M wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.h M wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m M wikipedia/View Controllers/Navigation/Top/TopMenuButtonView.h M wikipedia/View Controllers/Navigation/Top/TopMenuButtonView.m M wikipedia/View Controllers/Navigation/Top/TopMenuLabel.m M wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m M wikipedia/View Controllers/WebView/WebViewController.m M wikipedia/Wikipedia-Prefix.pch 11 files changed, 187 insertions(+), 119 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/36/134736/1 diff --git a/wikipedia/Base.lproj/Main_iPhone.storyboard b/wikipedia/Base.lproj/Main_iPhone.storyboard index 21c605a..1fd3ae6 100644 --- a/wikipedia/Base.lproj/Main_iPhone.storyboard +++ b/wikipedia/Base.lproj/Main_iPhone.storyboard @@ -1212,73 +1212,42 @@ <rect key="frame" x="0.0" y="0.0" width="320" height="45"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <subviews> - <button clearsContextBeforeDrawing="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gmW-77-RAG" userLabel="Back Button"> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vRW-Da-kEk" customClass="TopMenuButtonView"> <rect key="frame" x="0.0" y="0.0" width="40" height="45"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <constraints> - <constraint firstAttribute="width" constant="40" id="ltg-Vu-7lf"/> + <constraint firstAttribute="width" constant="40" id="eSx-Bm-x3b"/> </constraints> - <fontDescription key="fontDescription" type="system" pointSize="25"/> - <state key="normal" title="<"> - <color key="titleColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/> - <color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> - </state> - <state key="highlighted"> - <color key="titleColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/> - <color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> - </state> - <connections> - <action selector="backButtonPushed:" destination="d5t-sx-LhF" eventType="touchUpInside" id="K4B-XY-xce"/> - </connections> - </button> - <button clearsContextBeforeDrawing="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KXj-9d-MdS" userLabel="Forward Button"> + </view> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1LN-g3-9sh" customClass="TopMenuButtonView"> <rect key="frame" x="75" y="0.0" width="40" height="45"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <constraints> - <constraint firstAttribute="width" constant="40" id="kvL-ik-fth"/> + <constraint firstAttribute="width" constant="40" id="0ms-jq-E98"/> </constraints> - <fontDescription key="fontDescription" type="system" pointSize="25"/> - <state key="normal" title=">"> - <color key="titleColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/> - <color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> - </state> - <state key="highlighted"> - <color key="titleColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/> - </state> - <connections> - <action selector="forwardButtonPushed:" destination="d5t-sx-LhF" eventType="touchUpInside" id="cu4-hK-1lx"/> - </connections> - </button> - <button clearsContextBeforeDrawing="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" horizontalCompressionResistancePriority="1000" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="e2H-k6-5qC"> - <rect key="frame" x="270" y="0.0" width="45" height="45"/> - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> + </view> + <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dTJ-8C-aMG" customClass="TopMenuButtonView"> + <rect key="frame" x="273" y="0.0" width="40" height="45"/> + <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> + <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <constraints> - <constraint firstAttribute="width" constant="45" id="AXj-Ca-lQS"/> + <constraint firstAttribute="width" constant="40" id="B4b-uF-os6"/> </constraints> - <fontDescription key="fontDescription" type="system" pointSize="19"/> - <state key="normal" title="Aあ"> - <color key="titleColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/> - <color key="titleShadowColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> - </state> - <state key="highlighted"> - <color key="titleColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/> - </state> - <connections> - <action selector="languageButtonPushed:" destination="d5t-sx-LhF" eventType="touchUpInside" id="R2e-pZ-Uhq"/> - </connections> - </button> + </view> </subviews> <color key="backgroundColor" red="0.94117653369903564" green="0.94117653369903564" blue="0.96078437566757202" alpha="1" colorSpace="deviceRGB"/> <constraints> - <constraint firstAttribute="bottom" secondItem="e2H-k6-5qC" secondAttribute="bottom" id="DSh-qh-wMS"/> - <constraint firstItem="e2H-k6-5qC" firstAttribute="top" secondItem="DsV-9G-XpE" secondAttribute="top" id="UFJ-G4-pOw"/> - <constraint firstAttribute="bottom" secondItem="KXj-9d-MdS" secondAttribute="bottom" id="W2q-DW-3OQ"/> - <constraint firstAttribute="bottom" secondItem="gmW-77-RAG" secondAttribute="bottom" id="cnA-Fv-rUl"/> - <constraint firstItem="KXj-9d-MdS" firstAttribute="top" secondItem="DsV-9G-XpE" secondAttribute="top" id="cyU-br-5uV"/> - <constraint firstItem="gmW-77-RAG" firstAttribute="leading" secondItem="DsV-9G-XpE" secondAttribute="leading" id="eb5-R4-JUK"/> - <constraint firstAttribute="trailing" secondItem="e2H-k6-5qC" secondAttribute="trailing" constant="5" id="noR-aN-mQH"/> - <constraint firstItem="KXj-9d-MdS" firstAttribute="leading" secondItem="gmW-77-RAG" secondAttribute="trailing" constant="35" id="rrt-LZ-L3c"/> - <constraint firstItem="gmW-77-RAG" firstAttribute="top" secondItem="DsV-9G-XpE" secondAttribute="top" id="yxh-bL-EOZ"/> + <constraint firstAttribute="trailing" secondItem="dTJ-8C-aMG" secondAttribute="trailing" constant="7" id="T5c-rB-iBA"/> + <constraint firstAttribute="bottom" secondItem="vRW-Da-kEk" secondAttribute="bottom" id="bh8-2r-nQy"/> + <constraint firstItem="1LN-g3-9sh" firstAttribute="top" secondItem="DsV-9G-XpE" secondAttribute="top" id="cu2-vn-L5F"/> + <constraint firstItem="dTJ-8C-aMG" firstAttribute="top" secondItem="DsV-9G-XpE" secondAttribute="top" id="jag-yY-cN5"/> + <constraint firstAttribute="bottom" secondItem="1LN-g3-9sh" secondAttribute="bottom" id="jt2-9M-Dcf"/> + <constraint firstItem="vRW-Da-kEk" firstAttribute="leading" secondItem="DsV-9G-XpE" secondAttribute="leading" id="kZJ-uW-oCc"/> + <constraint firstItem="vRW-Da-kEk" firstAttribute="top" secondItem="DsV-9G-XpE" secondAttribute="top" id="mAv-Id-6e5"/> + <constraint firstAttribute="bottom" secondItem="dTJ-8C-aMG" secondAttribute="bottom" id="uOO-UR-7Uy"/> + <constraint firstItem="1LN-g3-9sh" firstAttribute="leading" secondItem="vRW-Da-kEk" secondAttribute="trailing" constant="35" id="z9L-9f-gTj"/> </constraints> </view> </subviews> @@ -1291,9 +1260,9 @@ </constraints> </view> <connections> - <outlet property="backButton" destination="gmW-77-RAG" id="cdh-Qo-UQp"/> - <outlet property="forwardButton" destination="KXj-9d-MdS" id="o7V-g1-3jc"/> - <outlet property="langButton" destination="e2H-k6-5qC" id="a6z-C4-lLX"/> + <outlet property="backButton" destination="vRW-Da-kEk" id="SNT-09-dNr"/> + <outlet property="forwardButton" destination="1LN-g3-9sh" id="4Ts-r9-JbR"/> + <outlet property="rightButton" destination="dTJ-8C-aMG" id="lCN-IZ-ZJZ"/> </connections> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="heC-Be-Fgw" userLabel="First Responder" sceneMemberID="firstResponder"/> diff --git a/wikipedia/Defines/WMF_WikiFont_Chars.h b/wikipedia/Defines/WMF_WikiFont_Chars.h index b2eebb7..50ab7b0 100644 --- a/wikipedia/Defines/WMF_WikiFont_Chars.h +++ b/wikipedia/Defines/WMF_WikiFont_Chars.h @@ -159,3 +159,14 @@ /* WIKI_X e900 */ #define WIKIFONT_CHAR_WIKITRAIL @"\ue900" + + + +/* IOS TEMP SUPPLEMENT e950 */ + +#define WIKIFONT_CHAR_IOS_W @"\ue950" +#define WIKIFONT_CHAR_IOS_TOC @"\ue951" +#define WIKIFONT_CHAR_IOS_SHARE @"\ue952" +#define WIKIFONT_CHAR_IOS_MAGNIFY @"\ue953" +#define WIKIFONT_CHAR_IOS_FORWARD @"\ue954" +#define WIKIFONT_CHAR_IOS_BACKWARD @"\ue955" diff --git a/wikipedia/Fonts/WikiFont.ttf b/wikipedia/Fonts/WikiFont.ttf old mode 100755 new mode 100644 index b8b40d4..ab851d0 --- a/wikipedia/Fonts/WikiFont.ttf +++ b/wikipedia/Fonts/WikiFont.ttf Binary files differ diff --git a/wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.h b/wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.h index fe1d3fb..8a8c91f 100644 --- a/wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.h +++ b/wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.h @@ -5,6 +5,6 @@ @interface BottomMenuViewController : UIViewController --(void)updateBottomBarButtonsEnabledStateWithLangCount:(NSNumber *)langCount; +-(void)updateBottomBarButtonsEnabledState; @end diff --git a/wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m b/wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m index 11b1082..29602ef 100644 --- a/wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m +++ b/wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m @@ -8,15 +8,27 @@ #import "UINavigationController+SearchNavStack.h" #import "SessionSingleton.h" #import "NSManagedObjectContext+SimpleFetch.h" -#import "LanguagesTableVC.h" +#import "WMF_WikiFont_Chars.h" +#import "TopMenuButtonView.h" +#import "TopMenuLabel.h" +#import "UIViewController+Alert.h" + +typedef NS_ENUM(NSInteger, BottomMenuItemTag) { + BOTTOM_MENU_BUTTON_UNKNOWN = 0, + BOTTOM_MENU_BUTTON_PREVIOUS = 1, + BOTTOM_MENU_BUTTON_NEXT = 2, + BOTTOM_MENU_BUTTON_SHARE = 3 +}; @interface BottomMenuViewController () -@property (weak, nonatomic) IBOutlet UIButton *backButton; -@property (weak, nonatomic) IBOutlet UIButton *forwardButton; -@property (weak, nonatomic) IBOutlet UIButton *langButton; +@property (weak, nonatomic) IBOutlet TopMenuButtonView *backButton; +@property (weak, nonatomic) IBOutlet TopMenuButtonView *forwardButton; +@property (weak, nonatomic) IBOutlet TopMenuButtonView *rightButton; @property (strong, nonatomic) NSDictionary *adjacentHistoryIDs; + +@property (strong, nonatomic) NSArray *allButtons; @end @@ -32,13 +44,61 @@ // Do any additional setup after loading the view. articleDataContext_ = [ArticleDataContextSingleton sharedInstance]; + + [self.backButton.label setWikiText:WIKIFONT_CHAR_IOS_BACKWARD]; + self.backButton.tag = BOTTOM_MENU_BUTTON_PREVIOUS; + + [self.forwardButton.label setWikiText:WIKIFONT_CHAR_IOS_FORWARD]; + self.forwardButton.tag = BOTTOM_MENU_BUTTON_NEXT; + + [self.rightButton.label setWikiText:WIKIFONT_CHAR_IOS_SHARE]; + self.rightButton.tag = BOTTOM_MENU_BUTTON_SHARE; + + self.allButtons = @[self.backButton, self.forwardButton, self.rightButton]; + + [self addTapRecognizersToAllButtons]; +} + +-(void)addTapRecognizersToAllButtons +{ + for (TopMenuButtonView *view in self.allButtons) { + [view addGestureRecognizer: + [[UITapGestureRecognizer alloc] initWithTarget: self + action: @selector(buttonPushed:)]]; + } } #pragma mark Bottom bar button methods //TODO: Pull bottomBarView and into own object (and its subviews - the back and forward view/buttons/methods, etc). -- (IBAction)backButtonPushed:(id)sender +- (void)buttonPushed:(UITapGestureRecognizer *)sender +{ + TopMenuButtonView *tappedButton = (TopMenuButtonView *)sender.view; + if (!tappedButton.enabled)return; + + switch (tappedButton.tag) { + case BOTTOM_MENU_BUTTON_PREVIOUS: + [self backButtonPushed]; + break; + case BOTTOM_MENU_BUTTON_NEXT: + [self forwardButtonPushed]; + break; + case BOTTOM_MENU_BUTTON_SHARE: + [self shareButtonPushed]; + break; + default: + break; + } +} + +- (void)shareButtonPushed +{ + [self showAlert:@"TODO: hook up share sheet!"]; + [self fadeAlert]; +} + +- (void)backButtonPushed { NSManagedObjectID *historyId = self.adjacentHistoryIDs[@"before"]; if (historyId){ @@ -53,7 +113,7 @@ } } -- (IBAction)forwardButtonPushed:(id)sender +- (void)forwardButtonPushed { NSManagedObjectID *historyId = self.adjacentHistoryIDs[@"after"]; if (historyId){ @@ -116,49 +176,11 @@ return result; } --(void)updateBottomBarButtonsEnabledStateWithLangCount:(NSNumber *)langCount +-(void)updateBottomBarButtonsEnabledState { self.adjacentHistoryIDs = [self getAdjacentHistoryIDs]; self.forwardButton.enabled = (self.adjacentHistoryIDs[@"after"]) ? YES : NO; self.backButton.enabled = (self.adjacentHistoryIDs[@"before"]) ? YES : NO; - - if ([[SessionSingleton sharedInstance] isCurrentArticleMain]) { - // Disable the article languages buttons if this is the main page. - self.langButton.enabled = NO; - }else{ - self.langButton.enabled = (langCount.integerValue > 1) ? YES : NO; - } -} - -- (IBAction)languageButtonPushed:(id)sender -{ - [self showLanguages]; -} - --(void)showLanguages -{ - LanguagesTableVC *languagesTableVC = - [NAV.storyboard instantiateViewControllerWithIdentifier:@"LanguagesTableVC"]; - - languagesTableVC.downloadLanguagesForCurrentArticle = YES; - - CATransition *transition = [languagesTableVC getTransition]; - - languagesTableVC.selectionBlock = ^(NSDictionary *selectedLangInfo){ - - [NAV.view.layer addAnimation:transition forKey:nil]; - // Don't animate - so the transistion set above will be used. - [NAV loadArticleWithTitle: selectedLangInfo[@"*"] - domain: selectedLangInfo[@"code"] - animated: NO - discoveryMethod: DISCOVERY_METHOD_SEARCH - invalidatingCache: NO]; - }; - - [NAV.view.layer addAnimation:transition forKey:nil]; - - // Don't animate - so the transistion set above will be used. - [NAV pushViewController:languagesTableVC animated:NO]; } - (void)didReceiveMemoryWarning diff --git a/wikipedia/View Controllers/Navigation/Top/TopMenuButtonView.h b/wikipedia/View Controllers/Navigation/Top/TopMenuButtonView.h index da3e95a..c844d53 100644 --- a/wikipedia/View Controllers/Navigation/Top/TopMenuButtonView.h +++ b/wikipedia/View Controllers/Navigation/Top/TopMenuButtonView.h @@ -11,4 +11,6 @@ @property (strong, nonatomic) UIColor *color; +@property (nonatomic) BOOL enabled; + @end diff --git a/wikipedia/View Controllers/Navigation/Top/TopMenuButtonView.m b/wikipedia/View Controllers/Navigation/Top/TopMenuButtonView.m index d73c7e0..eff696c 100644 --- a/wikipedia/View Controllers/Navigation/Top/TopMenuButtonView.m +++ b/wikipedia/View Controllers/Navigation/Top/TopMenuButtonView.m @@ -6,17 +6,32 @@ @implementation TopMenuButtonView +- (instancetype)initWithCoder:(NSCoder *)coder +{ + self = [super initWithCoder:coder]; + if (self) { + [self setup]; + } + return self; +} + - (instancetype)init { self = [super init]; if (self) { - self.clipsToBounds = YES; - self.label = [[TopMenuLabel alloc] init]; - self.label.translatesAutoresizingMaskIntoConstraints = NO; - [self addSubview:self.label]; - [self constrainLabel]; + [self setup]; } return self; +} + +-(void)setup +{ + self.enabled = YES; + self.clipsToBounds = YES; + self.label = [[TopMenuLabel alloc] init]; + self.label.translatesAutoresizingMaskIntoConstraints = NO; + [self addSubview:self.label]; + [self constrainLabel]; } -(void)setColor:(UIColor *)color @@ -24,6 +39,12 @@ [self.label setTextColor:color]; } +-(void)setEnabled:(BOOL)enabled +{ + _enabled = enabled; + self.alpha = (enabled) ? 1.0 : 0.5; +} + -(void)constrainLabel { NSDictionary *metrics = @{ diff --git a/wikipedia/View Controllers/Navigation/Top/TopMenuLabel.m b/wikipedia/View Controllers/Navigation/Top/TopMenuLabel.m index b79e8bb..f922c37 100644 --- a/wikipedia/View Controllers/Navigation/Top/TopMenuLabel.m +++ b/wikipedia/View Controllers/Navigation/Top/TopMenuLabel.m @@ -5,17 +5,31 @@ @implementation TopMenuLabel +- (instancetype)initWithCoder:(NSCoder *)coder +{ + self = [super initWithCoder:coder]; + if (self) { + [self setup]; + } + return self; +} + - (instancetype)init { self = [super init]; if (self) { - self.textAlignment = NSTextAlignmentCenter; - self.adjustsFontSizeToFitWidth = YES; - self.backgroundColor = [UIColor clearColor]; + [self setup]; } return self; } +-(void)setup +{ + self.textAlignment = NSTextAlignmentCenter; + self.adjustsFontSizeToFitWidth = YES; + self.backgroundColor = [UIColor clearColor]; +} + -(void)setWikiText:(NSString *)text { NSDictionary *attributes = diff --git a/wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m b/wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m index 6772d36..3cadb0b 100644 --- a/wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m +++ b/wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m @@ -308,9 +308,9 @@ self.buttonEye = getButton(WIKIFONT_CHAR_EYE, NAVBAR_BUTTON_EYE); self.buttonArrowLeft = getButton(WIKIFONT_CHAR_ARROW_LEFT, NAVBAR_BUTTON_ARROW_LEFT); self.buttonArrowRight = getButton(WIKIFONT_CHAR_ARROW_LEFT, NAVBAR_BUTTON_ARROW_RIGHT); - self.buttonW = getButton(WIKIFONT_CHAR_W, NAVBAR_BUTTON_LOGO_W); - self.buttonTOC = getButton(WIKIFONT_CHAR_STRIPE_TOC, NAVBAR_BUTTON_TOC); - self.buttonMagnify = getButton(WIKIFONT_CHAR_MAGNIFYING_GLASS, NAVBAR_BUTTON_MAGNIFY); + self.buttonW = getButton(WIKIFONT_CHAR_IOS_W, NAVBAR_BUTTON_LOGO_W); + self.buttonTOC = getButton(WIKIFONT_CHAR_IOS_TOC, NAVBAR_BUTTON_TOC); + self.buttonMagnify = getButton(WIKIFONT_CHAR_IOS_MAGNIFY, NAVBAR_BUTTON_MAGNIFY); self.buttonBlank = getButton(@"", NAVBAR_BUTTON_BLANK); self.buttonCancel = getButton(@"", NAVBAR_BUTTON_CANCEL); diff --git a/wikipedia/View Controllers/WebView/WebViewController.m b/wikipedia/View Controllers/WebView/WebViewController.m index 0c3161a..9bde147 100644 --- a/wikipedia/View Controllers/WebView/WebViewController.m +++ b/wikipedia/View Controllers/WebView/WebViewController.m @@ -45,6 +45,7 @@ #import "BottomMenuViewController.h" #import "TopMenuButtonView.h" #import "TopMenuLabel.h" +#import "LanguagesTableVC.h" #define TOC_TOGGLE_ANIMATION_DURATION @0.3f @@ -1269,7 +1270,7 @@ NSNumber *langCount = article.languagecount; - [self.bottomMenuViewController updateBottomBarButtonsEnabledStateWithLangCount:langCount]; + [self.bottomMenuViewController updateBottomBarButtonsEnabledState]; [ROOT.topMenuViewController updateTOCButtonVisibility]; @@ -1638,4 +1639,32 @@ self.webView.scrollView.scrollIndicatorInsets = insets; } +#pragma mark Languages + +-(void)languageButtonPushed +{ + LanguagesTableVC *languagesTableVC = + [NAV.storyboard instantiateViewControllerWithIdentifier:@"LanguagesTableVC"]; + + languagesTableVC.downloadLanguagesForCurrentArticle = YES; + + CATransition *transition = [languagesTableVC getTransition]; + + languagesTableVC.selectionBlock = ^(NSDictionary *selectedLangInfo){ + + [NAV.view.layer addAnimation:transition forKey:nil]; + // Don't animate - so the transistion set above will be used. + [NAV loadArticleWithTitle: selectedLangInfo[@"*"] + domain: selectedLangInfo[@"code"] + animated: NO + discoveryMethod: DISCOVERY_METHOD_SEARCH + invalidatingCache: NO]; + }; + + [NAV.view.layer addAnimation:transition forKey:nil]; + + // Don't animate - so the transistion set above will be used. + [NAV pushViewController:languagesTableVC animated:NO]; +} + @end diff --git a/wikipedia/Wikipedia-Prefix.pch b/wikipedia/Wikipedia-Prefix.pch index 685eb2b..52ab2ae 100644 --- a/wikipedia/Wikipedia-Prefix.pch +++ b/wikipedia/Wikipedia-Prefix.pch @@ -24,5 +24,5 @@ #import "RootViewController.h" #import "CenterNavController.h" -#define ROOT ((RootViewController *)[UIApplication sharedApplication].delegate.window.rootViewController) -#define NAV (ROOT.centerNavController) +#define ROOT ( (RootViewController *)[UIApplication sharedApplication].delegate.window.rootViewController ) +#define NAV ( ROOT.centerNavController ) -- To view, visit https://gerrit.wikimedia.org/r/134736 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I09d42ba0e3deb38aeecc279c3e1109b00a48e302 Gerrit-PatchSet: 1 Gerrit-Project: apps/ios/wikipedia Gerrit-Branch: master Gerrit-Owner: Mhurd <mh...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits