Move KeyboardView in the framework to LatinKeyboardViewBase

Change-Id: I99e3ea5eb1f1f5e5f9b36306930cdf0f50acfb01
diff --git a/java/res/layout/input.xml b/java/res/layout/input.xml
index 1d7c6f7..039fdd8 100755
--- a/java/res/layout/input.xml
+++ b/java/res/layout/input.xml
@@ -20,10 +20,12 @@
 
 <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:layout_alignParentBottom="true"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:background="@drawable/keyboard_background"
-        android:keyBackground="@drawable/btn_keyboard_key"
+
+        latin:keyBackground="@drawable/btn_keyboard_key"
         />
diff --git a/java/res/layout/input2.xml b/java/res/layout/input2.xml
index 2e90c2c..3c9ec2f 100755
--- a/java/res/layout/input2.xml
+++ b/java/res/layout/input2.xml
@@ -20,10 +20,13 @@
 
 <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:layout_alignParentBottom="true"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:keyBackground="@drawable/btn_keyboard_key3"
         android:background="@android:color/black"
+
+        latin:keyBackground="@drawable/btn_keyboard_key3"
         />
diff --git a/java/res/layout/input3.xml b/java/res/layout/input3.xml
index a27d09a..a4295f7 100755
--- a/java/res/layout/input3.xml
+++ b/java/res/layout/input3.xml
@@ -20,10 +20,12 @@
 
 <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:layout_alignParentBottom="true"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:keyBackground="@drawable/btn_keyboard_key2"
         android:background="@drawable/keyboard_background_4"
+
+        latin:keyBackground="@drawable/btn_keyboard_key2"
         />
diff --git a/java/res/layout/input4.xml b/java/res/layout/input4.xml
index 58dd51e..b5da9d4 100755
--- a/java/res/layout/input4.xml
+++ b/java/res/layout/input4.xml
@@ -20,10 +20,12 @@
 
 <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:layout_alignParentBottom="true"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:keyBackground="@drawable/btn_keyboard_key3"
         android:background="@drawable/keyboard_background_4"
+
+        latin:keyBackground="@drawable/btn_keyboard_key3"
         />
diff --git a/java/res/layout/input5.xml b/java/res/layout/input5.xml
index 5cd0b8d..2de11df 100755
--- a/java/res/layout/input5.xml
+++ b/java/res/layout/input5.xml
@@ -20,10 +20,12 @@
 
 <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:layout_alignParentBottom="true"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:keyBackground="@drawable/btn_keyboard_key2"
         android:background="@drawable/keyboard_background_5"
+
+        latin:keyBackground="@drawable/btn_keyboard_key2"
         />
diff --git a/java/res/layout/input6.xml b/java/res/layout/input6.xml
index 19197e1..54f3104 100755
--- a/java/res/layout/input6.xml
+++ b/java/res/layout/input6.xml
@@ -20,10 +20,12 @@
 
 <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:layout_alignParentBottom="true"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:keyBackground="@drawable/btn_keyboard_key3"
         android:background="@drawable/keyboard_background_5"
+
+        latin:keyBackground="@drawable/btn_keyboard_key3"
         />
diff --git a/java/res/layout/input7.xml b/java/res/layout/input7.xml
index 6279f5d..1290eb8 100755
--- a/java/res/layout/input7.xml
+++ b/java/res/layout/input7.xml
@@ -20,14 +20,16 @@
 
 <com.android.inputmethod.latin.LatinKeyboardView
         xmlns:android="http://schemas.android.com/apk/res/android"
-        android:id="@android:id/keyboardView"
+        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:keyBackground="@drawable/btn_keyboard_key_ginger"
-        android:keyTextSize="22dip"
-        android:keyTextColor="@color/latinkeyboard_key_color_black"
-        android:shadowColor="@color/latinkeyboard_key_color_white"
-        android:popupLayout="@layout/input7_popup"
+
+        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:popupLayout="@layout/input7_popup"
         />
diff --git a/java/res/layout/input7_popup.xml b/java/res/layout/input7_popup.xml
index d1261b8..2056757 100755
--- a/java/res/layout/input7_popup.xml
+++ b/java/res/layout/input7_popup.xml
@@ -25,18 +25,20 @@
         android:orientation="horizontal"
         android:background="@drawable/keyboard_popup_panel_background"
         >
-    <android.inputmethodservice.KeyboardView
+    <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:layout_alignParentBottom="true"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:keyBackground="@drawable/btn_keyboard_key_ginger"
             android:background="@drawable/keyboard_background"
-            android:keyTextColor="@color/latinkeyboard_key_color_black"
-            android:shadowColor="@color/latinkeyboard_key_color_white"
-            android:keyTextSize="22dip"
-            android:popupLayout="@layout/input7_popup"
+
+            latin:keyBackground="@drawable/btn_keyboard_key_ginger"
+            latin:keyTextColor="@color/latinkeyboard_key_color_black"
+            latin:shadowColor="@color/latinkeyboard_key_color_white"
+            latin:keyTextSize="22dip"
+            latin:popupLayout="@layout/input7_popup"
         />
     <ImageButton android:id="@android:id/closeButton"
         android:background="@android:color/transparent"
diff --git a/java/res/layout/input_trans.xml b/java/res/layout/input_trans.xml
index f66e8cd..ee5f85e 100755
--- a/java/res/layout/input_trans.xml
+++ b/java/res/layout/input_trans.xml
@@ -20,11 +20,13 @@
 
 <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:layout_alignParentBottom="true"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:background="@color/latinkeyboard_extension_background"
         android:verticalCorrection="0dip"
-        android:keyBackground="@drawable/btn_keyboard_key_fulltrans"
+
+        latin:keyBackground="@drawable/btn_keyboard_key_fulltrans"
         />
diff --git a/java/res/layout/keyboard_key_preview.xml b/java/res/layout/keyboard_key_preview.xml
new file mode 100644
index 0000000..64eaa65
--- /dev/null
+++ b/java/res/layout/keyboard_key_preview.xml
@@ -0,0 +1,29 @@
+<?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.
+*/
+-->
+
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="80sp"
+    android:textSize="40sp"
+    android:textColor="?android:attr/textColorPrimaryInverse"
+    android:minWidth="32dip"
+    android:gravity="center"
+    android:background="@drawable/keyboard_key_feedback"
+    />
diff --git a/java/res/layout/keyboard_popup_keyboard.xml b/java/res/layout/keyboard_popup_keyboard.xml
new file mode 100644
index 0000000..e6b3a41
--- /dev/null
+++ b/java/res/layout/keyboard_popup_keyboard.xml
@@ -0,0 +1,48 @@
+<?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.
+*/
+-->
+<LinearLayout
+        xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:background="@drawable/keyboard_popup_panel_background"
+        >
+    <com.android.inputmethod.latin.LatinKeyboardBaseView
+            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="@android:color/transparent"
+
+            latin:keyPreviewLayout="@layout/keyboard_key_preview"
+            latin:keyTextSize="22sp"
+            latin:popupLayout="@layout/keyboard_popup_keyboard"
+            />
+    <ImageButton android:id="@+id/closeButton"
+        android:background="@android:color/transparent"
+        android:src="@drawable/btn_close"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:layout_marginLeft="8dp"
+        android:clickable="true"
+        />
+</LinearLayout>
\ No newline at end of file