Skip to content

Commit 3924707

Browse files
chore: Update NPM dependencies (#43)
1 parent b267309 commit 3924707

File tree

6 files changed

+3146
-5003
lines changed

6 files changed

+3146
-5003
lines changed

android/src/main/java/com/capacitorjs/plugins/keyboard/Keyboard.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,15 @@ public Keyboard(AppCompatActivity activity, boolean resizeOnFullScreen) {
5757
FrameLayout content = activity.getWindow().getDecorView().findViewById(android.R.id.content);
5858
rootView = content.getRootView();
5959

60-
ViewCompat.setOnApplyWindowInsetsListener(
61-
rootView,
62-
(v, insets) -> {
63-
boolean showingKeyboard = ViewCompat.getRootWindowInsets(rootView).isVisible(WindowInsetsCompat.Type.ime());
64-
65-
if (showingKeyboard && resizeOnFullScreen) {
66-
possiblyResizeChildOfContent(true);
67-
}
60+
ViewCompat.setOnApplyWindowInsetsListener(rootView, (v, insets) -> {
61+
boolean showingKeyboard = ViewCompat.getRootWindowInsets(rootView).isVisible(WindowInsetsCompat.Type.ime());
6862

69-
return insets;
63+
if (showingKeyboard && resizeOnFullScreen) {
64+
possiblyResizeChildOfContent(true);
7065
}
71-
);
66+
67+
return insets;
68+
});
7269

7370
ViewCompat.setWindowInsetsAnimationCallback(
7471
rootView,

android/src/main/java/com/capacitorjs/plugins/keyboard/KeyboardPlugin.java

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,36 @@ public class KeyboardPlugin extends Plugin {
1515

1616
@Override
1717
public void load() {
18-
execute(
19-
() -> {
20-
boolean resizeOnFullScreen = getConfig().getBoolean("resizeOnFullScreen", false);
21-
implementation = new Keyboard(getBridge(), resizeOnFullScreen);
18+
execute(() -> {
19+
boolean resizeOnFullScreen = getConfig().getBoolean("resizeOnFullScreen", false);
20+
implementation = new Keyboard(getBridge(), resizeOnFullScreen);
2221

23-
implementation.setKeyboardEventListener(this::onKeyboardEvent);
24-
}
25-
);
22+
implementation.setKeyboardEventListener(this::onKeyboardEvent);
23+
});
2624
}
2725

2826
@PluginMethod
2927
public void show(final PluginCall call) {
30-
execute(
31-
() ->
32-
new Handler(Looper.getMainLooper())
33-
.postDelayed(
34-
() -> {
35-
implementation.show();
36-
call.resolve();
37-
},
38-
350
39-
)
28+
execute(() ->
29+
new Handler(Looper.getMainLooper()).postDelayed(
30+
() -> {
31+
implementation.show();
32+
call.resolve();
33+
},
34+
350
35+
)
4036
);
4137
}
4238

4339
@PluginMethod
4440
public void hide(final PluginCall call) {
45-
execute(
46-
() -> {
47-
if (!implementation.hide()) {
48-
call.reject("Can't close keyboard, not currently focused");
49-
} else {
50-
call.resolve();
51-
}
41+
execute(() -> {
42+
if (!implementation.hide()) {
43+
call.reject("Can't close keyboard, not currently focused");
44+
} else {
45+
call.resolve();
5246
}
53-
);
47+
});
5448
}
5549

5650
@PluginMethod

0 commit comments

Comments
 (0)