Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use view.getPaddingStart() directly #45150

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ package com.facebook.react.modules.i18nmanager

import android.content.Context
import android.content.pm.ApplicationInfo
import android.view.View
import androidx.core.text.TextUtilsCompat
import androidx.core.view.ViewCompat
import java.util.Locale

public class I18nUtil private constructor() {
Expand Down Expand Up @@ -63,7 +63,7 @@ public class I18nUtil private constructor() {
// Check if the current device language is RTL
get() {
val directionality = TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault())
return directionality == ViewCompat.LAYOUT_DIRECTION_RTL
return directionality == View.LAYOUT_DIRECTION_RTL
}

private fun isPrefSet(context: Context, key: String, defaultValue: Boolean): Boolean =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import android.graphics.Point
import android.view.View
import android.view.ViewGroup
import android.widget.OverScroller
import androidx.core.view.ViewCompat
import com.facebook.common.logging.FLog
import com.facebook.react.bridge.ReactContext
import com.facebook.react.bridge.WritableMap
Expand Down Expand Up @@ -434,10 +433,7 @@ public object ReactScrollViewHelper {
scroller.setFriction(1.0f - scrollState.decelerationRate)

// predict where a fling would end up so we can scroll to the nearest snap offset
val width =
(scrollView.width -
ViewCompat.getPaddingStart(scrollView) -
ViewCompat.getPaddingEnd(scrollView))
val width = scrollView.width - scrollView.getPaddingStart() - scrollView.getPaddingEnd()
val height = scrollView.height - scrollView.paddingBottom - scrollView.paddingTop
val finalAnimatedPositionScroll = scrollState.finalAnimatedPositionScroll
scroller.fling(
Expand Down
Loading