From 5ec13092a50972e5281ee46b7a57f9b31e80016a Mon Sep 17 00:00:00 2001
From: Yusuke Nojima <nojima@google.com>
Date: Tue, 16 Aug 2011 18:33:40 +0900
Subject: [PATCH] Pass the touch event in the top padding of keyboard.

Bug: 5139932
Change-Id: Id176f92f69160f76ae7e0d46cb3d639080779497
---
 .../inputmethod/keyboard/internal/KeyboardBuilder.java      | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
index de04ecd6ce..f599def36a 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardBuilder.java
@@ -132,6 +132,7 @@ public class KeyboardBuilder<KP extends KeyboardParams> {
     private int mCurrentY = 0;
     private Row mCurrentRow = null;
     private boolean mLeftEdge;
+    private boolean mTopEdge;
     private Key mRightEdgeKey = null;
     private final KeyStyles mKeyStyles = new KeyStyles();
 
@@ -650,6 +651,7 @@ public class KeyboardBuilder<KP extends KeyboardParams> {
 
     private void startKeyboard() {
         mCurrentY += mParams.mTopPadding;
+        mTopEdge = true;
     }
 
     private void startRow(Row row) {
@@ -670,6 +672,7 @@ public class KeyboardBuilder<KP extends KeyboardParams> {
         setSpacer(mCurrentX, mParams.mHorizontalEdgesPadding);
         mCurrentY += mCurrentRow.mRowHeight;
         mCurrentRow = null;
+        mTopEdge = false;
     }
 
     private void endKey(Key key) {
@@ -678,6 +681,9 @@ public class KeyboardBuilder<KP extends KeyboardParams> {
             key.addEdgeFlags(Keyboard.EDGE_LEFT);
             mLeftEdge = false;
         }
+        if (mTopEdge) {
+            key.addEdgeFlags(Keyboard.EDGE_TOP);
+        }
         mRightEdgeKey = key;
     }
 
-- 
GitLab