# HG changeset patch # User Carl Byington # Date 1414621532 25200 # Node ID 9045b1af94e577d22d01c47b5c2e8bbe2e4dbcb8 # Parent 39533be5cbe9eb37e5125f34597e872ede5181b4 revert notifyUser() changes diff -r 39533be5cbe9 -r 9045b1af94e5 src/com/five_ten_sg/connectbot/ConsoleActivity.java --- a/src/com/five_ten_sg/connectbot/ConsoleActivity.java Wed Oct 29 13:28:59 2014 -0700 +++ b/src/com/five_ten_sg/connectbot/ConsoleActivity.java Wed Oct 29 15:25:32 2014 -0700 @@ -764,10 +764,12 @@ showEmulatedKeys(); } - // pass any touch events back to detector + // pass any touch events back to BOTH detectors TerminalView terminalView = (TerminalView) findCurrentView(R.id.console_flip); - if ((terminalView != null) && terminalView.mScaleDetector.onTouchEvent(event)) return true; - return gestDetect.onTouchEvent(event); + boolean rc = false; + if ((terminalView != null) && terminalView.mScaleDetector.onTouchEvent(event)) rc = true; + if (gestDetect.onTouchEvent(event)) rc = true; + return rc; } }); } diff -r 39533be5cbe9 -r 9045b1af94e5 src/com/five_ten_sg/connectbot/TerminalView.java --- a/src/com/five_ten_sg/connectbot/TerminalView.java Wed Oct 29 13:28:59 2014 -0700 +++ b/src/com/five_ten_sg/connectbot/TerminalView.java Wed Oct 29 15:25:32 2014 -0700 @@ -72,6 +72,7 @@ private Matrix scaleMatrix; private static final Matrix.ScaleToFit scaleType = Matrix.ScaleToFit.FILL; + private Toast notification = null; private String lastNotification = null; private volatile boolean notifications = true; @@ -241,12 +242,24 @@ } public void notifyUser(String message) { - if (!notifications) return; - // Don't keep telling the user the same thing. - if (lastNotification != null && lastNotification.equals(message)) return; - Toast notification = Toast.makeText(context, message, Toast.LENGTH_SHORT); - notification.show(); - lastNotification = message; + try { + // ignore if don't want notifications + if (!notifications) return; + // Don't keep telling the user the same thing. + if (lastNotification != null && lastNotification.equals(message)) return; + // create or use old toast + if (notification == null) { + notification = Toast.makeText(context, message, Toast.LENGTH_SHORT); + } + else { + notification.setText(message); + } + notification.show(); + lastNotification = message; + } + catch (Exception e) { + Log.e(TAG, "Problem while trying to notify user", e); + } } /**