Browse Source

Add onKeyUp event to ActivityCallbacks

Guy Carmeli 7 years ago
parent
commit
1ecba20c12

+ 6
- 0
android/app/src/main/java/com/reactnativenavigation/controllers/ActivityCallbacks.java View File

4
 import android.content.Intent;
4
 import android.content.Intent;
5
 import android.content.res.Configuration;
5
 import android.content.res.Configuration;
6
 import android.os.Bundle;
6
 import android.os.Bundle;
7
+import android.view.KeyEvent;
7
 
8
 
8
 public class ActivityCallbacks {
9
 public class ActivityCallbacks {
9
     public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
10
     public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
45
     public void onConfigurationChanged(Configuration newConfig) {
46
     public void onConfigurationChanged(Configuration newConfig) {
46
 
47
 
47
     }
48
     }
49
+
50
+    public void onKeyUp(int keyCode, KeyEvent event) {
51
+
52
+    }
53
+
48
 }
54
 }

+ 1
- 0
android/app/src/main/java/com/reactnativenavigation/controllers/NavigationActivity.java View File

190
 
190
 
191
     @Override
191
     @Override
192
     public boolean onKeyUp(int keyCode, KeyEvent event) {
192
     public boolean onKeyUp(int keyCode, KeyEvent event) {
193
+        NavigationApplication.instance.getActivityCallbacks().onKeyUp(keyCode, event);
193
         return getReactGateway().onKeyUp(getCurrentFocus(), keyCode) || super.onKeyUp(keyCode, event);
194
         return getReactGateway().onKeyUp(getCurrentFocus(), keyCode) || super.onKeyUp(keyCode, event);
194
     }
195
     }
195
 
196