Merge "Fix a bug throwing IndexOutOfBoundsException when IME receives completions more than MAX_SUGGESTIONS in full-screen mode."
commit
8aaca66928
|
@ -219,7 +219,7 @@ public class CandidateView extends View {
|
||||||
mDivider.getIntrinsicHeight());
|
mDivider.getIntrinsicHeight());
|
||||||
}
|
}
|
||||||
int x = 0;
|
int x = 0;
|
||||||
final int count = mSuggestions.size();
|
final int count = Math.min(mSuggestions.size(), MAX_SUGGESTIONS);
|
||||||
final int width = getWidth();
|
final int width = getWidth();
|
||||||
final Rect bgPadding = mBgPadding;
|
final Rect bgPadding = mBgPadding;
|
||||||
final Paint paint = mPaint;
|
final Paint paint = mPaint;
|
||||||
|
@ -335,7 +335,7 @@ public class CandidateView extends View {
|
||||||
|
|
||||||
public void scrollPrev() {
|
public void scrollPrev() {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
final int count = mSuggestions.size();
|
final int count = Math.min(mSuggestions.size(), MAX_SUGGESTIONS);
|
||||||
int firstItem = 0; // Actually just before the first item, if at the boundary
|
int firstItem = 0; // Actually just before the first item, if at the boundary
|
||||||
while (i < count) {
|
while (i < count) {
|
||||||
if (mWordX[i] < getScrollX()
|
if (mWordX[i] < getScrollX()
|
||||||
|
@ -354,7 +354,7 @@ public class CandidateView extends View {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int scrollX = getScrollX();
|
int scrollX = getScrollX();
|
||||||
int targetX = scrollX;
|
int targetX = scrollX;
|
||||||
final int count = mSuggestions.size();
|
final int count = Math.min(mSuggestions.size(), MAX_SUGGESTIONS);
|
||||||
int rightEdge = scrollX + getWidth();
|
int rightEdge = scrollX + getWidth();
|
||||||
while (i < count) {
|
while (i < count) {
|
||||||
if (mWordX[i] <= rightEdge &&
|
if (mWordX[i] <= rightEdge &&
|
||||||
|
|
Loading…
Reference in New Issue