author | lyra.lee <lyra.lee@amlogic.com> | 2011-07-26 09:19:54 (GMT) |
---|---|---|
committer | lyra.lee <lyra.lee@amlogic.com> | 2011-07-26 09:19:54 (GMT) |
commit | 4fe00c2f1410d458b16f8e25311825390638c292 (patch) | |
tree | 78416545e8bd55259acad4d7522eda801da2714d | |
parent | cfce9f59dc68b62448e72c3ef33c85b42b1ef3c3 (diff) | |
download | RemoteIME-4fe00c2f1410d458b16f8e25311825390638c292.zip RemoteIME-4fe00c2f1410d458b16f8e25311825390638c292.tar.gz RemoteIME-4fe00c2f1410d458b16f8e25311825390638c292.tar.bz2 |
adjust ime keyboard in M1
-rwxr-xr-x | src/com/amlogic/inputmethod/remote/Environment.java | 19 | ||||
-rwxr-xr-x | src/com/amlogic/inputmethod/remote/RemoteIME.java | 4 | ||||
-rwxr-xr-x | src/com/amlogic/inputmethod/remote/SkbContainer.java | 2 |
3 files changed, 19 insertions, 6 deletions
diff --git a/src/com/amlogic/inputmethod/remote/Environment.java b/src/com/amlogic/inputmethod/remote/Environment.java index d9598df..01d2fd5 100755 --- a/src/com/amlogic/inputmethod/remote/Environment.java +++ b/src/com/amlogic/inputmethod/remote/Environment.java @@ -18,8 +18,11 @@ package com.amlogic.inputmethod.remote; import android.content.Context; import android.content.res.Configuration; +import android.os.SystemProperties; import android.view.Display; +import android.view.ViewGroup; import android.view.WindowManager; +import android.widget.FrameLayout; /** * Global environment configurations for showing soft keyboard and candidate @@ -116,11 +119,17 @@ public class Environment { public void onConfigurationChanged(Configuration newConfig, Context context) { if (mConfig.orientation != newConfig.orientation) { - WindowManager wm = (WindowManager) context - .getSystemService(Context.WINDOW_SERVICE); - Display d = wm.getDefaultDisplay(); - mScreenWidth = d.getWidth(); - mScreenHeight = d.getHeight(); + if (SystemProperties.get("ro.product.device", "m1ref").equals("m1ref")){ + mScreenWidth = 1280; + mScreenHeight = 720; + } + else { + WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); + Display d = wm.getDefaultDisplay(); + mScreenWidth = d.getWidth(); + mScreenHeight = d.getHeight(); + } + int scale; if (mScreenHeight > mScreenWidth) { diff --git a/src/com/amlogic/inputmethod/remote/RemoteIME.java b/src/com/amlogic/inputmethod/remote/RemoteIME.java index b58a362..5a4a525 100755 --- a/src/com/amlogic/inputmethod/remote/RemoteIME.java +++ b/src/com/amlogic/inputmethod/remote/RemoteIME.java @@ -30,6 +30,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.RemoteException; +import android.os.SystemProperties; import android.preference.PreferenceManager; import android.util.Log; import android.view.Gravity; @@ -1225,6 +1226,9 @@ public class RemoteIME extends InputMethodService { updateIcon(mInputModeSwitcher.requestInputWithSkb(editorInfo)); resetToIdleState(false); mSkbContainer.updateInputMode(); + if (SystemProperties.get("ro.product.device", "m1ref").equals("m1ref")){ + mSkbContainer.setPadding(0, 0, 0, 180); + } 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 b10e7ec..55f4b3e 100755 --- a/src/com/amlogic/inputmethod/remote/SkbContainer.java +++ b/src/com/amlogic/inputmethod/remote/SkbContainer.java @@ -421,7 +421,7 @@ public class SkbContainer extends RelativeLayout implements OnTouchListener { protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { Environment env = Environment.getInstance(); int measuredWidth = env.getScreenWidth(); - int measuredHeight = getPaddingTop(); + int measuredHeight = getPaddingTop() + getPaddingBottom(); measuredHeight += env.getSkbHeight(); widthMeasureSpec = MeasureSpec.makeMeasureSpec(measuredWidth, MeasureSpec.EXACTLY); |