am 24871f63: Merge "Fix Text appears on top of existing text when composing in gmail." into klp-dev

* commit '24871f6375b87eb2d540f06ec292e5f4a198f78a':
  Fix Text appears on top of existing text when composing in gmail.
This commit is contained in:
Raph Levien
2013-10-04 15:07:10 -07:00
committed by Android Git Automerger

View File

@@ -502,17 +502,19 @@ public class DynamicLayout extends Layout
}
mNumberOfBlocks = newNumberOfBlocks;
int newFirstChangedBlock;
final int deltaLines = newLineCount - (endLine - startLine + 1);
if (deltaLines != 0) {
// Display list whose index is >= mIndexFirstChangedBlock is valid
// but it needs to update its drawing location.
mIndexFirstChangedBlock = firstBlock + numAddedBlocks;
for (int i = mIndexFirstChangedBlock; i < mNumberOfBlocks; i++) {
newFirstChangedBlock = firstBlock + numAddedBlocks;
for (int i = newFirstChangedBlock; i < mNumberOfBlocks; i++) {
mBlockEndLines[i] += deltaLines;
}
} else {
mIndexFirstChangedBlock = mNumberOfBlocks;
newFirstChangedBlock = mNumberOfBlocks;
}
mIndexFirstChangedBlock = Math.min(mIndexFirstChangedBlock, newFirstChangedBlock);
int blockIndex = firstBlock;
if (createBlockBefore) {