capacitor-dex-editor 0.0.51 → 0.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -127,18 +127,19 @@ public class SmaliEditorActivity extends AppCompatActivity {
127
127
 
128
128
  setContentView(root);
129
129
 
130
- // 处理安全区域
130
+ // 处理安全区域和键盘
131
131
  ViewCompat.setOnApplyWindowInsetsListener(root, (v, windowInsets) -> {
132
- Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
132
+ Insets systemBars = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
133
+ Insets ime = windowInsets.getInsets(WindowInsetsCompat.Type.ime());
133
134
 
134
135
  // 更新顶部占位高度
135
136
  ViewGroup.LayoutParams topParams = topSpacer.getLayoutParams();
136
- topParams.height = insets.top;
137
+ topParams.height = systemBars.top;
137
138
  topSpacer.setLayoutParams(topParams);
138
139
 
139
- // 更新底部占位高度
140
+ // 更新底部占位高度(考虑键盘)
140
141
  ViewGroup.LayoutParams bottomParams = bottomSpacer.getLayoutParams();
141
- bottomParams.height = insets.bottom;
142
+ bottomParams.height = Math.max(systemBars.bottom, ime.bottom);
142
143
  bottomSpacer.setLayoutParams(bottomParams);
143
144
 
144
145
  return WindowInsetsCompat.CONSUMED;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-dex-editor",
3
- "version": "0.0.51",
3
+ "version": "0.0.52",
4
4
  "description": "Capacitor-plugin-for-editing-DEX-files-in-APK",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",