author | lyra.lee <lyra.lee@amlogic.com> | 2011-07-28 08:50:23 (GMT) |
---|---|---|
committer | lyra.lee <lyra.lee@amlogic.com> | 2011-07-28 08:50:23 (GMT) |
commit | f53f3f048aae826cb8bb6119ef3a4cb7a84b241d (patch) | |
tree | 32d4d92d419fb52067808fe8d0232292ba61c070 | |
parent | 4fe00c2f1410d458b16f8e25311825390638c292 (diff) | |
download | RemoteIME-f53f3f048aae826cb8bb6119ef3a4cb7a84b241d.zip RemoteIME-f53f3f048aae826cb8bb6119ef3a4cb7a84b241d.tar.gz RemoteIME-f53f3f048aae826cb8bb6119ef3a4cb7a84b241d.tar.bz2 |
adjust size and positin in 720p
-rwxr-xr-x | src/com/amlogic/inputmethod/remote/Environment.java | 29 | ||||
-rwxr-xr-x | src/com/amlogic/inputmethod/remote/RemoteIME.java | 13 | ||||
-rwxr-xr-x | src/com/amlogic/inputmethod/remote/SkbContainer.java | 2 |
3 files changed, 39 insertions, 5 deletions
diff --git a/src/com/amlogic/inputmethod/remote/Environment.java b/src/com/amlogic/inputmethod/remote/Environment.java index 01d2fd5..45ad425 100755 --- a/src/com/amlogic/inputmethod/remote/Environment.java +++ b/src/com/amlogic/inputmethod/remote/Environment.java @@ -16,9 +16,15 @@ package com.amlogic.inputmethod.remote; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; + import android.content.Context; import android.content.res.Configuration; import android.os.SystemProperties; +import android.util.Log; import android.view.Display; import android.view.ViewGroup; import android.view.WindowManager; @@ -118,8 +124,12 @@ public class Environment { } public void onConfigurationChanged(Configuration newConfig, Context context) { - if (mConfig.orientation != newConfig.orientation) { - if (SystemProperties.get("ro.product.device", "m1ref").equals("m1ref")){ + // if (mConfig.orientation != newConfig.orientation) { + Log.d("InputMethodService", + "onConfigurationChange: isM1 = "+SystemProperties.get("ro.product.device", "m1ref").equals("m1ref") + + ", is720p = "+is720P()); + + if (SystemProperties.get("ro.product.device", "m1ref").equals("m1ref") && is720P()){ mScreenWidth = 1280; mScreenHeight = 720; } @@ -147,7 +157,7 @@ public class Environment { mFunctionBalloonTextSize = (int) (scale * FUNCTION_BALLOON_TEXT_SIZE_RATIO); mKeyBalloonWidthPlus = (int) (scale * KEY_BALLOON_WIDTH_PLUS_RATIO); mKeyBalloonHeightPlus = (int) (scale * KEY_BALLOON_HEIGHT_PLUS_RATIO); - } + // } mConfig.updateFrom(newConfig); } @@ -227,4 +237,17 @@ public class Environment { public boolean needDebug() { return mDebug; } + + public static boolean is720P() { + try { + File f = new File("/sys/class/display/mode"); + BufferedReader buf = new BufferedReader(new FileReader(f) ); + String str = buf.readLine(); + buf.close(); + return "720p".equals(str); + } catch (IOException e){ + e.printStackTrace(); + } + return false; + } } diff --git a/src/com/amlogic/inputmethod/remote/RemoteIME.java b/src/com/amlogic/inputmethod/remote/RemoteIME.java index 5a4a525..8505c2e 100755 --- a/src/com/amlogic/inputmethod/remote/RemoteIME.java +++ b/src/com/amlogic/inputmethod/remote/RemoteIME.java @@ -1223,12 +1223,23 @@ public class RemoteIME extends InputMethodService { + String.valueOf(editorInfo.inputType) + " Restarting:" + String.valueOf(restarting)); } + onConfigureWindow(getWindow().getWindow(), false, false); + mEnvironment.onConfigurationChanged(getResources().getConfiguration(),this); + mSkbContainer.updateSkbLayout(); updateIcon(mInputModeSwitcher.requestInputWithSkb(editorInfo)); resetToIdleState(false); mSkbContainer.updateInputMode(); - if (SystemProperties.get("ro.product.device", "m1ref").equals("m1ref")){ + + Log.d("InputMethodService", + "onStartInputView: isM1 = "+SystemProperties.get("ro.product.device", "m1ref").equals("m1ref") + + ", is720p = "+Environment.is720P()); + + if (SystemProperties.get("ro.product.device", "m1ref").equals("m1ref") + && Environment.is720P()){ mSkbContainer.setPadding(0, 0, 0, 180); } + else + mSkbContainer.setPadding(0, 0, 0, 0); setCandidatesViewShown(false); mSkbContainer.requestFocus(); mSkbContainer.clearKeyFocus(); diff --git a/src/com/amlogic/inputmethod/remote/SkbContainer.java b/src/com/amlogic/inputmethod/remote/SkbContainer.java index 55f4b3e..5d59e4d 100755 --- a/src/com/amlogic/inputmethod/remote/SkbContainer.java +++ b/src/com/amlogic/inputmethod/remote/SkbContainer.java @@ -266,7 +266,7 @@ public class SkbContainer extends RelativeLayout implements OnTouchListener { return; } - private void updateSkbLayout() { + public void updateSkbLayout() { int screenWidth = mEnvironment.getScreenWidth(); int keyHeight = mEnvironment.getKeyHeight(); int skbHeight = mEnvironment.getSkbHeight(); |