Android: add oldBottomMargin, oldHeight & bottomMargin
This commit is contained in:
parent
10c60814d1
commit
f4e6042cae
@ -34,6 +34,8 @@ public class KeyboardPlugin extends DoricJavaPlugin {
|
|||||||
|
|
||||||
private final Set<String> callbackIds = new HashSet<>();
|
private final Set<String> callbackIds = new HashSet<>();
|
||||||
|
|
||||||
|
private float keyboardHeight = 0;
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
|
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
|
||||||
public KeyboardPlugin(DoricContext doricContext) {
|
public KeyboardPlugin(DoricContext doricContext) {
|
||||||
super(doricContext);
|
super(doricContext);
|
||||||
@ -61,7 +63,13 @@ public class KeyboardPlugin extends DoricJavaPlugin {
|
|||||||
|
|
||||||
JSONObject data = new JSONObject();
|
JSONObject data = new JSONObject();
|
||||||
try {
|
try {
|
||||||
|
data.put("oldBottomMargin", 0);
|
||||||
|
data.put("bottomMargin", 0);
|
||||||
|
data.put("oldHeight", keyboardHeight);
|
||||||
data.put("height", DoricUtils.px2dp(heightDiff - virtualNavigationHeight));
|
data.put("height", DoricUtils.px2dp(heightDiff - virtualNavigationHeight));
|
||||||
|
|
||||||
|
keyboardHeight = DoricUtils.px2dp(heightDiff - virtualNavigationHeight);
|
||||||
|
|
||||||
callback.resolve(new JavaValue(data));
|
callback.resolve(new JavaValue(data));
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
Reference in New Issue
Block a user