From 80c4e69303d0dd6910b9e9b7d1e970e26ba4da0b Mon Sep 17 00:00:00 2001 From: Ludovic Roland Date: Fri, 6 May 2016 10:22:50 +0200 Subject: [PATCH] FSS-153 #time 15m Changed some methods visibility into the Droid4meDebugInterceptor class + Updated the version name to 2.4.2 --- droid4me/VERSION.txt | 2 +- droid4me/pom.xml | 2 +- .../debug/Droid4meDebugInterceptor.java | 33 +++++++++++-------- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/droid4me/VERSION.txt b/droid4me/VERSION.txt index 58073ef8..acdc3f1b 100755 --- a/droid4me/VERSION.txt +++ b/droid4me/VERSION.txt @@ -1 +1 @@ -2.4.1 \ No newline at end of file +2.4.2 \ No newline at end of file diff --git a/droid4me/pom.xml b/droid4me/pom.xml index ebb049ed..f3b189d4 100644 --- a/droid4me/pom.xml +++ b/droid4me/pom.xml @@ -11,7 +11,7 @@ droid4me droid4me - 2.4.1 + 2.4.2 jar droid4me is a framework library dedicated to the development of Android applications. https://github.com/smartnsoft/droid4me diff --git a/droid4me/src/com/smartnsoft/droid4me/debug/Droid4meDebugInterceptor.java b/droid4me/src/com/smartnsoft/droid4me/debug/Droid4meDebugInterceptor.java index c3aaf555..48a707fa 100644 --- a/droid4me/src/com/smartnsoft/droid4me/debug/Droid4meDebugInterceptor.java +++ b/droid4me/src/com/smartnsoft/droid4me/debug/Droid4meDebugInterceptor.java @@ -191,18 +191,7 @@ public void onLifeCycleEvent(final Activity activity, Object component, Intercep { if (event == InterceptorEvent.onDestroy) { - // We remove the popup window - final DebugAggregate debugAggregate = getDebugAggregate(false, activity); - if (debugAggregate != null) - { - final PopupWindow popupWindow = debugAggregate.getPopupWindow(activity.getApplicationContext(), false, null); - if (popupWindow != null) - { - popupWindow.dismiss(); - } - debugAggregate.onDestroy(); - discardDebugAggregate(activity); - } + dismissPopupWindow(activity); } else { @@ -231,7 +220,23 @@ public void run() } } - private DebugAggregate getDebugAggregate(boolean createIfNecessary, Activity activity) + protected void dismissPopupWindow(Activity activity) + { + // We remove the popup window + final DebugAggregate debugAggregate = getDebugAggregate(false, activity); + if (debugAggregate != null) + { + final PopupWindow popupWindow = debugAggregate.getPopupWindow(activity.getApplicationContext(), false, null); + if (popupWindow != null) + { + popupWindow.dismiss(); + } + debugAggregate.onDestroy(); + discardDebugAggregate(activity); + } + } + + protected DebugAggregate getDebugAggregate(boolean createIfNecessary, Activity activity) { DebugAggregate debugAggregate = Droid4meDebugInterceptor.debugAggregates.get(activity); if (createIfNecessary == true) @@ -245,7 +250,7 @@ private DebugAggregate getDebugAggregate(boolean createIfNecessary, Activity act return debugAggregate; } - private void discardDebugAggregate(Activity activity) + protected void discardDebugAggregate(Activity activity) { Droid4meDebugInterceptor.debugAggregates.remove(activity); }