Skip to content

Commit b9ec0e5

Browse files
Peng Jiangfacebook-github-bot
authored andcommitted
use view.getPaddingStart() directly (#45150)
Summary: Pull Request resolved: #45150 As the androidx.core 1.13.1 change, ViewCompact.getPaddingStart and getPaddingEnd are deprecated. based on the suggestion from https://developer.android.com/reference/kotlin/androidx/core/view/ViewCompat#getPaddingStart(android.view.View), use: view.getPaddingStart and view.getPaddingEnd directly. {F1717102270} Changelog: [Internal] - Migrating deprecated APIs with AndroidX.Core 1.13.1 Reviewed By: alanleedev Differential Revision: D58955567 fbshipit-source-id: b84377e1ded0d94e9035dcfa4dbd9c463396a322
1 parent 71f8d76 commit b9ec0e5

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewHelper.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import android.graphics.Point
1414
import android.view.View
1515
import android.view.ViewGroup
1616
import android.widget.OverScroller
17-
import androidx.core.view.ViewCompat
1817
import com.facebook.common.logging.FLog
1918
import com.facebook.react.bridge.ReactContext
2019
import com.facebook.react.bridge.WritableMap
@@ -434,10 +433,7 @@ public object ReactScrollViewHelper {
434433
scroller.setFriction(1.0f - scrollState.decelerationRate)
435434

436435
// predict where a fling would end up so we can scroll to the nearest snap offset
437-
val width =
438-
(scrollView.width -
439-
ViewCompat.getPaddingStart(scrollView) -
440-
ViewCompat.getPaddingEnd(scrollView))
436+
val width = scrollView.width - scrollView.getPaddingStart() - scrollView.getPaddingEnd()
441437
val height = scrollView.height - scrollView.paddingBottom - scrollView.paddingTop
442438
val finalAnimatedPositionScroll = scrollState.finalAnimatedPositionScroll
443439
scroller.fling(

0 commit comments

Comments
 (0)