434 |
*/ |
*/ |
435 |
protected int getViewIndexAtPosition(int pos) |
protected int getViewIndexAtPosition(int pos) |
436 |
{ |
{ |
437 |
// We have one child view allocated for each child element in |
int index = -1; |
438 |
// loadChildren(), so this should work. |
for (int i = 0; i < children.length; i++) |
439 |
Element el = getElement(); |
{ |
440 |
int index = el.getElementIndex(pos); |
if (children[i].getStartOffset() >= pos |
441 |
|
&& children[i].getEndOffset() < pos) |
442 |
|
{ |
443 |
|
index = i; |
444 |
|
break; |
445 |
|
} |
446 |
|
} |
447 |
return index; |
return index; |
448 |
} |
} |
449 |
|
|
480 |
insideAllocation = inside; |
insideAllocation = inside; |
481 |
} |
} |
482 |
} |
} |
483 |
inside.x = alloc.x - insets.left; |
inside.x = alloc.x + insets.left; |
484 |
inside.y = alloc.y - insets.top; |
inside.y = alloc.y + insets.top; |
485 |
inside.width = alloc.width - insets.left - insets.right; |
inside.width = alloc.width - insets.left - insets.right; |
486 |
inside.height = alloc.height - insets.top - insets.bottom; |
inside.height = alloc.height - insets.top - insets.bottom; |
487 |
return inside; |
return inside; |