|
@@ -1,6 +1,8 @@
|
1
|
1
|
package com.reactnativenavigation.params.parsers;
|
2
|
2
|
|
3
|
3
|
import android.os.Bundle;
|
|
4
|
+import android.view.WindowManager;
|
|
5
|
+
|
4
|
6
|
import com.reactnativenavigation.params.LightBoxParams;
|
5
|
7
|
import com.reactnativenavigation.params.NavigationParams;
|
6
|
8
|
|
|
@@ -21,6 +23,37 @@ public class LightBoxParamsParser extends Parser {
|
21
|
23
|
result.backgroundColor = getColor(params, "backgroundColor");
|
22
|
24
|
result.tapBackgroundToDismiss = params.getBoolean("tapBackgroundToDismiss");
|
23
|
25
|
result.overrideBackPress = params.getBoolean("overrideBackPress");
|
|
26
|
+ result.adjustSoftInput = Adjustment.fromString(params.getString("adjustSoftInput")).value;
|
24
|
27
|
return result;
|
25
|
28
|
}
|
|
29
|
+
|
|
30
|
+ public enum Adjustment {
|
|
31
|
+ NOTHING("nothing", WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING),
|
|
32
|
+ PAN("pan", WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN),
|
|
33
|
+ RESIZE("resize", WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE),
|
|
34
|
+ UNSPECIFIED("unspecified", WindowManager.LayoutParams.SOFT_INPUT_ADJUST_UNSPECIFIED);
|
|
35
|
+
|
|
36
|
+ private String name;
|
|
37
|
+ private int value;
|
|
38
|
+
|
|
39
|
+ Adjustment(String name, int value) {
|
|
40
|
+ this.name = name;
|
|
41
|
+ this.value = value;
|
|
42
|
+ }
|
|
43
|
+
|
|
44
|
+ @Override
|
|
45
|
+ public String toString() {
|
|
46
|
+ return name;
|
|
47
|
+ }
|
|
48
|
+
|
|
49
|
+ public static Adjustment fromString(String name) {
|
|
50
|
+ for (Adjustment adjustment : values()) {
|
|
51
|
+ if (adjustment.name.equals(name)) {
|
|
52
|
+ return adjustment;
|
|
53
|
+ }
|
|
54
|
+ }
|
|
55
|
+ return UNSPECIFIED;
|
|
56
|
+ }
|
|
57
|
+
|
|
58
|
+ }
|
26
|
59
|
}
|