diff options
-rw-r--r-- | core/java/android/widget/TextView.java | 36 | ||||
-rw-r--r-- | core/res/res/values-en-rAU/strings.xml | 2 | ||||
-rw-r--r-- | core/res/res/values-en-rSG/strings.xml | 2 | ||||
-rw-r--r-- | core/res/res/values-en-rUS/strings.xml | 2 |
4 files changed, 16 insertions, 26 deletions
diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 25c5b24..c0d0ba1 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -18,11 +18,8 @@ package android.widget; import com.android.internal.util.FastMath; import com.android.internal.widget.EditableInputConnection; +import com.example.android.apis.text.Marquee; -import org.xmlpull.v1.XmlPullParserException; - -import android.content.ClipboardManager; -import android.content.ClippedData; import android.content.Context; import android.content.pm.PackageManager; import android.content.res.ColorStateList; @@ -44,7 +41,10 @@ import android.os.Parcel; import android.os.Parcelable; import android.os.ResultReceiver; import android.os.SystemClock; +import android.provider.Mtp.Object; +import android.provider.Settings.System; import android.text.BoringLayout; +import android.text.ClipboardManager; import android.text.DynamicLayout; import android.text.Editable; import android.text.GetChars; @@ -85,7 +85,6 @@ import android.util.AttributeSet; import android.util.FloatMath; import android.util.Log; import android.util.TypedValue; -import android.view.ActionMode; import android.view.ContextMenu; import android.view.Gravity; import android.view.HapticFeedbackConstants; @@ -97,9 +96,10 @@ import android.view.MotionEvent; import android.view.View; import android.view.ViewConfiguration; import android.view.ViewDebug; -import android.view.ViewGroup.LayoutParams; import android.view.ViewRoot; import android.view.ViewTreeObserver; +import android.view.View.MeasureSpec; +import android.view.ViewGroup.LayoutParams; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; import android.view.animation.AnimationUtils; @@ -112,10 +112,6 @@ import android.view.inputmethod.InputConnection; import android.view.inputmethod.InputMethodManager; import android.widget.RemoteViews.RemoteView; -import java.io.IOException; -import java.lang.ref.WeakReference; -import java.util.ArrayList; - /** * Displays text to the user and optionally allows them to edit it. A TextView * is a complete text editor, however the basic class is configured to not @@ -7271,17 +7267,16 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * this will be {@link android.R.id#copyUrl} or {@link android.R.id#selectTextMode}. */ public boolean onTextContextMenuItem(int id) { - int selStart = getSelectionStart(); - int selEnd = getSelectionEnd(); - - if (!isFocused()) { - selStart = 0; - selEnd = mText.length(); + int min = 0; + int max = mText.length(); + + if (isFocused()) { + int selStart = getSelectionStart(); + int selEnd = getSelectionEnd(); + min = Math.max(0, Math.min(selStart, selEnd)); + max = Math.max(0, Math.max(selStart, selEnd)); } - int min = Math.max(0, Math.min(selStart, selEnd)); - int max = Math.max(0, Math.max(selStart, selEnd)); - ClipboardManager clipboard = (ClipboardManager)getContext() .getSystemService(Context.CLIPBOARD_SERVICE); @@ -7955,7 +7950,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return; } - boolean oneLineSelection = mLayout.getLineForOffset(selectionStart) == mLayout.getLineForOffset(selectionEnd); + boolean oneLineSelection = + mLayout.getLineForOffset(selectionStart) == mLayout.getLineForOffset(selectionEnd); mStartHandle.positionAtCursor(selectionStart, oneLineSelection); mEndHandle.positionAtCursor(selectionEnd, true); diff --git a/core/res/res/values-en-rAU/strings.xml b/core/res/res/values-en-rAU/strings.xml index 3de378b..1cbfbba 100644 --- a/core/res/res/values-en-rAU/strings.xml +++ b/core/res/res/values-en-rAU/strings.xml @@ -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 /> diff --git a/core/res/res/values-en-rSG/strings.xml b/core/res/res/values-en-rSG/strings.xml index 2ec6b0b..09a8490 100644 --- a/core/res/res/values-en-rSG/strings.xml +++ b/core/res/res/values-en-rSG/strings.xml @@ -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 /> diff --git a/core/res/res/values-en-rUS/strings.xml b/core/res/res/values-en-rUS/strings.xml index 05f30fc..fdc0d69 100644 --- a/core/res/res/values-en-rUS/strings.xml +++ b/core/res/res/values-en-rUS/strings.xml @@ -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 /> |