Skip to content

Commit

Permalink
refactor(android): remove deprecated ti.ui.window android:* events
Browse files Browse the repository at this point in the history
BREAKING CHANGES: removes deprecated Ti.UI.Window.android:* events
  • Loading branch information
sgtcoolguy committed Dec 9, 2019
1 parent f121012 commit f01055c
Showing 1 changed file with 4 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit f01055c

Please sign in to comment.