Commit 1e4acffa authored by Amit Kumar's avatar Amit Kumar 💻
Browse files

Don't invalidate as it cause crash

parent bb94711e
Pipeline #138237 passed with stage
in 8 minutes and 52 seconds
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<targetSelectedWithDropDown>
<runningDeviceTargetSelectedWithDropDown>
<Target>
<type value="QUICK_BOOT_TARGET" />
<type value="RUNNING_DEVICE_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="$USER_HOME$/.android/avd/Pixel_3a_XL_API_29.avd" />
<type value="SERIAL_NUMBER" />
<value value="ZF65256BV3" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2021-08-08T17:07:28.754132Z" />
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2021-09-30T08:05:54.967084Z" />
</component>
</project>
\ No newline at end of file
......@@ -1586,8 +1586,6 @@ public class LauncherPagedView extends PagedView<PageIndicatorDots> implements V
}
//Add animation here.
dragView.remove();
dragView = null;
invalidate();
updateDatabase(getWorkspaceAndHotseatCellLayouts());
post(() -> {
if (fi.cell % 2 == 0) {
......@@ -1634,7 +1632,6 @@ public class LauncherPagedView extends PagedView<PageIndicatorDots> implements V
//Add animation here.
d.dragView.remove();
d.dragView = null;
invalidate();
updateDatabase(getWorkspaceAndHotseatCellLayouts());
return true;
}
......
......@@ -11,6 +11,8 @@ import android.graphics.Color
import android.graphics.Paint
import android.graphics.Point
import android.graphics.Rect
import android.os.Handler
import android.os.Looper
import android.util.ArrayMap
import android.util.AttributeSet
import android.view.View
......@@ -847,16 +849,24 @@ open class CellLayout @JvmOverloads constructor(
)
}*/
if ((mode == MODE_ON_DROP)) {
if (index % 2 == 0) {
dragView.startAnimation(AnimationUtils.loadAnimation(context, R.anim.wobble))
} else {
dragView.startAnimation(
AnimationUtils.loadAnimation(
context,
R.anim.wobble_reverse
val handler = Handler(Looper.getMainLooper())
handler.post {
if ((mode == MODE_ON_DROP)) {
if (index % 2 == 0) {
dragView.startAnimation(
AnimationUtils.loadAnimation(
context,
R.anim.wobble
)
)
)
} else {
dragView.startAnimation(
AnimationUtils.loadAnimation(
context,
R.anim.wobble_reverse
)
)
}
}
}
}
......
......@@ -71,7 +71,7 @@ public class InterruptibleInOutAnimator {
cancel();
// TODO: We don't really need to do the animation if startValue == toValue, but
// somehow that doesn't seem to work, possibly a quirk of the animation framework
// somehow that doesn't seem to work, possibly a quirk of the animation framework
mDirection = direction;
// Ensure we don't calculate a non-sensical duration
......
......@@ -337,10 +337,8 @@ public class DragController implements DragDriver.EventListener, TouchController
*/
private int[] getClampedDragLayerPos(float x, float y) {
mLauncher.getDragLayer().getLocalVisibleRect(mDragLayerRect);
Log.d("DragController", "Rect: "+mDragLayerRect);
mTmpPoint[0] = (int) Math.max(mDragLayerRect.left, Math.min(x, mDragLayerRect.right - 1));
mTmpPoint[1] = (int) Math.max(mDragLayerRect.top, Math.min(y, mDragLayerRect.bottom - 1));
Log.d("DragController", "TmpPoint: "+mTmpPoint[0]+", "+mTmpPoint[1]);
return mTmpPoint;
}
......
......@@ -25,6 +25,8 @@ import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.os.Handler;
import android.os.Looper;
import android.util.AttributeSet;
import android.util.Log;
import android.view.KeyEvent;
......@@ -95,7 +97,7 @@ public class DragLayer extends BaseDragLayer<TestActivity> {
}
public void recreateControllers() {
mControllers = new TouchController[] {
mControllers = new TouchController[]{
mActivity.getDragController()};
}
......@@ -275,11 +277,12 @@ public class DragLayer extends BaseDragLayer<TestActivity> {
);*/
// Show the drop view if it was previously hidden
mDropView = dragView;
mDropView.requestLayout();
child.setVisibility(VISIBLE);
//mDropView.requestLayout();
if (mDropView != null) {
mDragController.onDeferredEndDrag(mDropView);
}
Handler mainHandler = new Handler(Looper.getMainLooper());
mainHandler.post(() -> child.setVisibility(VISIBLE));
mDropView = null;
invalidate();
}
......@@ -293,7 +296,8 @@ public class DragLayer extends BaseDragLayer<TestActivity> {
Rect from = new Rect(fromX, fromY, fromX +
view.getMeasuredWidth(), fromY + view.getMeasuredHeight());
Rect to = new Rect(toX, toY, toX + view.getMeasuredWidth(), toY + view.getMeasuredHeight());
animateView(view,
animateView(
view,
from,
to,
finalAlpha,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment