diff --git a/README.md b/README.md index 95df4e9ef..d9d9ba4ff 100644 --- a/README.md +++ b/README.md @@ -434,6 +434,7 @@ interface QuickReplies { * **`renderQuickReplySend`** _(Function)_ - Custom quick reply **send** view * **`shouldUpdateMessage`** _(Function)_ - Lets the message component know when to update outside of normal cases. * **`infiniteScroll`** _(Bool)_ - infinite scroll up when reach the top of messages container, automatically call onLoadEarlier function if exist (not yet supported for the web). You need to add `loadEarlier` prop too. +* **`isStatusBarTranslucentAndroid`** _(Bool)_ - If you use translucent status bar on Android, set this option to true. Ignored on iOS. ## Notes for [Redux](https://github.com/reactjs/redux) diff --git a/src/GiftedChat.tsx b/src/GiftedChat.tsx index f43984da6..7739d462b 100644 --- a/src/GiftedChat.tsx +++ b/src/GiftedChat.tsx @@ -147,6 +147,8 @@ export interface GiftedChatProps { /* infinite scroll up when reach the top of messages container, automatically call onLoadEarlier function if exist */ infiniteScroll?: boolean timeTextStyle?: LeftRightStyle + /** If you use translucent status bar on Android, set this option to true. Ignored on iOS. */ + isStatusBarTranslucentAndroid?: boolean /* Custom action sheet */ actionSheet?(): { showActionSheetWithOptions: ( @@ -259,6 +261,7 @@ function GiftedChat ( inverted = true, minComposerHeight = MIN_COMPOSER_HEIGHT, maxComposerHeight = MAX_COMPOSER_HEIGHT, + isStatusBarTranslucentAndroid, } = props const actionSheetRef = useRef(null) @@ -282,7 +285,7 @@ function GiftedChat ( const [text, setText] = useState(() => props.text || '') const [isTypingDisabled, setIsTypingDisabled] = useState(false) - const keyboard = useAnimatedKeyboard() + const keyboard = useAnimatedKeyboard({ isStatusBarTranslucentAndroid }) const trackingKeyboardMovement = useSharedValue(false) const debounceEnableTypingTimeoutId = useRef>() const insets = useSafeAreaInsets()