aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardView.java2
-rw-r--r--java/src/com/android/inputmethod/latin/SettingsActivity.java8
-rw-r--r--java/src/com/android/inputmethod/latin/Utils.java7
-rw-r--r--native/jni/src/words_priority_queue_pool.h6
4 files changed, 12 insertions, 11 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index 804ccf658..2d587ada1 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -713,9 +713,9 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy {
final int keyWidth = key.mWidth - key.mVisualInsetsLeft - key.mVisualInsetsRight;
final int keyHeight = key.mHeight;
+ paint.setTypeface(params.mKeyTextStyle);
paint.setTextSize(params.mKeyHintLetterSize);
paint.setColor(params.mKeyHintLabelColor);
- params.blendAlpha(paint);
paint.setTextAlign(Align.CENTER);
final float hintX = keyWidth - params.mKeyHintLetterPadding
- getCharWidth(KEY_LABEL_REFERENCE_CHAR, paint) / 2;
diff --git a/java/src/com/android/inputmethod/latin/SettingsActivity.java b/java/src/com/android/inputmethod/latin/SettingsActivity.java
index b85a936ad..556701364 100644
--- a/java/src/com/android/inputmethod/latin/SettingsActivity.java
+++ b/java/src/com/android/inputmethod/latin/SettingsActivity.java
@@ -17,7 +17,6 @@
package com.android.inputmethod.latin;
import android.content.Intent;
-import android.os.Bundle;
import android.preference.PreferenceActivity;
public class SettingsActivity extends PreferenceActivity {
@@ -25,12 +24,7 @@ public class SettingsActivity extends PreferenceActivity {
public Intent getIntent() {
final Intent modIntent = new Intent(super.getIntent());
modIntent.putExtra(EXTRA_SHOW_FRAGMENT, Settings.class.getName());
+ modIntent.putExtra(EXTRA_NO_HEADERS, true);
return modIntent;
}
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setTitle(R.string.english_ime_settings);
- }
}
diff --git a/java/src/com/android/inputmethod/latin/Utils.java b/java/src/com/android/inputmethod/latin/Utils.java
index 0485c881b..036ff74b8 100644
--- a/java/src/com/android/inputmethod/latin/Utils.java
+++ b/java/src/com/android/inputmethod/latin/Utils.java
@@ -466,11 +466,12 @@ public class Utils {
}
private static final String HARDWARE_PREFIX = Build.HARDWARE + ",";
- private static final HashMap<Integer, String> sDeviceOverrideValueMap =
- new HashMap<Integer, String>();
+ private static final HashMap<String, String> sDeviceOverrideValueMap =
+ new HashMap<String, String>();
public static String getDeviceOverrideValue(Resources res, int overrideResId, String defValue) {
- final Integer key = overrideResId;
+ final int orientation = res.getConfiguration().orientation;
+ final String key = overrideResId + "-" + orientation;
if (!sDeviceOverrideValueMap.containsKey(key)) {
String overrideValue = defValue;
for (final String element : res.getStringArray(overrideResId)) {
diff --git a/native/jni/src/words_priority_queue_pool.h b/native/jni/src/words_priority_queue_pool.h
index 5b50e8f4f..210b5a848 100644
--- a/native/jni/src/words_priority_queue_pool.h
+++ b/native/jni/src/words_priority_queue_pool.h
@@ -26,6 +26,7 @@ namespace latinime {
class WordsPriorityQueuePool {
public:
WordsPriorityQueuePool(int mainQueueMaxWords, int subQueueMaxWords, int maxWordLength) {
+ // Note: using placement new() requires the caller to call the destructor explicitly.
mMasterQueue = new(mMasterQueueBuf) WordsPriorityQueue(mainQueueMaxWords, maxWordLength);
for (int i = 0, subQueueBufOffset = 0;
i < MULTIPLE_WORDS_SUGGESTION_MAX_WORDS * SUB_QUEUE_MAX_COUNT;
@@ -36,6 +37,11 @@ class WordsPriorityQueuePool {
}
virtual ~WordsPriorityQueuePool() {
+ // Note: these explicit calls to the destructor match the calls to placement new() above.
+ if (mMasterQueue) mMasterQueue->~WordsPriorityQueue();
+ for (int i = 0; i < MULTIPLE_WORDS_SUGGESTION_MAX_WORDS * SUB_QUEUE_MAX_COUNT; ++i) {
+ if (mSubQueues[i]) mSubQueues[i]->~WordsPriorityQueue();
+ }
}
WordsPriorityQueue* getMasterQueue() {