From a718f8ba81a05682d3d80772a3bebf9e5109a877 Mon Sep 17 00:00:00 2001 From: zhangbin Date: Wed, 24 Jul 2013 15:29:54 +0800 Subject: [PATCH] Resolve the bug : login UI of 360 & UC can't be landscape. --- plugin/plugins/qh360/proj.android/ForManifest.xml | 1 + .../src/org/cocos2dx/plugin/QH360Wrapper.java | 8 ++++---- .../proj.android/src/org/cocos2dx/plugin/UCWrapper.java | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/plugin/plugins/qh360/proj.android/ForManifest.xml b/plugin/plugins/qh360/proj.android/ForManifest.xml index d7f0c9bc34..a9d5ffdec2 100644 --- a/plugin/plugins/qh360/proj.android/ForManifest.xml +++ b/plugin/plugins/qh360/proj.android/ForManifest.xml @@ -16,6 +16,7 @@ +  diff --git a/plugin/plugins/qh360/proj.android/src/org/cocos2dx/plugin/QH360Wrapper.java b/plugin/plugins/qh360/proj.android/src/org/cocos2dx/plugin/QH360Wrapper.java index 6f2365b975..2181036f02 100644 --- a/plugin/plugins/qh360/proj.android/src/org/cocos2dx/plugin/QH360Wrapper.java +++ b/plugin/plugins/qh360/proj.android/src/org/cocos2dx/plugin/QH360Wrapper.java @@ -63,13 +63,13 @@ public class QH360Wrapper { Configuration config = ctx.getResources().getConfiguration(); int orientation = config.orientation; - if (orientation != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE || - orientation != ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) + if (orientation != Configuration.ORIENTATION_LANDSCAPE && + orientation != Configuration.ORIENTATION_PORTRAIT) { - orientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; + orientation = Configuration.ORIENTATION_PORTRAIT; } - return (orientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); + return (orientation == Configuration.ORIENTATION_LANDSCAPE); } private static boolean mLogined = false; diff --git a/plugin/plugins/uc/proj.android/src/org/cocos2dx/plugin/UCWrapper.java b/plugin/plugins/uc/proj.android/src/org/cocos2dx/plugin/UCWrapper.java index a519688b3f..f6b011d501 100644 --- a/plugin/plugins/uc/proj.android/src/org/cocos2dx/plugin/UCWrapper.java +++ b/plugin/plugins/uc/proj.android/src/org/cocos2dx/plugin/UCWrapper.java @@ -109,13 +109,13 @@ public class UCWrapper { Configuration config = ctx.getResources().getConfiguration(); int orientation = config.orientation; - if (orientation != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE || - orientation != ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) + if (orientation != Configuration.ORIENTATION_LANDSCAPE && + orientation != Configuration.ORIENTATION_PORTRAIT) { - orientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; + orientation = Configuration.ORIENTATION_PORTRAIT; } - return (orientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); + return (orientation == Configuration.ORIENTATION_LANDSCAPE); } public static String getSDKVersion() {