Brion VIBBER has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/88776


Change subject: Fixes for details fullscreen toggle.
......................................................................

Fixes for details fullscreen toggle.

Change-Id: I9cbdc9659ac96fd783f88bad420f25ce729a724d
---
M Commons-iOS/DetailScrollViewController.m
1 file changed, 10 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/ios/commons 
refs/changes/76/88776/1

diff --git a/Commons-iOS/DetailScrollViewController.m 
b/Commons-iOS/DetailScrollViewController.m
index 7cb309c..8b4f908 100644
--- a/Commons-iOS/DetailScrollViewController.m
+++ b/Commons-iOS/DetailScrollViewController.m
@@ -1336,28 +1336,28 @@
 -(void)toggle
 {
     // Hides/shows both the details view and the nav bar
-    static float detailsY = 0.0f;
+    static float percent = 0.0f;
     static BOOL isAnimating = NO;
     if (isAnimating) return;
-    if(self.navigationController.navigationBar.alpha == 1.0f){
+    if(!self.navigationController.navigationBar.hidden){
         self.view.userInteractionEnabled = NO;
-        self.navigationController.navigationBar.alpha = 0.0f;
-        detailsY = self.view.frame.origin.y;
-        float offset = self.view.superview.frame.size.height - detailsY;
+        [self.navigationController setNavigationBarHidden:YES animated:YES];
+        [[UIApplication sharedApplication] setStatusBarHidden:YES 
withAnimation:UIStatusBarAnimationSlide];
+        percent = (self.view.frame.origin.y / 
(self.view.superview.frame.size.height + 0.00001f)) * 100.0f;
         isAnimating = YES;
-        [self scrollByAmount:offset withDuration:0.25f delay:0.0f 
options:UIViewAnimationCurveEaseOut useXF:NO then:^{
+        [self scrollToPercentOfSuperview:100 then:^{
             self.view.alpha = 0.0f;
             isAnimating = NO;
         }];
         [self hideKeyboard];
     }else{
         self.view.userInteractionEnabled = YES;
-        self.navigationController.navigationBar.alpha = 1.0f;
+        [[UIApplication sharedApplication] setStatusBarHidden:NO 
withAnimation:UIStatusBarAnimationSlide];
+        [self.navigationController setNavigationBarHidden:NO animated:YES];
         self.view.alpha = 1.0f;
-        float offset = self.view.frame.origin.y - detailsY;
         isAnimating = YES;
-        [self scrollByAmount:-offset withDuration:0.25f delay:0.0f 
options:UIViewAnimationCurveEaseOut useXF:NO then:^{
-          //[self ensureScrollingDoesNotExceedThreshold];
+        [self scrollToPercentOfSuperview:percent then:^{
+            //[self ensureScrollingDoesNotExceedThreshold];
             isAnimating = NO;
         }];
     }

-- 
To view, visit https://gerrit.wikimedia.org/r/88776
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9cbdc9659ac96fd783f88bad420f25ce729a724d
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

Reply via email to