diff options
| author | Mady Mellor <madym@google.com> | 2015-05-14 12:41:18 -0700 |
|---|---|---|
| committer | Mady Mellor <madym@google.com> | 2015-05-15 15:51:47 -0700 |
| commit | 709386f501c5a496c8bbfa0336af03f3e09e5484 (patch) | |
| tree | c352bfdd7c39aa39819b42ad6ddb0c090e71db93 /core/java | |
| parent | 2a576d9ec1ec353ee2278f2da01e685b6b7b24ee (diff) | |
Fix selection handles on older API versions
The new assets didn't have the same padding on the edges as assets on older
versions. The adjustments to the getHotspotX code for the new assets broke
how the handles on older API versions were placed.
This CL updates the assets to have the same padding (i.e. handleWidth / 2
on each side of the handle and changes the getHotspotX methods for this.
Bug: 20829391
Change-Id: If7e466d200ef7757831bc763c3c3ce4a8bbf63fc
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/widget/Editor.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/core/java/android/widget/Editor.java b/core/java/android/widget/Editor.java index 1d6f6dceae08..878cbf29bd67 100644 --- a/core/java/android/widget/Editor.java +++ b/core/java/android/widget/Editor.java @@ -3888,7 +3888,11 @@ public class Editor { @Override protected int getHotspotX(Drawable drawable, boolean isRtlRun) { - return isRtlRun ? 0 : drawable.getIntrinsicWidth(); + if (isRtlRun) { + return drawable.getIntrinsicWidth() / 4; + } else { + return (drawable.getIntrinsicWidth() * 3) / 4; + } } @Override @@ -4006,7 +4010,11 @@ public class Editor { @Override protected int getHotspotX(Drawable drawable, boolean isRtlRun) { - return isRtlRun ? drawable.getIntrinsicWidth() : 0; + if (isRtlRun) { + return (drawable.getIntrinsicWidth() * 3) / 4; + } else { + return drawable.getIntrinsicWidth() / 4; + } } @Override |
