Skip to content

Commit

Permalink
Remove usage of deprecated ScrollerCompat
Browse files Browse the repository at this point in the history
  • Loading branch information
Jawnnypoo committed Jan 18, 2024
1 parent 76c3882 commit 96caf20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 0 additions & 3 deletions translationviewdraghelper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@ dependencies {
mavenPublishing {
configure(
AndroidSingleVariantLibrary(
// the published variant
variant = "release",
// whether to publish a sources jar
sourcesJar = true,
// whether to publish a javadoc jar
publishJavadocJar = true,
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import android.view.View
import android.view.ViewConfiguration
import android.view.ViewGroup
import android.view.animation.Interpolator
import android.widget.OverScroller
import androidx.core.view.MotionEventCompat
import androidx.core.view.VelocityTrackerCompat
import androidx.core.view.ViewCompat
import androidx.core.widget.ScrollerCompat
import java.util.Arrays
import kotlin.math.abs
import kotlin.math.roundToInt
Expand Down Expand Up @@ -220,7 +220,7 @@ private constructor(

private var trackingEdges: Int = 0

private val scroller: ScrollerCompat
private val scroller: OverScroller

/**
* @return The currently captured view, or null if no view has been captured.
Expand All @@ -239,7 +239,6 @@ private constructor(
* about the state of the parent view upon request. The callback also makes decisions
* governing the range and draggability of child views.
*/
@Suppress("UNUSED_PARAMETER")
abstract class Callback {
/**
* Called when the drag state changes. See the `STATE_*` constants
Expand Down Expand Up @@ -434,7 +433,7 @@ private constructor(
touchSlop = vc.scaledTouchSlop
maxVelocity = vc.scaledMaximumFlingVelocity.toFloat()
minVelocity = vc.scaledMinimumFlingVelocity.toFloat()
scroller = ScrollerCompat.create(context, interpolator)
scroller = OverScroller(context, interpolator)
}

/**
Expand Down

0 comments on commit 96caf20

Please sign in to comment.