mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
fix(editor): incorrect position of toolbar in android (#12614)
### Before Extra padding between toolbaar and keyboard  ### After  <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved accuracy of keyboard height calculations by properly accounting for the navigation bar height on Android devices. - **Refactor** - Standardized naming conventions for navigation bar height methods and unit conversion utilities to enhance consistency across the app. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -116,10 +116,14 @@ framework.impl(VirtualKeyboardProvider, {
|
||||
|
||||
Promise.all([
|
||||
Keyboard.addListener('keyboardWillShow', info => {
|
||||
callback({
|
||||
visible: true,
|
||||
height: info.keyboardHeight,
|
||||
});
|
||||
(async () => {
|
||||
const navBarHeight = (await AffineTheme.getSystemNavBarHeight())
|
||||
.height;
|
||||
callback({
|
||||
visible: true,
|
||||
height: info.keyboardHeight - navBarHeight,
|
||||
});
|
||||
})().catch(console.error);
|
||||
}),
|
||||
Keyboard.addListener('keyboardWillHide', () => {
|
||||
callback({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export interface AffineThemePlugin {
|
||||
onThemeChanged(options: { darkMode: boolean }): Promise<void>;
|
||||
getSystemNaviBarHeight(): Promise<{ height: number }>;
|
||||
getSystemNavBarHeight(): Promise<{ height: number }>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user