Merge "TextView with Selection Contextual Mode"

This commit is contained in:
Gilles Debunne
2010-07-28 15:49:40 -07:00
committed by Android (Google) Code Review
6 changed files with 477 additions and 372 deletions

View File

@ -14812,6 +14812,17 @@
visibility="public"
>
</field>
<field name="selectTextMode"
type="int"
transient="false"
volatile="false"
value="16908354"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="selectedIcon"
type="int"
transient="false"
@ -15931,6 +15942,17 @@
visibility="public"
>
</field>
<field name="selectTextMode"
type="int"
transient="false"
volatile="false"
value="17039408"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="unknownName"
type="int"
transient="false"

View File

@ -2510,11 +2510,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);
@ -4359,6 +4358,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

View File

@ -59,6 +59,7 @@
<item type="id" name="copy" />
<item type="id" name="paste" />
<item type="id" name="copyUrl" />
<item type="id" name="selectTextMode" />
<item type="id" name="switchInputMethod" />
<item type="id" name="keyboardView" />
<item type="id" name="closeButton" />

View File

@ -1311,6 +1311,9 @@
<public type="attr" name="windowActionModeOverlay" />
<public type="id" name="home" />
<!-- Context menu ID for the "Select text..." menu item to switch to text
selection context mode in text views. -->
<public type="id" name="selectTextMode" />
<public type="style" name="Theme.WithActionBar" />
<public type="style" name="Widget.Spinner.DropDown" />
@ -1323,5 +1326,6 @@
content to still retain all of the standard functionality of
the base class. -->
<public type="layout" name="list_content" />
<public type="string" name="selectTextMode" id="0x01040030" />
</resources>

View File

@ -1870,39 +1870,29 @@
<!-- Item on EditText context menu. This action is used to select all text in the edit field. -->
<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>
<!-- Item on EditText context menu. This action is used to start 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>
<!-- Item on EditText context menu. This action is used to copy a URL from the edit field into the clipboard. -->
<string name="copyUrl">Copy URL</string>
<!-- Item on EditText context menu. Added only when the context menu is not empty, it enable selection context mode. -->
<string name="selectTextMode">Select text...</string>
<!-- Text selection contextual mode title, displayed in the CAB.. -->
<string name="textSelectionCABTitle">Text selection</string>
<!-- EditText context menu -->
<string name="inputMethod">Input method</string>
<!-- Item on EditText context menu, used to add a word to the
input method dictionary. -->
<string name="addToDictionary">"Add \"<xliff:g id="word" example="rickroll">%s</xliff:g>\" to dictionary</string>
<!-- Title for EditText context menu -->
<string name="editTextMenuTitle">Edit text</string>
<string name="editTextMenuTitle">Text actions</string>
<!-- If the device is getting low on internal storage, a notification is shown to the user. This is the title of that notification. -->
<string name="low_internal_storage_view_title">Low on space</string>