-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## 📜 Description Added `appearance` property to `KeyboardEventData`. ## 💡 Motivation and Context If user uses `light` theme but prefer dark keyboard, then `KeyboardToolbar` will be white (though it should be `dark` to match the keyboard color). So I thought it will be useful to add this property (additionally this property can be needed for `KeyboardController.retain()` API). On Android keyboard color is controlled via settings and the keyboard color is not exposed through the public API. But on most of Android devices keyboard color by default matches system settings, so in `appearance` I expose system preference (this is the best what I can do to try to match this). ## 📢 Changelog <!-- High level overview of important changes --> <!-- For example: fixed status bar manipulation; added new types declarations; --> <!-- If your changes don't affect one of platform/language below - then remove this platform/language --> ### Docs - added a reference about `appearance` property in `KeyboardEvents` section; ### JS - updated `KeyboardEventData` type; ### iOS - added `UIKeyboardAppearance` extension; ### Android - added `ReactThemedContext.appearance` extension; ## 🤔 How Has This Been Tested? Tested manually on: - iPhone 15 Pro - Pixel 7 Pro (API 35). ## 📸 Screenshots (if appropriate): ![image](https://github.com/user-attachments/assets/54398782-2054-4a7c-8b41-8495532b50b1) ## 📝 Checklist - [x] CI successfully passed - [x] I added new mocks and corresponding unit-tests if library API was changed
- Loading branch information
1 parent
76942c5
commit 4886f74
Showing
7 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// | ||
// UIKeyboardAppearance.swift | ||
// Pods | ||
// | ||
// Created by Kiryl Ziusko on 08/12/2024. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
public extension UIKeyboardAppearance { | ||
var name: String { | ||
switch self { | ||
case .default: return "default" | ||
case .dark: return "dark" | ||
case .light: return "light" | ||
@unknown default: | ||
return "default" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters