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

feat(android): add trayHeightMultiplier support #191

Merged
merged 1 commit into from
Aug 12, 2024
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
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Configure the `GiphyDialog` view and behavior.
| showSuggestionsBar | Show/hide a suggestions bar. | `boolean` | `true` | ✅&nbsp;Android <br/> ❌&nbsp;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` | ✅&nbsp;Android <br/> ✅&nbsp;iOS |
| theme | Adjust the GiphyDialog theme | [`GiphyTheme`](#giphytheme) | `.Light` | ✅&nbsp;Android <br/> ✅&nbsp;iOS |
| trayHeightMultiplier | Height for the tray's "snap point" as a ratio of the GiphyDialog's height. | `number` | `0.7` | &nbsp;Android <br/> ✅&nbsp;iOS |
| trayHeightMultiplier | Height for the tray's "snap point" as a ratio of the GiphyDialog's height. | `number` | `0.7` | &nbsp;Android <br/> ✅&nbsp;iOS |

### </> show: `show() => void`

Expand Down
Loading