Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(523)

Unified Diff: content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java

Issue 481683003: Support for Adaptive Handle Orientation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java b/content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java
index 926cfceeb2fb12065ef956cb40cc11e7884cfdeb..a661af43e51adf1f19e6af6c40bcd258d6d90a55 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/HandleViewResources.java
@@ -21,6 +21,11 @@ import org.chromium.base.JNINamespace;
*/
@JNINamespace("content")
public class HandleViewResources {
+ // Android handle drawables have a transparent horizontal padding,
+ // which is one-fourth of the image. This variable is to take the
+ // padding into account while calculating the handle origin position.
+ private static final float HANDLE_HORIZONTAL_PADDING = 0.25f;
+
private static final int[] LEFT_HANDLE_ATTRS = {
android.R.attr.textSelectHandleLeft,
};
@@ -96,6 +101,11 @@ public class HandleViewResources {
}
@CalledByNative
+ public static float getHandleHorizontalPadding() {
+ return HANDLE_HORIZONTAL_PADDING;
+ }
+
+ @CalledByNative
private static Bitmap getLeftHandleBitmap(Context context) {
return getHandleBitmap(context, LEFT_HANDLE_ATTRS);
}

Powered by Google App Engine
This is Rietveld 408576698