From e502281d3ce261ca8c1bae11cddcafc1db75ac66 Mon Sep 17 00:00:00 2001 From: Alex Lonsky Date: Thu, 8 Aug 2024 19:30:57 +0300 Subject: [PATCH] build(deps): bump Android SDK version from 2.3.14-fresco-v2.5.0 to 2.3.15-fresco-v2.5.0 feat(android): add trayHeightMultiplier support --- android/build.gradle | 2 +- .../java/com/giphyreactnativesdk/RTNGiphyDialogModule.kt | 7 +++++++ docs/api.md | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 21e647a..9e98abb 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -202,7 +202,7 @@ dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'com.giphy.sdk:ui:2.3.14-fresco-v2.5.0' + implementation 'com.giphy.sdk:ui:2.3.15-fresco-v2.5.0' } if (isNewArchitectureEnabled()) { diff --git a/android/src/main/java/com/giphyreactnativesdk/RTNGiphyDialogModule.kt b/android/src/main/java/com/giphyreactnativesdk/RTNGiphyDialogModule.kt index 4561b48..13eeecb 100644 --- a/android/src/main/java/com/giphyreactnativesdk/RTNGiphyDialogModule.kt +++ b/android/src/main/java/com/giphyreactnativesdk/RTNGiphyDialogModule.kt @@ -28,6 +28,7 @@ private enum class RTNDialogProps(val key: String) { CLIPS_PREVIEW_RENDITION_TYPE("clipsPreviewRenditionType"), CONFIRMATION_RENDITION_TYPE("confirmationRenditionType"), ENABLE_DYNAMIC_TEXT("enableDynamicText"), + TRAY_HEIGHT_MULTIPLIER("trayHeightMultiplier"), MEDIA_TYPE_CONFIG("mediaTypeConfig"), RATING("rating"), RENDITION_TYPE("renditionType"), @@ -60,6 +61,12 @@ private fun giphyDialogSettingsFromRNValue( ) } + if (options.hasKey(RTNDialogProps.TRAY_HEIGHT_MULTIPLIER.key)) { + settings.trayHeightMultiplier = options.getDouble( + RTNDialogProps.TRAY_HEIGHT_MULTIPLIER.key + ).toFloat() + } + if (options.hasKey(RTNDialogProps.RATING.key)) { val rawRating = options.getString(RTNDialogProps.RATING.key) settings.rating = RTNGiphyRating.fromRNValue(rawRating) ?: RatingType.pg13 diff --git a/docs/api.md b/docs/api.md index 9b3d14b..8f2c8d4 100644 --- a/docs/api.md +++ b/docs/api.md @@ -70,7 +70,7 @@ Configure the `GiphyDialog` view and behavior. | showSuggestionsBar | Show/hide a suggestions bar. | `boolean` | `true` | ✅ Android
❌ iOS | | stickerColumnCount | For carousel layouts, we provide the option to set the number of columns for stickers and text. We recommend using 3 columns for blurred mode. | [`GiphyStickersColumnCount`](../src/dto/misc.ts) | `.Three` | ✅ Android
✅ iOS | | theme | Adjust the GiphyDialog theme | [`GiphyTheme`](#giphytheme) | `.Light` | ✅ Android
✅ iOS | -| trayHeightMultiplier | Height for the tray's "snap point" as a ratio of the GiphyDialog's height. | `number` | `0.7` | ❌ Android
✅ iOS | +| trayHeightMultiplier | Height for the tray's "snap point" as a ratio of the GiphyDialog's height. | `number` | `0.7` | ✅ Android
✅ iOS | ### show: `show() => void`