Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

### 🐛 Bug fixes

- **Android**: Fixed `NoSuchMethodError` crash on Android < 11 (API 30) when presenting a sheet with grabber accessibility. ([#606](https://github.com/lodev09/react-native-true-sheet/pull/606) by [@Mohamed-kassim](https://github.com/Mohamed-kassim))
- **iOS**: Fixed keyboard scroll positioning when sheet auto-expands from a smaller detent. ([#592](https://github.com/lodev09/react-native-true-sheet/pull/592) by [@lodev09](https://github.com/lodev09))
- **Android**: Fixed dead state after rapid present/dismiss cycles. ([#593](https://github.com/lodev09/react-native-true-sheet/pull/593) by [@lodev09](https://github.com/lodev09))
- **iOS**: Fixed position change not emitting when detent or index changed. ([#584](https://github.com/lodev09/react-native-true-sheet/pull/584) by [@lodev09](https://github.com/lodev09))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import android.view.View
import android.view.accessibility.AccessibilityNodeInfo
import android.widget.FrameLayout
import androidx.core.graphics.ColorUtils
import androidx.core.view.ViewCompat
import com.facebook.react.uimanager.PixelUtil.dpToPx

/**
Expand Down Expand Up @@ -131,12 +132,13 @@ class TrueSheetGrabberView(context: Context, private val options: GrabberOptions
}

fun updateAccessibilityValue(index: Int, detentCount: Int) {
stateDescription = when {
val description: CharSequence? = when {
index < 0 || detentCount <= 0 -> null
index >= detentCount - 1 -> "Expanded"
index == 0 -> "Collapsed"
else -> "Detent ${index + 1} of $detentCount"
}
ViewCompat.setStateDescription(this, description)
}

private fun getAdaptiveColor(baseColor: Int? = null): Int {
Expand Down
Loading