am d018a0ce
: Merge "Text selection without trackball." into gingerbread
Merge commit 'd018a0ce72124f668d859b19fe3e73f5637d3c7c' into gingerbread-plus-aosp * commit 'd018a0ce72124f668d859b19fe3e73f5637d3c7c': Text selection without trackball.
This commit is contained in:
125
api/current.xml
125
api/current.xml
@ -166353,6 +166353,29 @@
|
||||
<parameter name="event" type="android.view.MotionEvent">
|
||||
</parameter>
|
||||
</method>
|
||||
<method name="setCursorController"
|
||||
return="void"
|
||||
abstract="false"
|
||||
native="false"
|
||||
synchronized="false"
|
||||
static="false"
|
||||
final="false"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
<parameter name="cursorController" type="android.widget.TextView.CursorController">
|
||||
</parameter>
|
||||
</method>
|
||||
<field name="mCursorController"
|
||||
type="android.widget.TextView.CursorController"
|
||||
transient="false"
|
||||
volatile="false"
|
||||
static="false"
|
||||
final="false"
|
||||
deprecated="not deprecated"
|
||||
visibility="protected"
|
||||
>
|
||||
</field>
|
||||
</class>
|
||||
<class name="BaseKeyListener"
|
||||
extends="android.text.method.MetaKeyKeyListener"
|
||||
@ -222863,6 +222886,108 @@
|
||||
>
|
||||
</method>
|
||||
</class>
|
||||
<interface name="TextView.CursorController"
|
||||
abstract="true"
|
||||
static="true"
|
||||
final="false"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
<method name="draw"
|
||||
return="void"
|
||||
abstract="true"
|
||||
native="false"
|
||||
synchronized="false"
|
||||
static="false"
|
||||
final="false"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
<parameter name="canvas" type="android.graphics.Canvas">
|
||||
</parameter>
|
||||
</method>
|
||||
<method name="getOffsetX"
|
||||
return="float"
|
||||
abstract="true"
|
||||
native="false"
|
||||
synchronized="false"
|
||||
static="false"
|
||||
final="false"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
</method>
|
||||
<method name="getOffsetY"
|
||||
return="float"
|
||||
abstract="true"
|
||||
native="false"
|
||||
synchronized="false"
|
||||
static="false"
|
||||
final="false"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
</method>
|
||||
<method name="hide"
|
||||
return="void"
|
||||
abstract="true"
|
||||
native="false"
|
||||
synchronized="false"
|
||||
static="false"
|
||||
final="false"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
</method>
|
||||
<method name="onTouchEvent"
|
||||
return="void"
|
||||
abstract="true"
|
||||
native="false"
|
||||
synchronized="false"
|
||||
static="false"
|
||||
final="false"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
<parameter name="event" type="android.view.MotionEvent">
|
||||
</parameter>
|
||||
</method>
|
||||
<method name="show"
|
||||
return="void"
|
||||
abstract="true"
|
||||
native="false"
|
||||
synchronized="false"
|
||||
static="false"
|
||||
final="false"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
</method>
|
||||
<method name="updatePosition"
|
||||
return="void"
|
||||
abstract="true"
|
||||
native="false"
|
||||
synchronized="false"
|
||||
static="false"
|
||||
final="false"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
<parameter name="offset" type="int">
|
||||
</parameter>
|
||||
</method>
|
||||
<field name="FADE_OUT_DURATION"
|
||||
type="int"
|
||||
transient="false"
|
||||
volatile="false"
|
||||
value="400"
|
||||
static="true"
|
||||
final="true"
|
||||
deprecated="not deprecated"
|
||||
visibility="public"
|
||||
>
|
||||
</field>
|
||||
</interface>
|
||||
<interface name="TextView.OnEditorActionListener"
|
||||
abstract="true"
|
||||
static="true"
|
||||
|
@ -417,8 +417,8 @@ public class Selection {
|
||||
}
|
||||
}
|
||||
|
||||
private static final class START implements NoCopySpan { };
|
||||
private static final class END implements NoCopySpan { };
|
||||
private static final class START implements NoCopySpan { }
|
||||
private static final class END implements NoCopySpan { }
|
||||
|
||||
/*
|
||||
* Public constants
|
||||
|
@ -16,30 +16,38 @@
|
||||
|
||||
package android.text.method;
|
||||
|
||||
import android.util.Log;
|
||||
import android.text.Layout;
|
||||
import android.text.Selection;
|
||||
import android.text.Spannable;
|
||||
import android.view.KeyEvent;
|
||||
import android.graphics.Rect;
|
||||
import android.text.*;
|
||||
import android.widget.TextView;
|
||||
import android.view.View;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.TextView.CursorController;
|
||||
|
||||
// XXX this doesn't extend MetaKeyKeyListener because the signatures
|
||||
// don't match. Need to figure that out. Meanwhile the meta keys
|
||||
// won't work in fields that don't take input.
|
||||
|
||||
public class
|
||||
ArrowKeyMovementMethod
|
||||
implements MovementMethod
|
||||
{
|
||||
public class ArrowKeyMovementMethod implements MovementMethod {
|
||||
/**
|
||||
* An optional controller for the cursor.
|
||||
* Use {@link #setCursorController(CursorController)} to set this field.
|
||||
*/
|
||||
protected CursorController mCursorController;
|
||||
|
||||
private boolean isCap(Spannable buffer) {
|
||||
return ((MetaKeyKeyListener.getMetaState(buffer, KeyEvent.META_SHIFT_ON) == 1) ||
|
||||
(MetaKeyKeyListener.getMetaState(buffer, MetaKeyKeyListener.META_SELECTING) != 0));
|
||||
}
|
||||
|
||||
private boolean isAlt(Spannable buffer) {
|
||||
return MetaKeyKeyListener.getMetaState(buffer, KeyEvent.META_ALT_ON) == 1;
|
||||
}
|
||||
|
||||
private boolean up(TextView widget, Spannable buffer) {
|
||||
boolean cap = (MetaKeyKeyListener.getMetaState(buffer,
|
||||
KeyEvent.META_SHIFT_ON) == 1) ||
|
||||
(MetaKeyKeyListener.getMetaState(buffer,
|
||||
MetaKeyKeyListener.META_SELECTING) != 0);
|
||||
boolean alt = MetaKeyKeyListener.getMetaState(buffer,
|
||||
KeyEvent.META_ALT_ON) == 1;
|
||||
boolean cap = isCap(buffer);
|
||||
boolean alt = isAlt(buffer);
|
||||
Layout layout = widget.getLayout();
|
||||
|
||||
if (cap) {
|
||||
@ -60,12 +68,8 @@ implements MovementMethod
|
||||
}
|
||||
|
||||
private boolean down(TextView widget, Spannable buffer) {
|
||||
boolean cap = (MetaKeyKeyListener.getMetaState(buffer,
|
||||
KeyEvent.META_SHIFT_ON) == 1) ||
|
||||
(MetaKeyKeyListener.getMetaState(buffer,
|
||||
MetaKeyKeyListener.META_SELECTING) != 0);
|
||||
boolean alt = MetaKeyKeyListener.getMetaState(buffer,
|
||||
KeyEvent.META_ALT_ON) == 1;
|
||||
boolean cap = isCap(buffer);
|
||||
boolean alt = isAlt(buffer);
|
||||
Layout layout = widget.getLayout();
|
||||
|
||||
if (cap) {
|
||||
@ -86,12 +90,8 @@ implements MovementMethod
|
||||
}
|
||||
|
||||
private boolean left(TextView widget, Spannable buffer) {
|
||||
boolean cap = (MetaKeyKeyListener.getMetaState(buffer,
|
||||
KeyEvent.META_SHIFT_ON) == 1) ||
|
||||
(MetaKeyKeyListener.getMetaState(buffer,
|
||||
MetaKeyKeyListener.META_SELECTING) != 0);
|
||||
boolean alt = MetaKeyKeyListener.getMetaState(buffer,
|
||||
KeyEvent.META_ALT_ON) == 1;
|
||||
boolean cap = isCap(buffer);
|
||||
boolean alt = isAlt(buffer);
|
||||
Layout layout = widget.getLayout();
|
||||
|
||||
if (cap) {
|
||||
@ -110,12 +110,8 @@ implements MovementMethod
|
||||
}
|
||||
|
||||
private boolean right(TextView widget, Spannable buffer) {
|
||||
boolean cap = (MetaKeyKeyListener.getMetaState(buffer,
|
||||
KeyEvent.META_SHIFT_ON) == 1) ||
|
||||
(MetaKeyKeyListener.getMetaState(buffer,
|
||||
MetaKeyKeyListener.META_SELECTING) != 0);
|
||||
boolean alt = MetaKeyKeyListener.getMetaState(buffer,
|
||||
KeyEvent.META_ALT_ON) == 1;
|
||||
boolean cap = isCap(buffer);
|
||||
boolean alt = isAlt(buffer);
|
||||
Layout layout = widget.getLayout();
|
||||
|
||||
if (cap) {
|
||||
@ -133,35 +129,6 @@ implements MovementMethod
|
||||
}
|
||||
}
|
||||
|
||||
private int getOffset(int x, int y, TextView widget){
|
||||
// Converts the absolute X,Y coordinates to the character offset for the
|
||||
// character whose position is closest to the specified
|
||||
// horizontal position.
|
||||
x -= widget.getTotalPaddingLeft();
|
||||
y -= widget.getTotalPaddingTop();
|
||||
|
||||
// Clamp the position to inside of the view.
|
||||
if (x < 0) {
|
||||
x = 0;
|
||||
} else if (x >= (widget.getWidth()-widget.getTotalPaddingRight())) {
|
||||
x = widget.getWidth()-widget.getTotalPaddingRight() - 1;
|
||||
}
|
||||
if (y < 0) {
|
||||
y = 0;
|
||||
} else if (y >= (widget.getHeight()-widget.getTotalPaddingBottom())) {
|
||||
y = widget.getHeight()-widget.getTotalPaddingBottom() - 1;
|
||||
}
|
||||
|
||||
x += widget.getScrollX();
|
||||
y += widget.getScrollY();
|
||||
|
||||
Layout layout = widget.getLayout();
|
||||
int line = layout.getLineForVertical(y);
|
||||
|
||||
int offset = layout.getOffsetForHorizontal(line, x);
|
||||
return offset;
|
||||
}
|
||||
|
||||
public boolean onKeyDown(TextView widget, Spannable buffer, int keyCode, KeyEvent event) {
|
||||
if (executeDown(widget, buffer, keyCode)) {
|
||||
MetaKeyKeyListener.adjustMetaAfterKeypress(buffer);
|
||||
@ -193,12 +160,11 @@ implements MovementMethod
|
||||
break;
|
||||
|
||||
case KeyEvent.KEYCODE_DPAD_CENTER:
|
||||
if (MetaKeyKeyListener.getMetaState(buffer, MetaKeyKeyListener.META_SELECTING) != 0) {
|
||||
if (widget.showContextMenu()) {
|
||||
if ((MetaKeyKeyListener.getMetaState(buffer, MetaKeyKeyListener.META_SELECTING) != 0) &&
|
||||
(widget.showContextMenu())) {
|
||||
handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (handled) {
|
||||
MetaKeyKeyListener.adjustMetaAfterKeypress(buffer);
|
||||
@ -214,8 +180,7 @@ implements MovementMethod
|
||||
|
||||
public boolean onKeyOther(TextView view, Spannable text, KeyEvent event) {
|
||||
int code = event.getKeyCode();
|
||||
if (code != KeyEvent.KEYCODE_UNKNOWN
|
||||
&& event.getAction() == KeyEvent.ACTION_MULTIPLE) {
|
||||
if (code != KeyEvent.KEYCODE_UNKNOWN && event.getAction() == KeyEvent.ACTION_MULTIPLE) {
|
||||
int repeat = event.getRepeatCount();
|
||||
boolean handled = false;
|
||||
while ((--repeat) > 0) {
|
||||
@ -226,13 +191,22 @@ implements MovementMethod
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onTrackballEvent(TextView widget, Spannable text,
|
||||
MotionEvent event) {
|
||||
public boolean onTrackballEvent(TextView widget, Spannable text, MotionEvent event) {
|
||||
if (mCursorController != null) {
|
||||
mCursorController.hide();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean onTouchEvent(TextView widget, Spannable buffer,
|
||||
MotionEvent event) {
|
||||
public boolean onTouchEvent(TextView widget, Spannable buffer, MotionEvent event) {
|
||||
if (mCursorController != null) {
|
||||
return onTouchEventCursor(widget, buffer, event);
|
||||
} else {
|
||||
return onTouchEventStandard(widget, buffer, event);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean onTouchEventStandard(TextView widget, Spannable buffer, MotionEvent event) {
|
||||
int initialScrollX = -1, initialScrollY = -1;
|
||||
if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
initialScrollX = Touch.getInitialScrollX(widget, buffer);
|
||||
@ -243,53 +217,20 @@ implements MovementMethod
|
||||
|
||||
if (widget.isFocused() && !widget.didTouchFocusSelect()) {
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
boolean cap = (MetaKeyKeyListener.getMetaState(buffer,
|
||||
KeyEvent.META_SHIFT_ON) == 1) ||
|
||||
(MetaKeyKeyListener.getMetaState(buffer,
|
||||
MetaKeyKeyListener.META_SELECTING) != 0);
|
||||
int x = (int) event.getX();
|
||||
int y = (int) event.getY();
|
||||
int offset = getOffset(x, y, widget);
|
||||
|
||||
boolean cap = isCap(buffer);
|
||||
if (cap) {
|
||||
buffer.setSpan(LAST_TAP_DOWN, offset, offset,
|
||||
Spannable.SPAN_POINT_POINT);
|
||||
int offset = widget.getOffset((int) event.getX(), (int) event.getY());
|
||||
|
||||
buffer.setSpan(LAST_TAP_DOWN, offset, offset, Spannable.SPAN_POINT_POINT);
|
||||
|
||||
// Disallow intercepting of the touch events, so that
|
||||
// users can scroll and select at the same time.
|
||||
// without this, users would get booted out of select
|
||||
// mode once the view detected it needed to scroll.
|
||||
widget.getParent().requestDisallowInterceptTouchEvent(true);
|
||||
} else {
|
||||
OnePointFiveTapState[] tap = buffer.getSpans(0, buffer.length(),
|
||||
OnePointFiveTapState.class);
|
||||
|
||||
if (tap.length > 0) {
|
||||
if (event.getEventTime() - tap[0].mWhen <=
|
||||
ViewConfiguration.getDoubleTapTimeout() &&
|
||||
sameWord(buffer, offset, Selection.getSelectionEnd(buffer))) {
|
||||
|
||||
tap[0].active = true;
|
||||
MetaKeyKeyListener.startSelecting(widget, buffer);
|
||||
widget.getParent().requestDisallowInterceptTouchEvent(true);
|
||||
buffer.setSpan(LAST_TAP_DOWN, offset, offset,
|
||||
Spannable.SPAN_POINT_POINT);
|
||||
}
|
||||
|
||||
tap[0].mWhen = event.getEventTime();
|
||||
} else {
|
||||
OnePointFiveTapState newtap = new OnePointFiveTapState();
|
||||
newtap.mWhen = event.getEventTime();
|
||||
newtap.active = false;
|
||||
buffer.setSpan(newtap, 0, buffer.length(),
|
||||
Spannable.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
}
|
||||
}
|
||||
} else if (event.getAction() == MotionEvent.ACTION_MOVE) {
|
||||
boolean cap = (MetaKeyKeyListener.getMetaState(buffer,
|
||||
KeyEvent.META_SHIFT_ON) == 1) ||
|
||||
(MetaKeyKeyListener.getMetaState(buffer,
|
||||
MetaKeyKeyListener.META_SELECTING) != 0);
|
||||
boolean cap = isCap(buffer);
|
||||
|
||||
if (cap && handled) {
|
||||
// Before selecting, make sure we've moved out of the "slop".
|
||||
@ -297,45 +238,15 @@ implements MovementMethod
|
||||
// OUT of the slop
|
||||
|
||||
// Turn long press off while we're selecting. User needs to
|
||||
// re-tap on the selection to enable longpress
|
||||
// re-tap on the selection to enable long press
|
||||
widget.cancelLongPress();
|
||||
|
||||
// Update selection as we're moving the selection area.
|
||||
|
||||
// Get the current touch position
|
||||
int x = (int) event.getX();
|
||||
int y = (int) event.getY();
|
||||
int offset = getOffset(x, y, widget);
|
||||
int offset = widget.getOffset((int) event.getX(), (int) event.getY());
|
||||
|
||||
final OnePointFiveTapState[] tap = buffer.getSpans(0, buffer.length(),
|
||||
OnePointFiveTapState.class);
|
||||
|
||||
if (tap.length > 0 && tap[0].active) {
|
||||
// Get the last down touch position (the position at which the
|
||||
// user started the selection)
|
||||
int lastDownOffset = buffer.getSpanStart(LAST_TAP_DOWN);
|
||||
|
||||
// Compute the selection boundaries
|
||||
int spanstart;
|
||||
int spanend;
|
||||
if (offset >= lastDownOffset) {
|
||||
// Expand from word start of the original tap to new word
|
||||
// end, since we are selecting "forwards"
|
||||
spanstart = findWordStart(buffer, lastDownOffset);
|
||||
spanend = findWordEnd(buffer, offset);
|
||||
} else {
|
||||
// Expand to from new word start to word end of the original
|
||||
// tap since we are selecting "backwards".
|
||||
// The spanend will always need to be associated with the touch
|
||||
// up position, so that refining the selection with the
|
||||
// trackball will work as expected.
|
||||
spanstart = findWordEnd(buffer, lastDownOffset);
|
||||
spanend = findWordStart(buffer, offset);
|
||||
}
|
||||
Selection.setSelection(buffer, spanstart, spanend);
|
||||
} else {
|
||||
Selection.extendSelection(buffer, offset);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} else if (event.getAction() == MotionEvent.ACTION_UP) {
|
||||
@ -349,65 +260,12 @@ implements MovementMethod
|
||||
return true;
|
||||
}
|
||||
|
||||
int x = (int) event.getX();
|
||||
int y = (int) event.getY();
|
||||
int off = getOffset(x, y, widget);
|
||||
|
||||
// XXX should do the same adjust for x as we do for the line.
|
||||
|
||||
OnePointFiveTapState[] onepointfivetap = buffer.getSpans(0, buffer.length(),
|
||||
OnePointFiveTapState.class);
|
||||
if (onepointfivetap.length > 0 && onepointfivetap[0].active &&
|
||||
Selection.getSelectionStart(buffer) == Selection.getSelectionEnd(buffer)) {
|
||||
// If we've set select mode, because there was a onepointfivetap,
|
||||
// but there was no ensuing swipe gesture, undo the select mode
|
||||
// and remove reference to the last onepointfivetap.
|
||||
MetaKeyKeyListener.stopSelecting(widget, buffer);
|
||||
for (int i=0; i < onepointfivetap.length; i++) {
|
||||
buffer.removeSpan(onepointfivetap[i]);
|
||||
}
|
||||
int offset = widget.getOffset((int) event.getX(), (int) event.getY());
|
||||
if (isCap(buffer)) {
|
||||
buffer.removeSpan(LAST_TAP_DOWN);
|
||||
}
|
||||
boolean cap = (MetaKeyKeyListener.getMetaState(buffer,
|
||||
KeyEvent.META_SHIFT_ON) == 1) ||
|
||||
(MetaKeyKeyListener.getMetaState(buffer,
|
||||
MetaKeyKeyListener.META_SELECTING) != 0);
|
||||
|
||||
DoubleTapState[] tap = buffer.getSpans(0, buffer.length(),
|
||||
DoubleTapState.class);
|
||||
boolean doubletap = false;
|
||||
|
||||
if (tap.length > 0) {
|
||||
if (event.getEventTime() - tap[0].mWhen <=
|
||||
ViewConfiguration.getDoubleTapTimeout() &&
|
||||
sameWord(buffer, off, Selection.getSelectionEnd(buffer))) {
|
||||
|
||||
doubletap = true;
|
||||
}
|
||||
|
||||
tap[0].mWhen = event.getEventTime();
|
||||
Selection.extendSelection(buffer, offset);
|
||||
} else {
|
||||
DoubleTapState newtap = new DoubleTapState();
|
||||
newtap.mWhen = event.getEventTime();
|
||||
buffer.setSpan(newtap, 0, buffer.length(),
|
||||
Spannable.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
}
|
||||
|
||||
if (cap) {
|
||||
buffer.removeSpan(LAST_TAP_DOWN);
|
||||
if (onepointfivetap.length > 0 && onepointfivetap[0].active) {
|
||||
// If we selecting something with the onepointfivetap-and
|
||||
// swipe gesture, stop it on finger up.
|
||||
MetaKeyKeyListener.stopSelecting(widget, buffer);
|
||||
} else {
|
||||
Selection.extendSelection(buffer, off);
|
||||
}
|
||||
} else if (doubletap) {
|
||||
Selection.setSelection(buffer,
|
||||
findWordStart(buffer, off),
|
||||
findWordEnd(buffer, off));
|
||||
} else {
|
||||
Selection.setSelection(buffer, off);
|
||||
Selection.setSelection(buffer, offset);
|
||||
}
|
||||
|
||||
MetaKeyKeyListener.adjustMetaAfterKeypress(buffer);
|
||||
@ -420,73 +278,36 @@ implements MovementMethod
|
||||
return handled;
|
||||
}
|
||||
|
||||
private static class DoubleTapState implements NoCopySpan {
|
||||
long mWhen;
|
||||
private boolean onTouchEventCursor(TextView widget, Spannable buffer, MotionEvent event) {
|
||||
if (widget.isFocused() && !widget.didTouchFocusSelect()) {
|
||||
switch (event.getActionMasked()) {
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
widget.cancelLongPress();
|
||||
|
||||
// Offset the current touch position (from controller to cursor)
|
||||
final float x = event.getX() + mCursorController.getOffsetX();
|
||||
final float y = event.getY() + mCursorController.getOffsetY();
|
||||
int offset = widget.getOffset((int) x, (int) y);
|
||||
mCursorController.updatePosition(offset);
|
||||
return true;
|
||||
|
||||
case MotionEvent.ACTION_UP:
|
||||
case MotionEvent.ACTION_CANCEL:
|
||||
mCursorController = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* We check for a onepointfive tap. This is similar to
|
||||
* doubletap gesture (where a finger goes down, up, down, up, in a short
|
||||
* time period), except in the onepointfive tap, a users finger only needs
|
||||
* to go down, up, down in a short time period. We detect this type of tap
|
||||
* to implement the onepointfivetap-and-swipe selection gesture.
|
||||
* This gesture allows users to select a segment of text without going
|
||||
* through the "select text" option in the context menu.
|
||||
*/
|
||||
private static class OnePointFiveTapState implements NoCopySpan {
|
||||
long mWhen;
|
||||
boolean active;
|
||||
}
|
||||
|
||||
private static boolean sameWord(CharSequence text, int one, int two) {
|
||||
int start = findWordStart(text, one);
|
||||
int end = findWordEnd(text, one);
|
||||
|
||||
if (end == start) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return start == findWordStart(text, two) &&
|
||||
end == findWordEnd(text, two);
|
||||
}
|
||||
|
||||
// TODO: Unify with TextView.getWordForDictionary()
|
||||
private static int findWordStart(CharSequence text, int start) {
|
||||
for (; start > 0; start--) {
|
||||
char c = text.charAt(start - 1);
|
||||
int type = Character.getType(c);
|
||||
|
||||
if (c != '\'' &&
|
||||
type != Character.UPPERCASE_LETTER &&
|
||||
type != Character.LOWERCASE_LETTER &&
|
||||
type != Character.TITLECASE_LETTER &&
|
||||
type != Character.MODIFIER_LETTER &&
|
||||
type != Character.DECIMAL_DIGIT_NUMBER) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return start;
|
||||
}
|
||||
|
||||
// TODO: Unify with TextView.getWordForDictionary()
|
||||
private static int findWordEnd(CharSequence text, int end) {
|
||||
int len = text.length();
|
||||
|
||||
for (; end < len; end++) {
|
||||
char c = text.charAt(end);
|
||||
int type = Character.getType(c);
|
||||
|
||||
if (c != '\'' &&
|
||||
type != Character.UPPERCASE_LETTER &&
|
||||
type != Character.LOWERCASE_LETTER &&
|
||||
type != Character.TITLECASE_LETTER &&
|
||||
type != Character.MODIFIER_LETTER &&
|
||||
type != Character.DECIMAL_DIGIT_NUMBER) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return end;
|
||||
/**
|
||||
* Defines the cursor controller.
|
||||
*
|
||||
* When set, this object can be used to handle events, that can be translated in cursor updates.
|
||||
* @param cursorController A cursor controller implementation
|
||||
*/
|
||||
public void setCursorController(CursorController cursorController) {
|
||||
mCursorController = cursorController;
|
||||
}
|
||||
|
||||
public boolean canSelectArbitrarily() {
|
||||
@ -525,8 +346,9 @@ implements MovementMethod
|
||||
}
|
||||
|
||||
public static MovementMethod getInstance() {
|
||||
if (sInstance == null)
|
||||
if (sInstance == null) {
|
||||
sInstance = new ArrowKeyMovementMethod();
|
||||
}
|
||||
|
||||
return sInstance;
|
||||
}
|
||||
|
@ -17,14 +17,13 @@
|
||||
package android.text.method;
|
||||
|
||||
import android.text.Layout;
|
||||
import android.text.NoCopySpan;
|
||||
import android.text.Layout.Alignment;
|
||||
import android.text.NoCopySpan;
|
||||
import android.text.Spannable;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.widget.TextView;
|
||||
import android.view.KeyEvent;
|
||||
|
||||
public class Touch {
|
||||
private Touch() { }
|
||||
@ -99,7 +98,7 @@ public class Touch {
|
||||
MotionEvent event) {
|
||||
DragState[] ds;
|
||||
|
||||
switch (event.getAction()) {
|
||||
switch (event.getActionMasked()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
ds = buffer.getSpans(0, buffer.length(), DragState.class);
|
||||
|
||||
|
@ -54,7 +54,7 @@ public abstract class AbsSavedState implements Parcelable {
|
||||
*/
|
||||
protected AbsSavedState(Parcel source) {
|
||||
// FIXME need class loader
|
||||
Parcelable superState = (Parcelable) source.readParcelable(null);
|
||||
Parcelable superState = source.readParcelable(null);
|
||||
|
||||
mSuperState = superState != null ? superState : EMPTY_STATE;
|
||||
}
|
||||
@ -75,7 +75,7 @@ public abstract class AbsSavedState implements Parcelable {
|
||||
= new Parcelable.Creator<AbsSavedState>() {
|
||||
|
||||
public AbsSavedState createFromParcel(Parcel in) {
|
||||
Parcelable superState = (Parcelable) in.readParcelable(null);
|
||||
Parcelable superState = in.readParcelable(null);
|
||||
if (superState != null) {
|
||||
throw new IllegalStateException("superState must be null");
|
||||
}
|
||||
|
@ -772,7 +772,7 @@ public final class MotionEvent extends InputEvent implements Parcelable {
|
||||
*
|
||||
* @param pointerId The identifier of the pointer to be found.
|
||||
* @return Returns either the index of the pointer (for use with
|
||||
* {@link #getX(int) et al.), or -1 if there is no data available for
|
||||
* {@link #getX(int)} et al.), or -1 if there is no data available for
|
||||
* that pointer identifier.
|
||||
*/
|
||||
public final int findPointerIndex(int pointerId) {
|
||||
|
@ -2413,11 +2413,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this view's OnLongClickListener, if it is defined. Invokes the context menu
|
||||
* if the OnLongClickListener did not consume the event.
|
||||
* Call this view's OnLongClickListener, if it is defined. Invokes the context menu if the
|
||||
* OnLongClickListener did not consume the event.
|
||||
*
|
||||
* @return True there was an assigned OnLongClickListener that was called, false
|
||||
* otherwise is returned.
|
||||
* @return True if one of the above receivers consumed the event, false otherwise.
|
||||
*/
|
||||
public boolean performLongClick() {
|
||||
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED);
|
||||
@ -4218,6 +4217,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
|
||||
* Show the context menu for this view. It is not safe to hold on to the
|
||||
* menu after returning from this method.
|
||||
*
|
||||
* You should normally not overload this method. Overload
|
||||
* {@link #onCreateContextMenu(ContextMenu)} or define an
|
||||
* {@link OnCreateContextMenuListener} to add items to the context menu.
|
||||
*
|
||||
* @param menu The context menu to populate
|
||||
*/
|
||||
public void createContextMenu(ContextMenu menu) {
|
||||
|
File diff suppressed because it is too large
Load Diff
BIN
core/res/res/drawable-hdpi/text_select_handle.png
Normal file
BIN
core/res/res/drawable-hdpi/text_select_handle.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
core/res/res/drawable-mdpi/text_select_handle.png
Normal file
BIN
core/res/res/drawable-mdpi/text_select_handle.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.5 KiB |
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"Označit text"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"Zastavit označování textu"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"Vyjmout"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"Vyjmout vše"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"Kopírovat"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"Kopírovat vše"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"Vložit"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"Kopírovat adresu URL"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"Metoda zadávání dat"</string>
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"Marker tekst"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"Hold op med at markere tekst"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"Klip"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"Klip alle"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"Kopier"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"Kopier alle"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"Indsæt"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"Kopier webadresse"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"Inputmetode"</string>
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"Text auswählen"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"Textauswahl beenden"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"Ausschneiden"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"Alles ausschneiden"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"Kopieren"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"Alles kopieren"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"Einfügen"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"URL kopieren"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"Eingabemethode"</string>
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"Επιλογή κειμένου"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"Διακοπή επιλογής κειμένου"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"Αποκοπή"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"Αποκοπή όλων"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"Αντιγραφή"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"Αντιγραφή όλων"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"Επικόλληση"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"Αντιγραφή διεύθυνσης URL"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"Μέθοδος εισόδου"</string>
|
||||
|
@ -1079,11 +1079,9 @@
|
||||
<skip />
|
||||
<!-- no translation found for cut (5845613239192595662) -->
|
||||
<skip />
|
||||
<!-- no translation found for cutAll (4474519683293791451) -->
|
||||
<skip />
|
||||
<!-- no translation found for copy (8603721575469529820) -->
|
||||
<skip />
|
||||
<!-- no translation found for copyAll (4777548804630476932) -->
|
||||
<skip />
|
||||
<!-- no translation found for paste (6458036735811828538) -->
|
||||
<skip />
|
||||
|
@ -1074,11 +1074,9 @@
|
||||
<skip />
|
||||
<!-- no translation found for cut (5845613239192595662) -->
|
||||
<skip />
|
||||
<!-- no translation found for cutAll (4474519683293791451) -->
|
||||
<skip />
|
||||
<!-- no translation found for copy (8603721575469529820) -->
|
||||
<skip />
|
||||
<!-- no translation found for copyAll (4777548804630476932) -->
|
||||
<skip />
|
||||
<!-- no translation found for paste (6458036735811828538) -->
|
||||
<skip />
|
||||
|
@ -1115,11 +1115,9 @@
|
||||
<skip />
|
||||
<!-- no translation found for cut (5845613239192595662) -->
|
||||
<skip />
|
||||
<!-- no translation found for cutAll (4474519683293791451) -->
|
||||
<skip />
|
||||
<!-- no translation found for copy (8603721575469529820) -->
|
||||
<skip />
|
||||
<!-- no translation found for copyAll (4777548804630476932) -->
|
||||
<skip />
|
||||
<!-- no translation found for paste (6458036735811828538) -->
|
||||
<skip />
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"Seleccionar texto"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"Detener la selección de texto"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"Cortar"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"Cortar llamada"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"Copiar"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"Copiar todo"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"Pegar"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"Copiar URL"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"Método de entrada"</string>
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"Seleccionar texto"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"Detener selección de texto"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"Cortar"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"Cortar todo"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"Copiar"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"Copiar todo"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"Pegar"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"Copiar URL"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"Método de introducción de texto"</string>
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"Sélectionner le texte"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"Arrêter sélection de texte"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"Couper"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"Tout couper"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"Copier"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"Tout copier"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"Coller"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"Copier l\'URL"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"Mode de saisie"</string>
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"Seleziona testo"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"Termina selezione testo"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"Taglia"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"Taglia tutto"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"Copia"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"Copia tutto"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"Incolla"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"Copia URL"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"Metodo inserimento"</string>
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"テキストを選択"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"テキストの選択を終了"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"切り取り"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"すべて切り取り"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"コピー"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"すべてコピー"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"貼り付け"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"URLをコピー"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"入力方法"</string>
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"텍스트 선택"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"텍스트 선택 중지"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"잘라내기"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"모두 잘라내기"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"복사"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"모두 복사"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"붙여넣기"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"URL 복사"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"입력 방법"</string>
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"Merk tekst"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"Slutt å merke tekst"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"Klipp ut"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"Klipp ut alt"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"Kopier"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"Kopier alt"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"Lim inn"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"Kopier URL"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"Inndatametode"</string>
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"Tekst selecteren"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"Stoppen met tekst selecteren"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"Knippen"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"Alles knippen"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"Kopiëren"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"Alles kopiëren"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"Plakken"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"URL kopiëren"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"Invoermethode"</string>
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"Zaznacz tekst"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"Zatrzymaj wybieranie tekstu"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"Wytnij"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"Wytnij wszystko"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"Kopiuj"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"Kopiuj wszystko"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"Wklej"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"Kopiuj adres URL"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"Metoda wprowadzania"</string>
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"Seleccionar texto"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"Parar selecção de texto"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"Cortar"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"Cortar tudo"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"Copiar"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"Copiar tudo"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"Colar"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"Copiar URL"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"Método de entrada"</string>
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"Selecionar texto"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"Parar seleção de texto"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"Recortar"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"Recortar tudo"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"Copiar"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"Copiar tudo"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"Colar"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"Copiar URL"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"Método de entrada"</string>
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"Выбрать текст"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"Остановить выделение текста"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"Вырезать"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"Вырезать все"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"Копировать"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"Копировать все"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"Вставить"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"Копировать URL"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"Способ ввода"</string>
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"Markera text"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"Sluta välja text"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"Klipp ut"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"Klipp ut alla"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"Kopiera"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"Kopiera alla"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"Klistra in"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"Kopiera webbadress"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"Indatametod"</string>
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"Metin seç"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"Metin seçmeyi durdur"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"Kes"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"Tümünü kes"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"Kopyala"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"Tümünü kopyala"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"Yapıştır"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"URL\'yi kopyala"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"Giriş yöntemi"</string>
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"选择文字"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"停止选择文字"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"剪切"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"全部剪切"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"复制"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"全部复制"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"粘贴"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"复制网址"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"输入法"</string>
|
||||
|
@ -706,9 +706,7 @@
|
||||
<string name="selectText" msgid="3889149123626888637">"選取文字"</string>
|
||||
<string name="stopSelectingText" msgid="4157931463872320996">"停止選取文字"</string>
|
||||
<string name="cut" msgid="3092569408438626261">"剪下"</string>
|
||||
<string name="cutAll" msgid="2436383270024931639">"全部剪下"</string>
|
||||
<string name="copy" msgid="2681946229533511987">"複製"</string>
|
||||
<string name="copyAll" msgid="2590829068100113057">"全部複製"</string>
|
||||
<string name="paste" msgid="5629880836805036433">"貼上"</string>
|
||||
<string name="copyUrl" msgid="2538211579596067402">"複製網址"</string>
|
||||
<string name="inputMethod" msgid="1653630062304567879">"輸入方式"</string>
|
||||
|
@ -1245,7 +1245,7 @@
|
||||
<public type="anim" name="cycle_interpolator" id="0x010a000c" />
|
||||
|
||||
<!-- ===============================================================
|
||||
Resources introduced in kraken.
|
||||
Resources introduced in Gingerbread.
|
||||
=============================================================== -->
|
||||
|
||||
<public type="attr" name="logo" id="0x010102be" />
|
||||
@ -1273,5 +1273,4 @@
|
||||
<public-padding type="dimen" name="kraken_resource_pad" end="0x01050010" />
|
||||
<public-padding type="color" name="kraken_resource_pad" end="0x01060020" />
|
||||
<public-padding type="array" name="kraken_resource_pad" end="0x01070010" />
|
||||
|
||||
</resources>
|
||||
|
@ -1854,23 +1854,17 @@
|
||||
<string name="selectAll">Select all</string>
|
||||
|
||||
<!-- Item on EditText context menu. This action is used to start selecting text in the edit field. -->
|
||||
<string name="selectText">Select text</string>
|
||||
<string name="selectText">Select word</string>
|
||||
|
||||
<!-- Item on EditText context menu. This action is used to start selecting text in the edit field. -->
|
||||
<!-- Item on EditText context menu. This action is used to stop selecting text in the edit field. -->
|
||||
<string name="stopSelectingText">Stop selecting text</string>
|
||||
|
||||
<!-- Item on EditText context menu. This action is used to cut selected the text into the clipboard. -->
|
||||
<string name="cut">Cut</string>
|
||||
|
||||
<!-- Item on EditText context menu. This action is used to cut all the text into the clipboard. -->
|
||||
<string name="cutAll">Cut all</string>
|
||||
|
||||
<!-- Item on EditText context menu. This action is used to cut selected the text into the clipboard. -->
|
||||
<string name="copy">Copy</string>
|
||||
|
||||
<!-- Item on EditText context menu. This action is used to copy all the text into the clipboard. -->
|
||||
<string name="copyAll">Copy all</string>
|
||||
|
||||
<!-- Item on EditText context menu. This action is used t o paste from the clipboard into the eidt field -->
|
||||
<string name="paste">Paste</string>
|
||||
|
||||
|
@ -75,6 +75,7 @@ public final class Rect implements Parcelable {
|
||||
bottom = r.bottom;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
Rect r = (Rect) obj;
|
||||
if (r != null) {
|
||||
@ -84,6 +85,7 @@ public final class Rect implements Parcelable {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder(32);
|
||||
sb.append("Rect("); sb.append(left); sb.append(", ");
|
||||
@ -351,7 +353,7 @@ public final class Rect implements Parcelable {
|
||||
* rectangle, return true and set this rectangle to that intersection,
|
||||
* otherwise return false and do not change this rectangle. No check is
|
||||
* performed to see if either rectangle is empty. Note: To just test for
|
||||
* intersection, use intersects()
|
||||
* intersection, use {@link #intersects(Rect, Rect)}.
|
||||
*
|
||||
* @param left The left side of the rectangle being intersected with this
|
||||
* rectangle
|
||||
@ -445,7 +447,7 @@ public final class Rect implements Parcelable {
|
||||
/**
|
||||
* Returns true iff the two specified rectangles intersect. In no event are
|
||||
* either of the rectangles modified. To record the intersection,
|
||||
* use intersect() or setIntersect().
|
||||
* use {@link #intersect(Rect)} or {@link #setIntersect(Rect, Rect)}.
|
||||
*
|
||||
* @param a The first rectangle being tested for intersection
|
||||
* @param b The second rectangle being tested for intersection
|
||||
|
Reference in New Issue
Block a user