Procházet zdrojové kódy

Add onKeyUp event to ActivityCallbacks

Guy Carmeli před 7 roky
rodič
revize
1ecba20c12

+ 6
- 0
android/app/src/main/java/com/reactnativenavigation/controllers/ActivityCallbacks.java Zobrazit soubor

@@ -4,6 +4,7 @@ import android.app.Activity;
4 4
 import android.content.Intent;
5 5
 import android.content.res.Configuration;
6 6
 import android.os.Bundle;
7
+import android.view.KeyEvent;
7 8
 
8 9
 public class ActivityCallbacks {
9 10
     public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
@@ -45,4 +46,9 @@ public class ActivityCallbacks {
45 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 Zobrazit soubor

@@ -190,6 +190,7 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
190 190
 
191 191
     @Override
192 192
     public boolean onKeyUp(int keyCode, KeyEvent event) {
193
+        NavigationApplication.instance.getActivityCallbacks().onKeyUp(keyCode, event);
193 194
         return getReactGateway().onKeyUp(getCurrentFocus(), keyCode) || super.onKeyUp(keyCode, event);
194 195
     }
195 196