You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by bo...@apache.org on 2017/06/29 07:32:31 UTC

incubator-weex git commit: * [ios] support iPad when screen rotation

Repository: incubator-weex
Updated Branches:
  refs/heads/0.15-dev 7a2337ee8 -> db640768c


* [ios] support iPad when screen rotation


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/db640768
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/db640768
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/db640768

Branch: refs/heads/0.15-dev
Commit: db640768cfb677543bc983e80f4106e7640ac2d3
Parents: 7a2337e
Author: acton393 <zh...@gmail.com>
Authored: Thu Jun 29 14:35:03 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Thu Jun 29 14:35:03 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Utility/WXUtility.h |  2 --
 ios/sdk/WeexSDK/Sources/Utility/WXUtility.m | 15 ++++++---------
 2 files changed, 6 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/db640768/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h
index 2c8a7b4..715617d 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.h
@@ -113,8 +113,6 @@ extern _Nonnull SEL WXSwizzledSelectorForSelector(_Nonnull SEL selector);
 
 + (void)performBlock:(void (^_Nonnull)())block onThread:(NSThread *_Nonnull)thread;
 
-+ (void)setNotStat:(BOOL)notStat;
-+ (BOOL)notStat;
 /**
  * @abstract Returns the environment of current application, you can get some necessary properties such as appVersion、sdkVersion、appName etc.
  *

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/db640768/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
index 766a353..fed8f0a 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXUtility.m
@@ -133,7 +133,6 @@ CGFloat WXFloorPixelValue(CGFloat value)
     return floor(value * scale) / scale;
 }
 
-static BOOL WXNotStat;
 @implementation WXUtility
 
 + (void)performBlock:(void (^)())block onThread:(NSThread *)thread
@@ -655,6 +654,9 @@ static BOOL WXNotStat;
 
 + (CGSize)portraitScreenSize
 {
+    if ([[UIDevice currentDevice].model isEqualToString:@"iPad"]) {
+        return [UIScreen mainScreen].bounds.size;
+    }
     static CGSize portraitScreenSize;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
@@ -668,6 +670,9 @@ static BOOL WXNotStat;
 
 + (CGFloat)defaultPixelScaleFactor
 {
+    if ([[UIDevice currentDevice].model isEqualToString:@"iPad"]) {
+        return [self portraitScreenSize].width / WXDefaultScreenWidth;
+    }
     static CGFloat defaultScaleFactor;
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
@@ -740,14 +745,6 @@ static BOOL WXNotStat;
     SecItemDelete((CFDictionaryRef)keychainQuery);
 }
 
-+ (void)setNotStat:(BOOL)notStat {
-    WXNotStat = YES;
-}
-
-+ (BOOL)notStat {
-    return WXNotStat;
-}
-
 + (NSURL *)urlByDeletingParameters:(NSURL *)url
 {
     NSURLComponents *components = [NSURLComponents componentsWithURL:url resolvingAgainstBaseURL:YES];