From f01055c5038b2da748e3aaecc5819ebcc09abb98 Mon Sep 17 00:00:00 2001 From: Chris Williams Date: Wed, 4 Dec 2019 13:23:59 -0500 Subject: [PATCH] refactor(android): remove deprecated ti.ui.window android:* events BREAKING CHANGES: removes deprecated Ti.UI.Window.android:* events --- .../appcelerator/titanium/TiBaseActivity.java | 44 ++----------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/android/titanium/src/java/org/appcelerator/titanium/TiBaseActivity.java b/android/titanium/src/java/org/appcelerator/titanium/TiBaseActivity.java index a6a5a81ea65..aa595971acf 100644 --- a/android/titanium/src/java/org/appcelerator/titanium/TiBaseActivity.java +++ b/android/titanium/src/java/org/appcelerator/titanium/TiBaseActivity.java @@ -992,19 +992,18 @@ public boolean dispatchKeyEvent(KeyEvent event) case KeyEvent.KEYCODE_BACK: { if (event.getAction() == KeyEvent.ACTION_UP) { - String backEvent = "android:back"; KrollProxy proxy = null; - //android:back could be fired from a tabGroup window (activityProxy) + //androidback could be fired from a tabGroup window (activityProxy) //or hw window (window).This event is added specifically to the activity //proxy of a tab group in window.js - if (activityProxy.hasListeners(backEvent)) { + if (activityProxy.hasListeners(TiC.EVENT_ANDROID_BACK)) { proxy = activityProxy; - } else if (window.hasListeners(backEvent)) { + } else if (window.hasListeners(TiC.EVENT_ANDROID_BACK)) { proxy = window; } if (proxy != null) { - proxy.fireEvent(backEvent, null); + proxy.fireEvent(TiC.EVENT_ANDROID_BACK, null); handled = true; } } @@ -1017,13 +1016,6 @@ public boolean dispatchKeyEvent(KeyEvent event) } handled = true; } - // TODO: Deprecate old event - if (window.hasListeners("android:camera")) { - if (event.getAction() == KeyEvent.ACTION_UP) { - window.fireEvent("android:camera", null); - } - handled = true; - } break; } @@ -1034,13 +1026,6 @@ public boolean dispatchKeyEvent(KeyEvent event) } handled = true; } - // TODO: Deprecate old event - if (window.hasListeners("android:focus")) { - if (event.getAction() == KeyEvent.ACTION_UP) { - window.fireEvent("android:focus", null); - } - handled = true; - } break; } @@ -1051,13 +1036,6 @@ public boolean dispatchKeyEvent(KeyEvent event) } handled = true; } - // TODO: Deprecate old event - if (window.hasListeners("android:search")) { - if (event.getAction() == KeyEvent.ACTION_UP) { - window.fireEvent("android:search", null); - } - handled = true; - } break; } @@ -1068,13 +1046,6 @@ public boolean dispatchKeyEvent(KeyEvent event) } handled = true; } - // TODO: Deprecate old event - if (window.hasListeners("android:volup")) { - if (event.getAction() == KeyEvent.ACTION_UP) { - window.fireEvent("android:volup", null); - } - handled = true; - } break; } @@ -1085,13 +1056,6 @@ public boolean dispatchKeyEvent(KeyEvent event) } handled = true; } - // TODO: Deprecate old event - if (window.hasListeners("android:voldown")) { - if (event.getAction() == KeyEvent.ACTION_UP) { - window.fireEvent("android:voldown", null); - } - handled = true; - } break; }