kirillzyusko / react-native-keyboard-controller

Keyboard manager which works in identical way on both iOS and Android
https://kirillzyusko.github.io/react-native-keyboard-controller/
MIT License
1.62k stars 67 forks source link

feat: `KeyboardToolbar` blur #418

Closed kirillzyusko closed 5 months ago

kirillzyusko commented 5 months ago

📜 Description

Added blur and opacity props for KeyboardToolbar component to better match HIG guidelines.

💡 Motivation and Context

To have a better alignment with iOS guidelines - KeyboardToolbar should look like a continuation of the keyboard. iOS keyboard is opaque and has a blur effect. So in this PR I added an ability to have a blur effect.

I didn't want to expose an additional component from this library so I decided to give users an ability to specify their own blur component - if they are using expo they can use expo-blur library, if they use bare RN project they can use @react-native-community/blur.

However I discovered that providing a blur effect doesn't give a desired effect, because the view is not transparent by default. Unfortunatelly we can not provide opacity and put it to the style - in this case opacity will be applied to the blur and effect also will not be visible. So we need to use RGBA format for backgroundColor - we already have colors defined in theme but the opacity can be different based on project preferences, so I added opacity prop which I concatenate with existing value, so RGB+A give RGBA color and blur effect is visible.

📢 Changelog

Docs

JS

🤔 How Has This Been Tested?

Tested manually on:

📸 Screenshots (if appropriate):

Before After
image image
image image

📝 Checklist

github-actions[bot] commented 5 months ago

📊 Package size report

Current size Target Size Difference
129748 bytes 128786 bytes 962 bytes 📈
github-actions[bot] commented 5 months ago

PR Preview Action v1.4.7 :---: Preview removed because the pull request was closed. 2024-04-28 08:08 UTC

argos-ci[bot] commented 5 months ago

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No change detected - Apr 27, 2024, 8:27 AM