Skip to content

Commit fed86c7

Browse files
committed
#979 - Setting the keyboard style according to the chosen mode.
1 parent d896d39 commit fed86c7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/services/theme/theme.service.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { Capacitor } from '@capacitor/core';
66
import { UISettingsStorage } from '../uiSettingsStorage';
77
import { StatusBar, Style } from '@capacitor/status-bar';
88
import { NavigationBar } from '@capgo/capacitor-navigation-bar';
9+
import { Keyboard, KeyboardStyle } from '@capacitor/keyboard';
10+
911
@Injectable({
1012
providedIn: 'root',
1113
})
@@ -72,20 +74,27 @@ export class ThemeService {
7274

7375
private toggleDarkPalette(shouldAdd: boolean) {
7476
if (Capacitor.getPlatform() !== 'web') {
77+
const isIOS = Capacitor.getPlatform() == 'ios';
7578
if (shouldAdd) {
7679
StatusBar.setStyle({ style: Style.Dark });
7780
StatusBar.setBackgroundColor({ color: '#121212' });
7881
NavigationBar.setNavigationBarColor({
7982
color: '#121212',
8083
darkButtons: false,
8184
});
85+
if (isIOS) {
86+
Keyboard.setStyle({ style: KeyboardStyle.Dark });
87+
}
8288
} else {
8389
StatusBar.setStyle({ style: Style.Light });
8490
StatusBar.setBackgroundColor({ color: '#F0F0F0' });
8591
NavigationBar.setNavigationBarColor({
8692
color: '#F0F0F0',
8793
darkButtons: true,
8894
});
95+
if (isIOS) {
96+
Keyboard.setStyle({ style: KeyboardStyle.Light });
97+
}
8998
}
9099
}
91100
this._darkMode = shouldAdd;

0 commit comments

Comments
 (0)