summaryrefslogtreecommitdiffstats
path: root/chips/src
diff options
context:
space:
mode:
authorMindy Pereira <mindyp@google.com>2012-05-23 13:42:52 -0700
committerMindy Pereira <mindyp@google.com>2012-05-23 13:42:52 -0700
commit291e619b2b2ced9abe53fc97613f5707319325bb (patch)
treedea226f63215e243618364165b734641d41fb9ac /chips/src
parent9ec75ceffe2f2b08484b8772ab429f8998110228 (diff)
downloadandroid_frameworks_ex-291e619b2b2ced9abe53fc97613f5707319325bb.tar.gz
android_frameworks_ex-291e619b2b2ced9abe53fc97613f5707319325bb.tar.bz2
android_frameworks_ex-291e619b2b2ced9abe53fc97613f5707319325bb.zip
Try this out with experimenters to see if the scrolling is reasonable.
It seems that what annoyed arubin was that focusing the item changed the scroll position So I am now just changing it when the user actually starts entering text Change-Id: I8868cde2fc90b1e253c50fd3fad900f811442e6d
Diffstat (limited to 'chips/src')
-rw-r--r--chips/src/com/android/ex/chips/RecipientEditTextView.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/chips/src/com/android/ex/chips/RecipientEditTextView.java b/chips/src/com/android/ex/chips/RecipientEditTextView.java
index 39a481b..9ce792a 100644
--- a/chips/src/com/android/ex/chips/RecipientEditTextView.java
+++ b/chips/src/com/android/ex/chips/RecipientEditTextView.java
@@ -2137,6 +2137,8 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements
editable.delete(tokenStart, tokenEnd);
getSpannable().removeSpan(repl[0]);
}
+ } else {
+ scrollBottomIntoView();
}
}
@@ -2146,6 +2148,12 @@ public class RecipientEditTextView extends MultiAutoCompleteTextView implements
}
}
+ private void scrollBottomIntoView() {
+ if (mScrollView != null) {
+ mScrollView.scrollBy(0, (int)(getLineCount() * mChipHeight));
+ }
+ }
+
/**
* Handles pasting a {@link ClipData} to this {@link RecipientEditTextView}.
*/