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

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

Issue 481683003: Support for Adaptive Handle Orientation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Initial patchset Created 5 years, 9 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/PopupTouchHandleDrawable.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java b/content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java
index 56a74a86d02612a88f3eab310031a593996f1b4d..b961b050025a2c6f1bd6428eb9f3c45cec27c7b6 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/PopupTouchHandleDrawable.java
@@ -156,28 +156,78 @@ public class PopupTouchHandleDrawable extends View {
switch (orientation) {
case TouchHandleOrientation.LEFT: {
- mDrawable = HandleViewResources.getLeftHandleDrawable(mContext);
+ mDrawable = HandleViewResources.getLeftHandleDrawable(mContext, false);
mHotspotX = (mDrawable.getIntrinsicWidth() * 3) / 4f;
+ mHotspotY = 0;
break;
}
case TouchHandleOrientation.RIGHT: {
- mDrawable = HandleViewResources.getRightHandleDrawable(mContext);
+ mDrawable = HandleViewResources.getRightHandleDrawable(mContext, false);
mHotspotX = mDrawable.getIntrinsicWidth() / 4f;
+ mHotspotY = 0;
break;
}
case TouchHandleOrientation.CENTER: {
- mDrawable = HandleViewResources.getCenterHandleDrawable(mContext);
+ mDrawable = HandleViewResources.getCenterHandleDrawable(mContext, false);
mHotspotX = mDrawable.getIntrinsicWidth() / 2f;
+ mHotspotY = 0;
break;
}
+ case TouchHandleOrientation.LEFT_INVERTED: {
+ mDrawable = HandleViewResources.getRightHandleDrawable(mContext, true);
+ mHotspotX = (mDrawable.getIntrinsicWidth() * 3) / 4f;
+ mHotspotY = mDrawable.getIntrinsicHeight();
+ break;
+ }
+
+ case TouchHandleOrientation.RIGHT_INVERTED: {
+ mDrawable = HandleViewResources.getLeftHandleDrawable(mContext, true);
+ mHotspotX = mDrawable.getIntrinsicWidth() / 4f;
+ mHotspotY = mDrawable.getIntrinsicHeight();
+ break;
+ }
+
+ case TouchHandleOrientation.LEFT_FLIPPED: {
+ mDrawable = HandleViewResources.getRightHandleDrawable(mContext, false);
+ mHotspotX = mDrawable.getIntrinsicWidth() / 4f;
+ mHotspotY = 0;
+ break;
+ }
+
+ case TouchHandleOrientation.RIGHT_FLIPPED: {
+ mDrawable = HandleViewResources.getLeftHandleDrawable(mContext, false);
+ mHotspotX = (mDrawable.getIntrinsicWidth() * 3) / 4f;
+ mHotspotY = 0;
+ break;
+ }
+
+ case TouchHandleOrientation.LEFT_FLIPPED_INVERTED: {
+ mDrawable = HandleViewResources.getLeftHandleDrawable(mContext, true);
+ mHotspotX = mDrawable.getIntrinsicWidth() / 4f;
+ mHotspotY = mDrawable.getIntrinsicHeight();
+ break;
+ }
+
+ case TouchHandleOrientation.RIGHT_FLIPPED_INVERTED: {
+ mDrawable = HandleViewResources.getRightHandleDrawable(mContext, true);
+ mHotspotX = (mDrawable.getIntrinsicWidth() * 3) / 4f;
+ mHotspotY = mDrawable.getIntrinsicHeight();
+ break;
+ }
+
+ case TouchHandleOrientation.CENTER_INVERTED: {
+ mDrawable = HandleViewResources.getCenterHandleDrawable(mContext, true);
+ mHotspotX = mDrawable.getIntrinsicWidth() / 2f;
+ mHotspotY = mDrawable.getIntrinsicHeight();
+ break;
+ }
case TouchHandleOrientation.UNDEFINED:
default:
break;
}
- mHotspotY = 0;
// Force handle repositioning to accommodate the new orientation's hotspot.
if (hadValidOrientation) setFocus(oldAdjustedPositionX, oldAdjustedPositionY);

Powered by Google App Engine
This is Rietveld 408576698