aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rwxr-xr-xjava/res/layout/input_basic.xml (renamed from java/res/layout/input.xml)2
-rwxr-xr-xjava/res/layout/input_basic_highcontrast.xml (renamed from java/res/layout/input2.xml)2
-rwxr-xr-xjava/res/layout/input_stone_bold.xml38
-rwxr-xr-xjava/res/layout/input_stone_normal.xml (renamed from java/res/layout/input7.xml)3
-rwxr-xr-xjava/res/layout/input_stone_popup.xml (renamed from java/res/layout/input7_popup.xml)9
-rw-r--r--java/res/values/attrs.xml12
-rw-r--r--java/res/values/strings.xml7
-rw-r--r--java/res/values/styles.xml1
-rw-r--r--java/res/xml/prefs.xml2
-rw-r--r--java/src/com/android/inputmethod/latin/KeyboardSwitcher.java11
-rw-r--r--java/src/com/android/inputmethod/latin/LatinImeLogger.java4
-rw-r--r--java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java28
12 files changed, 101 insertions, 18 deletions
diff --git a/java/res/layout/input.xml b/java/res/layout/input_basic.xml
index 039fdd8df..ffa59543b 100755
--- a/java/res/layout/input.xml
+++ b/java/res/layout/input_basic.xml
@@ -21,7 +21,7 @@
<com.android.inputmethod.latin.LatinKeyboardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:latin="http://schemas.android.com/apk/res/com.google.android.inputmethod.latin"
- android:id="@android:id/keyboardView"
+ android:id="@+id/LatinkeyboardBaseView"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/java/res/layout/input2.xml b/java/res/layout/input_basic_highcontrast.xml
index 3c9ec2fdf..dc4d09736 100755
--- a/java/res/layout/input2.xml
+++ b/java/res/layout/input_basic_highcontrast.xml
@@ -22,7 +22,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:latin="http://schemas.android.com/apk/res/com.google.android.inputmethod.latin"
- android:id="@android:id/keyboardView"
+ android:id="@+id/LatinkeyboardBaseView"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/java/res/layout/input_stone_bold.xml b/java/res/layout/input_stone_bold.xml
new file mode 100755
index 000000000..8cc082b5d
--- /dev/null
+++ b/java/res/layout/input_stone_bold.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2010, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<com.android.inputmethod.latin.LatinKeyboardView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:latin="http://schemas.android.com/apk/res/com.google.android.inputmethod.latin"
+ android:id="@+id/LatinkeyboardBaseView"
+ android:layout_alignParentBottom="true"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@drawable/keyboard_background"
+ android:textStyle="bold"
+
+ latin:keyBackground="@drawable/btn_keyboard_key_ginger"
+ latin:keyTextSize="22dip"
+ latin:keyTextColor="@color/latinkeyboard_key_color_black"
+ latin:shadowColor="@color/latinkeyboard_key_color_white"
+ latin:keyTextStyle="bold"
+ latin:symbolColorScheme="black"
+ latin:popupLayout="@layout/input_stone_popup"
+ />
diff --git a/java/res/layout/input7.xml b/java/res/layout/input_stone_normal.xml
index 1290eb8ca..51693502e 100755
--- a/java/res/layout/input7.xml
+++ b/java/res/layout/input_stone_normal.xml
@@ -31,5 +31,6 @@
latin:keyTextSize="22dip"
latin:keyTextColor="@color/latinkeyboard_key_color_black"
latin:shadowColor="@color/latinkeyboard_key_color_white"
- latin:popupLayout="@layout/input7_popup"
+ latin:symbolColorScheme="black"
+ latin:popupLayout="@layout/input_stone_popup"
/>
diff --git a/java/res/layout/input7_popup.xml b/java/res/layout/input_stone_popup.xml
index 2056757fa..e6eae5dad 100755
--- a/java/res/layout/input7_popup.xml
+++ b/java/res/layout/input_stone_popup.xml
@@ -25,10 +25,9 @@
android:orientation="horizontal"
android:background="@drawable/keyboard_popup_panel_background"
>
- <com.android.inputmethod.latin.LatinKeyboardView
- xmlns:android="http://schemas.android.com/apk/res/android"
+ <com.android.inputmethod.latin.LatinKeyboardBaseView
xmlns:latin="http://schemas.android.com/apk/res/com.google.android.inputmethod.latin"
- android:id="@android:id/keyboardView"
+ android:id="@+id/LatinKeyboardBaseView"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -38,9 +37,9 @@
latin:keyTextColor="@color/latinkeyboard_key_color_black"
latin:shadowColor="@color/latinkeyboard_key_color_white"
latin:keyTextSize="22dip"
- latin:popupLayout="@layout/input7_popup"
+ latin:popupLayout="@layout/input_stone_popup"
/>
- <ImageButton android:id="@android:id/closeButton"
+ <ImageButton android:id="@+id/closeButton"
android:background="@android:color/transparent"
android:src="@drawable/btn_close"
android:layout_width="wrap_content"
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 2468e9df0..e3171eb33 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -52,6 +52,18 @@
<attr name="shadowColor" format="color" />
<attr name="shadowRadius" format="float" />
<attr name="backgroundDimAmount" format="float" />
+
+ <attr name="keyTextStyle">
+ <flag name="normal" value="0" />
+ <flag name="bold" value="1" />
+ <flag name="italic" value="2" />
+ </attr>
+
+ <attr name="symbolColorScheme">
+ <flag name="white" value="0" />
+ <flag name="black" value="1" />
+ </attr>
+
</declare-styleable>
</resources>
diff --git a/java/res/values/strings.xml b/java/res/values/strings.xml
index 64b8dbe59..f2d823f0b 100644
--- a/java/res/values/strings.xml
+++ b/java/res/values/strings.xml
@@ -332,18 +332,21 @@
<string name="keyboard_layout">Keyboard Theme</string>
<string name="layout_basic" translatable="false">Basic</string>
<string name="layout_high_contrast" translatable="false">Basic (High Contrast)</string>
- <string name="layout_stone" translatable="false">Default</string>
+ <string name="layout_stone_bold" translatable="false">Default (bold)</string>
+ <string name="layout_stone_normal" translatable="false">Default (normal)</string>
<string-array name="keyboard_layout_modes" translatable="false">
<item>@string/layout_basic</item>
<item>@string/layout_high_contrast</item>
- <item>@string/layout_stone</item>
+ <item>@string/layout_stone_normal</item>
+ <item>@string/layout_stone_bold</item>
</string-array>
<string-array name="keyboard_layout_modes_values" translatable="false">
<item>0</item>
<item>1</item>
<item>2</item>
+ <item>3</item>
</string-array>
<string name="prefs_debug_mode">Debug (Temporary)</string>
diff --git a/java/res/values/styles.xml b/java/res/values/styles.xml
index a59a15083..143355033 100644
--- a/java/res/values/styles.xml
+++ b/java/res/values/styles.xml
@@ -30,5 +30,6 @@
<item name="shadowColor">#BB000000</item>
<item name="shadowRadius">2.75</item>
<item name="backgroundDimAmount">0.5</item>
+ <item name="symbolColorScheme">white</item>
</style>
</resources>
diff --git a/java/res/xml/prefs.xml b/java/res/xml/prefs.xml
index b50588a9e..10e3998f9 100644
--- a/java/res/xml/prefs.xml
+++ b/java/res/xml/prefs.xml
@@ -60,7 +60,7 @@
android:persistent="true"
android:entryValues="@array/keyboard_layout_modes_values"
android:entries="@array/keyboard_layout_modes"
- android:defaultValue="6"
+ android:defaultValue="3"
/>
<PreferenceScreen
diff --git a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
index 665e16aec..bbde23221 100644
--- a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java
@@ -48,10 +48,11 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
public static final int KEYBOARDMODE_IM = R.id.mode_im;
public static final int KEYBOARDMODE_WEB = R.id.mode_webentry;
- public static final String DEFAULT_LAYOUT_ID = "2";
+ public static final String DEFAULT_LAYOUT_ID = "3";
public static final String PREF_KEYBOARD_LAYOUT = "keyboard_layout";
private static final int[] LAYOUTS = new int [] {
- R.layout.input, R.layout.input2, R.layout.input7};
+ R.layout.input_basic, R.layout.input_basic_highcontrast, R.layout.input_stone_normal,
+ R.layout.input_stone_bold};
private static final int SYMBOLS_MODE_STATE_NONE = 0;
private static final int SYMBOLS_MODE_STATE_BEGIN = 1;
@@ -424,8 +425,10 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
}
}
- // TODO: Generalize for any theme
public boolean isBlackSym () {
- return (mLayoutId == 6);
+ if (mInputView != null && mInputView.getSymbolColorSheme() == 1) {
+ return true;
+ }
+ return false;
}
}
diff --git a/java/src/com/android/inputmethod/latin/LatinImeLogger.java b/java/src/com/android/inputmethod/latin/LatinImeLogger.java
index 42d5689d2..e8899504e 100644
--- a/java/src/com/android/inputmethod/latin/LatinImeLogger.java
+++ b/java/src/com/android/inputmethod/latin/LatinImeLogger.java
@@ -264,8 +264,10 @@ public class LatinImeLogger implements SharedPreferences.OnSharedPreferenceChang
Log.d(TAG, "Log theme Id. (1)");
}
// TODO: Not to convert theme ID here. Currently "2" is treated as "6" in a log server.
- if (mThemeId == "2") {
+ if (mThemeId.equals("2")) {
mThemeId = "6";
+ } else if (mThemeId.equals("3")) {
+ mThemeId = "7";
}
mLogBuffer.add(new LogEntry (time, ID_THEME_ID,
new String[] {mThemeId}));
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
index 64299b626..6b8d4f890 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
@@ -165,6 +165,8 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
private Map<Key,View> mMiniKeyboardCache;
private int[] mWindowOffset;
private Key[] mKeys;
+ private Typeface mKeyTextStyle = Typeface.DEFAULT;
+ private int mSymbolColorScheme = 0;
/** Listener for {@link OnKeyboardActionListener}. */
private OnKeyboardActionListener mKeyboardActionListener;
@@ -334,6 +336,24 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
case R.styleable.LatinKeyboardBaseView_backgroundDimAmount:
mBackgroundDimAmount = a.getFloat(attr, 0.5f);
break;
+ //case android.R.styleable.
+ case R.styleable.LatinKeyboardBaseView_keyTextStyle:
+ int textStyle = a.getInt(attr, 0);
+ switch (textStyle) {
+ case 0:
+ mKeyTextStyle = Typeface.DEFAULT;
+ break;
+ case 1:
+ mKeyTextStyle = Typeface.DEFAULT_BOLD;
+ break;
+ default:
+ mKeyTextStyle = Typeface.defaultFromStyle(textStyle);
+ break;
+ }
+ break;
+ case R.styleable.LatinKeyboardBaseView_symbolColorScheme:
+ mSymbolColorScheme = a.getInt(attr, 0);
+ break;
}
}
@@ -526,6 +546,10 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
return mShowPreview;
}
+ public int getSymbolColorSheme() {
+ return mSymbolColorScheme;
+ }
+
public void setVerticalCorrection(int verticalOffset) {
}
@@ -693,7 +717,7 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
paint.setTypeface(Typeface.DEFAULT_BOLD);
} else {
paint.setTextSize(mKeyTextSize);
- paint.setTypeface(Typeface.DEFAULT);
+ paint.setTypeface(mKeyTextStyle);
}
// Draw a drop shadow for the text
paint.setShadowLayer(mShadowRadius, 0, 0, mShadowColor);
@@ -894,7 +918,7 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
mPreviewText.setTypeface(Typeface.DEFAULT_BOLD);
} else {
mPreviewText.setTextSize(TypedValue.COMPLEX_UNIT_PX, mPreviewTextSizeLarge);
- mPreviewText.setTypeface(Typeface.DEFAULT);
+ mPreviewText.setTypeface(mKeyTextStyle);
}
}
mPreviewText.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED),