author | Ting Li <ting.li@amlogic.com> | 2015-04-17 07:21:54 (GMT) |
---|---|---|
committer | Ting Li <ting.li@amlogic.com> | 2015-04-17 07:32:48 (GMT) |
commit | f44c8021f1420e11cab0128423c08df36919d446 (patch) | |
tree | fabd807638ce896187e0182dca95b099c790d598 | |
parent | 7bc0018769314c29746d5fa2dfd98707785b92dd (diff) | |
download | RemoteIME-f44c8021f1420e11cab0128423c08df36919d446.zip RemoteIME-f44c8021f1420e11cab0128423c08df36919d446.tar.gz RemoteIME-f44c8021f1420e11cab0128423c08df36919d446.tar.bz2 |
pd#105064 Add remoteIME to l-amlogic
Change-Id: Iffca58190a1ce9a179c87fc2ffacd6b8c6ba4029
-rw-r--r--[-rwxr-xr-x] | Android.mk | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | jni/Android.mk | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | src/com/amlogic/inputmethod/remote/Environment.java | 43 | ||||
-rw-r--r--[-rwxr-xr-x] | src/com/amlogic/inputmethod/remote/RemoteIME.java | 32 |
4 files changed, 37 insertions, 42 deletions
diff --git a/Android.mk b/Android.mk index 2e24b2e..aa93285 100755..100644 --- a/Android.mk +++ b/Android.mk @@ -8,7 +8,7 @@ LOCAL_SRC_FILES := \ $(call all-subdir-java-files) LOCAL_PACKAGE_NAME := RemoteIME - +LOCAL_JAVA_LIBRARIES := droidlogic LOCAL_REQUIRED_MODULES := libjni_remoteime LOCAL_STATIC_JAVA_LIBRARIES := com.amlogic.inputmethod.remote.lib diff --git a/jni/Android.mk b/jni/Android.mk index e6ceb29..440253a 100755..100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -24,7 +24,7 @@ LOCAL_SRC_FILES := \ share/sync.cpp LOCAL_C_INCLUDES += $(JNI_H_INCLUDE) -LOCAL_LDLIBS += -lpthread +#LOCAL_LDFLAGS += -lpthread LOCAL_MODULE := libjni_remoteime LOCAL_SHARED_LIBRARIES := libcutils libutils LOCAL_PRELINK_MODULE := false diff --git a/src/com/amlogic/inputmethod/remote/Environment.java b/src/com/amlogic/inputmethod/remote/Environment.java index ebb248c..a428fcc 100755..100644 --- a/src/com/amlogic/inputmethod/remote/Environment.java +++ b/src/com/amlogic/inputmethod/remote/Environment.java @@ -20,7 +20,7 @@ import android.content.Context; import android.content.res.Configuration; import android.view.Display; import android.view.WindowManager; -import android.app.SystemWriteManager; +import com.droidlogic.app.SystemControlManager; /** * Global environment configurations for showing soft keyboard and candidate @@ -61,7 +61,7 @@ public class Environment { * How much should the balloon height be larger than that of the real key. * It is relative to the smaller one of screen width and height. */ - private static final float KEY_BALLOON_HEIGHT_PLUS_RATIO = 0.07f; + private static final float KEY_BALLOON_HEIGHT_PLUS_RATIO = 0.08f; /** * The text size for normal keys. It is relative to the smaller one of @@ -79,7 +79,7 @@ public class Environment { * The text size balloons of normal keys. It is relative to the smaller one * of screen width and height. */ - private static final float NORMAL_BALLOON_TEXT_SIZE_RATIO = 0.14f; + private static final float NORMAL_BALLOON_TEXT_SIZE_RATIO = 0.12f; /** * The text size balloons of function keys. It is relative to the smaller @@ -115,35 +115,32 @@ public class Environment { return mInstance; } - public void onConfigurationChanged(Configuration newConfig, Context context) { - //density and display-size will be change when switch outputmode between 1080 and 720, need to update configuration - SystemWriteManager sw = (SystemWriteManager) context.getSystemService("system_write"); - if ((mConfig.orientation != newConfig.orientation)||(sw.getPropertyBoolean("ro.platform.has.realoutputmode", false))) { - WindowManager wm = (WindowManager) context - .getSystemService(Context.WINDOW_SERVICE); + public void onConfigurationChanged ( Configuration newConfig, Context context ) { + //density and display-size will be change when switch outputmode between 1080 and 720, need to update configuration + SystemControlManager sw = new SystemControlManager ( context ); + if ( ( mConfig.orientation != newConfig.orientation ) || ( sw.getPropertyBoolean ( "ro.platform.has.realoutputmode", false ) ) ) { + WindowManager wm = ( WindowManager ) context.getSystemService ( Context.WINDOW_SERVICE ); Display d = wm.getDefaultDisplay(); mScreenWidth = d.getWidth(); mScreenHeight = d.getHeight(); - int scale; - if (mScreenHeight > mScreenWidth) { - mKeyHeight = (int) (mScreenHeight * KEY_HEIGHT_RATIO_PORTRAIT); - mCandidatesAreaHeight = (int) (mScreenHeight * CANDIDATES_AREA_HEIGHT_RATIO_PORTRAIT); + if ( mScreenHeight > mScreenWidth ) { + mKeyHeight = ( int ) ( mScreenHeight * KEY_HEIGHT_RATIO_PORTRAIT ); + mCandidatesAreaHeight = ( int ) ( mScreenHeight * CANDIDATES_AREA_HEIGHT_RATIO_PORTRAIT ); scale = mScreenWidth; } else { - mKeyHeight = (int) (mScreenHeight * KEY_HEIGHT_RATIO_LANDSCAPE); - mCandidatesAreaHeight = (int) (mScreenHeight * CANDIDATES_AREA_HEIGHT_RATIO_LANDSCAPE); + mKeyHeight = ( int ) ( mScreenHeight * KEY_HEIGHT_RATIO_LANDSCAPE ); + mCandidatesAreaHeight = ( int ) ( mScreenHeight * CANDIDATES_AREA_HEIGHT_RATIO_LANDSCAPE ); scale = mScreenHeight; } - mNormalKeyTextSize = (int) (scale * NORMAL_KEY_TEXT_SIZE_RATIO); - mFunctionKeyTextSize = (int) (scale * FUNCTION_KEY_TEXT_SIZE_RATIO); - mNormalBalloonTextSize = (int) (scale * NORMAL_BALLOON_TEXT_SIZE_RATIO); - mFunctionBalloonTextSize = (int) (scale * FUNCTION_BALLOON_TEXT_SIZE_RATIO); - mKeyBalloonWidthPlus = (int) (scale * KEY_BALLOON_WIDTH_PLUS_RATIO); - mKeyBalloonHeightPlus = (int) (scale * KEY_BALLOON_HEIGHT_PLUS_RATIO); + mNormalKeyTextSize = ( int ) ( scale * NORMAL_KEY_TEXT_SIZE_RATIO ); + mFunctionKeyTextSize = ( int ) ( scale * FUNCTION_KEY_TEXT_SIZE_RATIO ); + mNormalBalloonTextSize = ( int ) ( scale * NORMAL_BALLOON_TEXT_SIZE_RATIO ); + 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); + mConfig.updateFrom ( newConfig ); } public Configuration getConfiguration() { diff --git a/src/com/amlogic/inputmethod/remote/RemoteIME.java b/src/com/amlogic/inputmethod/remote/RemoteIME.java index 4253619..5db6719 100755..100644 --- a/src/com/amlogic/inputmethod/remote/RemoteIME.java +++ b/src/com/amlogic/inputmethod/remote/RemoteIME.java @@ -52,7 +52,7 @@ import android.widget.PopupWindow; import java.util.ArrayList; import java.util.List; import java.util.Vector; -import android.app.SystemWriteManager; +import com.droidlogic.app.SystemControlManager; /** * Main class of the Pinyin input method. @@ -174,15 +174,15 @@ public class RemoteIME extends InputMethodService { private Boolean mEnterEnabled; - private Boolean mShiftTag = false; - private SystemWriteManager sw = null; - // receive ringer mode changes - private BroadcastReceiver mReceiver = new BroadcastReceiver() { - @Override - public void onReceive(Context context, Intent intent) { - SoundManager.getInstance(context).updateRingerMode(); - } - }; + private Boolean mShiftTag = false; + private SystemControlManager sw = null; + // receive ringer mode changes + private BroadcastReceiver mReceiver = new BroadcastReceiver() { + @Override + public void onReceive ( Context context, Intent intent ) { + SoundManager.getInstance ( context ).updateRingerMode(); + } + }; @Override public void onCreate() { @@ -210,7 +210,7 @@ public class RemoteIME extends InputMethodService { mEnvironment.onConfigurationChanged(getResources().getConfiguration(), this); - sw = (SystemWriteManager) getSystemService("system_write"); + sw = new SystemControlManager ( this ); } @Override @@ -244,16 +244,14 @@ public class RemoteIME extends InputMethodService { if (null != mCandidatesBalloon) { mCandidatesBalloon.dismiss(); } - - if(newConfig.diff(env.getConfiguration()) != 0) + if (newConfig.diff(env.getConfiguration()) != 0) super.onConfigurationChanged(newConfig); //density and display-size will be change when switch outputmode between 1080 and 720, need to update configuration - if(sw.getPropertyBoolean("ro.platform.has.realoutputmode", false)) - { + if (sw.getPropertyBoolean("ro.platform.has.realoutputmode", false)) { super.onConfigurationChanged(newConfig); - } - + } + resetToIdleState(false); } |