Browse Source

Expose keyUp event from modals to ActivityCallback

Guy Carmeli 7 years ago
parent
commit
2538109519

+ 8
- 0
android/app/src/main/java/com/reactnativenavigation/controllers/Modal.java View File

4
 import android.content.DialogInterface;
4
 import android.content.DialogInterface;
5
 import android.os.Build;
5
 import android.os.Build;
6
 import android.os.Bundle;
6
 import android.os.Bundle;
7
+import android.support.annotation.NonNull;
7
 import android.support.v7.app.AppCompatActivity;
8
 import android.support.v7.app.AppCompatActivity;
9
+import android.view.KeyEvent;
8
 import android.view.Window;
10
 import android.view.Window;
9
 import android.view.WindowManager;
11
 import android.view.WindowManager;
10
 
12
 
160
         getWindow().setAttributes(attributes);
162
         getWindow().setAttributes(attributes);
161
     }
163
     }
162
 
164
 
165
+    @Override
166
+    public boolean onKeyUp(int keyCode, @NonNull KeyEvent event) {
167
+        NavigationApplication.instance.getActivityCallbacks().onKeyUp(keyCode, event);
168
+        return super.onKeyUp(keyCode, event);
169
+    }
170
+
163
     @Override
171
     @Override
164
     public void push(ScreenParams params, Promise onPushComplete) {
172
     public void push(ScreenParams params, Promise onPushComplete) {
165
         layout.push(params, onPushComplete);
173
         layout.push(params, onPushComplete);