Skip to content

Commit

Permalink
increase XY dragging threshold of the bubble
Browse files Browse the repository at this point in the history
  • Loading branch information
dofire committed Feb 24, 2024
1 parent dbd83b1 commit f16844f
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Point
import android.graphics.PointF
import android.util.Log
import android.view.*
import androidx.dynamicanimation.animation.SpringAnimation
import androidx.dynamicanimation.animation.SpringForce
Expand Down Expand Up @@ -160,12 +161,17 @@ class FloatingBubble(
)
}

private val MAX_XY_MOVE = 1f
private var MAX_XY_MOVE = 5f
private var ignoreClick: Boolean = false

@SuppressLint("ClickableViewAccessibility")
private fun customTouch() {

// val smallestWidth = context.resources.configuration.smallestScreenWidthDp
// Log.d("<> smallest width", smallestWidth.toString())
// MAX_XY_MOVE = smallestWidth / 30f
// Log.d("<> MAX XY move", MAX_XY_MOVE.toString())

fun handleMovement(event: MotionEvent) {
when (event.action) {
MotionEvent.ACTION_DOWN -> {
Expand Down

4 comments on commit f16844f

@thproflord
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this fix the issue with touching and dragging? that is a bit difficult to have to touch instead of the dragging effect?

@dofire
Copy link
Owner Author

@dofire dofire commented on f16844f Mar 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thproflord are you facing the same issue as this one? If yes then could you run this branch on your device then share your feedback?

@thproflord
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes the exact problem, touch the bubble looks like is ignore and makes it draggable, I'll give it a try
what iis the version to change my import

@thproflord
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen_Recording_20240312_115743_Floating-Bubble-View.mp4

works better but the close button keeps showing, for me is not a big deal because I don't use that button, but if clicking should not appear

Please sign in to comment.