| Chunk |
|---|
| Conflicting content |
|---|
params;
frameParams.gravity = Gravity.RIGHT;
}
<<<<<<< HEAD
=======
updateMultiTouchSupport(context);
}
void updateMultiTouchSupport(Context context) {
WebSettings settings = getSettings();
mSupportMultiTouch = context.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH)
&& settings.supportZoom() && settings.getBuiltInZoomControls();
if (mSupportMultiTouch && (mScaleDetector == null)) {
mScaleDetector = new ScaleGestureDetector(context,
new ScaleDetectorListener());
} else if (!mSupportMultiTouch && (mScaleDetector != null)) {
mScaleDetector = null;
}
>>>>>>> 181963a0200e7c442d66f9f893da41e2b52a4d8c
}
private void updateZoomButtonsEnabled() { |
| Solution content |
|---|
params;
frameParams.gravity = Gravity.RIGHT;
}
}
private void updateZoomButtonsEnabled() { |
| File |
|---|
| WebView.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Attribute |
| If statement |
| Method invocation |
| Method signature |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
private final float mMaxDY, mMaxDX;
private static final float MAX_SLOPE_FOR_DIAG = 1.5f;
private static final int MIN_BREAK_SNAP_CROSS_DISTANCE = 80;
<<<<<<< HEAD
private static int sign(float x) {
return x > 0 ? 1 : (x < 0 ? -1 : 0);
}
// if the page can scroll <= this value, we won't allow the drag tracker
// to have any effect.
private static final int MIN_SCROLL_AMOUNT_TO_DISABLE_DRAG_TRACKER = 4;
private class DragTrackerHandler {
private final DragTracker mProxy;
private final float mStartY, mStartX;
private final float mMinDY, mMinDX;
private float mCurrStretchY, mCurrStretchX;
private int mSX, mSY;
public DragTrackerHandler(float x, float y, DragTracker proxy) {
mProxy = proxy;
int docBottom = computeVerticalScrollRange() + getTitleHeight();
int viewTop = getScrollY();
int viewBottom = viewTop + getHeight();
mStartY = y;
mMinDY = -viewTop;
mMaxDY = docBottom - viewBottom;
if (DebugFlags.DRAG_TRACKER || DEBUG_DRAG_TRACKER) {
Log.d(DebugFlags.DRAG_TRACKER_LOGTAG, " dragtracker y= " + y +
" up/down= " + mMinDY + " " + mMaxDY);
}
int docRight = computeHorizontalScrollRange();
int viewLeft = getScrollX();
int viewRight = viewLeft + getWidth();
mStartX = x;
mMinDX = -viewLeft;
mMaxDX = docRight - viewRight;
mProxy.onStartDrag(x, y);
// ensure we buildBitmap at least once
mSX = -99999;
}
private float computeStretch(float delta, float min, float max) {
float stretch = 0;
if (max - min > MIN_SCROLL_AMOUNT_TO_DISABLE_DRAG_TRACKER) {
if (delta < min) {
stretch = delta - min;
} else if (delta > max) {
stretch = delta - max;
}
=======
private class ScaleDetectorListener implements
ScaleGestureDetector.OnScaleGestureListener {
public boolean onScaleBegin(ScaleGestureDetector detector) {
// cancel the single touch handling
cancelTouch();
// reset the zoom overview mode so that the page won't auto grow
mInZoomOverview = false;
// If it is in password mode, turn it off so it does not draw
// misplaced.
if (inEditingMode() && nativeFocusCandidateIsPassword()) {
mWebTextView.setInPassword(false);
}
return true;
}
public void onScaleEnd(ScaleGestureDetector detector) {
if (mPreviewZoomOnly) {
mPreviewZoomOnly = false;
mAnchorX = viewToContentX((int) mZoomCenterX + mScrollX);
mAnchorY = viewToContentY((int) mZoomCenterY + mScrollY);
// for testing only, default don't reflow now
boolean reflowNow = !getSettings().getPluginsEnabled();
// force zoom after mPreviewZoomOnly is set to false so that the
// new view size will be passed to the WebKit
setNewZoomScale(mActualScale, reflowNow, true);
// call invalidate() to draw without zoom filter
invalidate();
>>>>>>> 181963a0200e7c442d66f9f893da41e2b52a4d8c
}
return stretch;
} |
| Solution content |
|---|
private static final float MAX_SLOPE_FOR_DIAG = 1.5f;
private static final int MIN_BREAK_SNAP_CROSS_DISTANCE = 80;
private static int sign(float x) {
return x > 0 ? 1 : (x < 0 ? -1 : 0);
}
// if the page can scroll <= this value, we won't allow the drag tracker
// to have any effect.
private static final int MIN_SCROLL_AMOUNT_TO_DISABLE_DRAG_TRACKER = 4;
private class DragTrackerHandler {
private final DragTracker mProxy;
private final float mStartY, mStartX;
private final float mMinDY, mMinDX;
private final float mMaxDY, mMaxDX;
private float mCurrStretchY, mCurrStretchX;
private int mSX, mSY;
public DragTrackerHandler(float x, float y, DragTracker proxy) {
mProxy = proxy;
int docBottom = computeVerticalScrollRange() + getTitleHeight();
int viewTop = getScrollY();
int viewBottom = viewTop + getHeight();
mStartY = y;
mMinDY = -viewTop;
mMaxDY = docBottom - viewBottom;
if (DebugFlags.DRAG_TRACKER || DEBUG_DRAG_TRACKER) {
Log.d(DebugFlags.DRAG_TRACKER_LOGTAG, " dragtracker y= " + y +
" up/down= " + mMinDY + " " + mMaxDY);
}
int docRight = computeHorizontalScrollRange();
int viewLeft = getScrollX();
int viewRight = viewLeft + getWidth();
mStartX = x;
mMinDX = -viewLeft;
mMaxDX = docRight - viewRight;
mProxy.onStartDrag(x, y);
// ensure we buildBitmap at least once
mSX = -99999;
}
private float computeStretch(float delta, float min, float max) {
float stretch = 0;
if (max - min > MIN_SCROLL_AMOUNT_TO_DISABLE_DRAG_TRACKER) {
if (delta < min) {
stretch = delta - min;
} else if (delta > max) {
stretch = delta - max;
}
}
return stretch;
} |
| File |
|---|
| WebView.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Attribute |
| Class signature |
| Comment |
| If statement |
| Method declaration |
| Method invocation |
| Method signature |
| Variable |
| Chunk |
|---|
| Conflicting content |
|---|
invalidate();
}
}
<<<<<<< HEAD
}
public void stopDrag() {
if (DebugFlags.DRAG_TRACKER || DEBUG_DRAG_TRACKER) {
Log.d(DebugFlags.DRAG_TRACKER_LOGTAG, "----- stopDrag");
}
mProxy.onStopDrag();
}
private int hiddenHeightOfTitleBar() {
return getTitleHeight() - getVisibleTitleHeight();
}
// need a way to know if 565 or 8888 is the right config for
// capturing the display and giving it to the drag proxy
private Bitmap.Config offscreenBitmapConfig() {
// hard code 565 for now
return Bitmap.Config.RGB_565;
}
/* If the tracker draws, then this returns true, otherwise it will
return false, and draw nothing.
*/
public boolean draw(Canvas canvas) {
if (mCurrStretchX != 0 || mCurrStretchY != 0) {
int sx = getScrollX();
int sy = getScrollY() - hiddenHeightOfTitleBar();
if (mSX != sx || mSY != sy) {
buildBitmap(sx, sy);
mSX = sx;
mSY = sy;
}
int count = canvas.save(Canvas.MATRIX_SAVE_FLAG);
canvas.translate(sx, sy);
mProxy.onDraw(canvas);
canvas.restoreToCount(count);
return true;
}
if (DebugFlags.DRAG_TRACKER || DEBUG_DRAG_TRACKER) {
Log.d(DebugFlags.DRAG_TRACKER_LOGTAG, " -- draw false " +
mCurrStretchX + " " + mCurrStretchY);
}
return false;
}
private void buildBitmap(int sx, int sy) {
int w = getWidth();
int h = getViewHeight();
Bitmap bm = Bitmap.createBitmap(w, h, offscreenBitmapConfig());
Canvas canvas = new Canvas(bm);
canvas.translate(-sx, -sy);
drawContent(canvas);
if (DebugFlags.DRAG_TRACKER || DEBUG_DRAG_TRACKER) {
Log.d(DebugFlags.DRAG_TRACKER_LOGTAG, "--- buildBitmap " + sx +
" " + sy + " " + w + " " + h);
}
mProxy.onBitmapChange(bm);
}
=======
// start a drag, TOUCH_PINCH_DRAG, can't use TOUCH_INIT_MODE as it
// may trigger the unwanted click, can't use TOUCH_DRAG_MODE as it
// may trigger the unwanted fling.
mTouchMode = TOUCH_PINCH_DRAG;
startTouch(detector.getFocusX(), detector.getFocusY(),
mLastTouchTime);
}
public boolean onScale(ScaleGestureDetector detector) {
float scale = (float) (Math.round(detector.getScaleFactor()
* mActualScale * 100) / 100.0);
if (Math.abs(scale - mActualScale) >= PREVIEW_SCALE_INCREMENT) {
mPreviewZoomOnly = true;
// limit the scale change per step
if (scale > mActualScale) {
scale = Math.min(scale, mActualScale * 1.25f);
} else {
scale = Math.max(scale, mActualScale * 0.8f);
}
mZoomCenterX = detector.getFocusX();
mZoomCenterY = detector.getFocusY();
setNewZoomScale(scale, false, false);
invalidate();
return true;
}
return false;
}
>>>>>>> 181963a0200e7c442d66f9f893da41e2b52a4d8c
}
/** @hide */ |
| Solution content |
|---|
invalidate();
}
}
}
public void stopDrag() {
if (DebugFlags.DRAG_TRACKER || DEBUG_DRAG_TRACKER) {
Log.d(DebugFlags.DRAG_TRACKER_LOGTAG, "----- stopDrag");
}
mProxy.onStopDrag();
}
private int hiddenHeightOfTitleBar() {
return getTitleHeight() - getVisibleTitleHeight();
}
// need a way to know if 565 or 8888 is the right config for
// capturing the display and giving it to the drag proxy
private Bitmap.Config offscreenBitmapConfig() {
// hard code 565 for now
return Bitmap.Config.RGB_565;
}
/* If the tracker draws, then this returns true, otherwise it will
return false, and draw nothing.
*/
public boolean draw(Canvas canvas) {
if (mCurrStretchX != 0 || mCurrStretchY != 0) {
int sx = getScrollX();
int sy = getScrollY() - hiddenHeightOfTitleBar();
if (mSX != sx || mSY != sy) {
buildBitmap(sx, sy);
mSX = sx;
mSY = sy;
}
int count = canvas.save(Canvas.MATRIX_SAVE_FLAG);
canvas.translate(sx, sy);
mProxy.onDraw(canvas);
canvas.restoreToCount(count);
return true;
}
if (DebugFlags.DRAG_TRACKER || DEBUG_DRAG_TRACKER) {
Log.d(DebugFlags.DRAG_TRACKER_LOGTAG, " -- draw false " +
mCurrStretchX + " " + mCurrStretchY);
}
return false;
}
private void buildBitmap(int sx, int sy) {
int w = getWidth();
int h = getViewHeight();
Bitmap bm = Bitmap.createBitmap(w, h, offscreenBitmapConfig());
Canvas canvas = new Canvas(bm);
canvas.translate(-sx, -sy);
drawContent(canvas);
if (DebugFlags.DRAG_TRACKER || DEBUG_DRAG_TRACKER) {
Log.d(DebugFlags.DRAG_TRACKER_LOGTAG, "--- buildBitmap " + sx +
" " + sy + " " + w + " " + h);
}
mProxy.onBitmapChange(bm);
}
}
/** @hide */ |
| File |
|---|
| WebView.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Attribute |
| Comment |
| Method declaration |
| Method invocation |
| Chunk |
|---|
| Conflicting content |
|---|
+ mTouchMode);
}
<<<<<<< HEAD
=======
// FIXME: we may consider to give WebKit an option to handle multi-touch
// events later.
if (mSupportMultiTouch && mMinZoomScale < mMaxZoomScale
&& ev.getPointerCount() > 1) {
mLastTouchTime = ev.getEventTime();
return mScaleDetector.onTouchEvent(ev);
}
>>>>>>> 181963a0200e7c442d66f9f893da41e2b52a4d8c
int action = ev.getAction();
float x = ev.getX();
float y = ev.getY(); |
| Solution content |
|---|
+ mTouchMode);
}
int action = ev.getAction();
float x = ev.getX();
float y = ev.getY(); |
| File |
|---|
| WebView.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| Comment |
| If statement |
| Chunk |
|---|
| Conflicting content |
|---|
} else {
mMaxZoomScale = restoreState.mMaxScale;
}
<<<<<<< HEAD
setNewZoomScale(mLastScale, false);
=======
if (mInitialScaleInPercent > 0) {
setNewZoomScale(mInitialScaleInPercent / 100.0f,
mInitialScaleInPercent != mTextWrapScale * 100,
false);
} else if (restoreState.mViewScale > 0) {
mTextWrapScale = restoreState.mTextWrapScale;
setNewZoomScale(restoreState.mViewScale, false,
false);
} else {
mInZoomOverview = useWideViewport
&& settings.getLoadWithOverviewMode();
float scale;
if (mInZoomOverview) {
scale = (float) viewWidth
/ WebViewCore.DEFAULT_VIEWPORT_WIDTH;
} else {
scale = restoreState.mTextWrapScale;
}
setNewZoomScale(scale, Math.abs(scale
- mTextWrapScale) >= 0.01f, false);
}
>>>>>>> 181963a0200e7c442d66f9f893da41e2b52a4d8c
setContentScrollTo(restoreState.mScrollX,
restoreState.mScrollY);
if (useWideViewport |
| Solution content |
|---|
} else {
mMaxZoomScale = restoreState.mMaxScale;
}
setNewZoomScale(mLastScale, false);
setContentScrollTo(restoreState.mScrollX,
restoreState.mScrollY);
if (useWideViewport |
| File |
|---|
| WebView.java |
| Developer's decision |
|---|
| Version 1 |
| Kind of conflict |
|---|
| If statement |
| Method invocation |