Mercurial > 510Connectbot
comparison src/com/five_ten_sg/connectbot/TerminalView.java @ 419:9045b1af94e5
revert notifyUser() changes
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 29 Oct 2014 15:25:32 -0700 |
parents | 4dcc071e1feb |
children | e5f7c2584296 |
comparison
equal
deleted
inserted
replaced
418:39533be5cbe9 | 419:9045b1af94e5 |
---|---|
70 private Path ctrlCursor, altCursor, shiftCursor; | 70 private Path ctrlCursor, altCursor, shiftCursor; |
71 private RectF tempSrc, tempDst; | 71 private RectF tempSrc, tempDst; |
72 private Matrix scaleMatrix; | 72 private Matrix scaleMatrix; |
73 private static final Matrix.ScaleToFit scaleType = Matrix.ScaleToFit.FILL; | 73 private static final Matrix.ScaleToFit scaleType = Matrix.ScaleToFit.FILL; |
74 | 74 |
75 private Toast notification = null; | |
75 private String lastNotification = null; | 76 private String lastNotification = null; |
76 private volatile boolean notifications = true; | 77 private volatile boolean notifications = true; |
77 | 78 |
78 // Related to Accessibility Features | 79 // Related to Accessibility Features |
79 private boolean mAccessibilityInitialized = false; | 80 private boolean mAccessibilityInitialized = false; |
239 } | 240 } |
240 } | 241 } |
241 } | 242 } |
242 | 243 |
243 public void notifyUser(String message) { | 244 public void notifyUser(String message) { |
244 if (!notifications) return; | 245 try { |
245 // Don't keep telling the user the same thing. | 246 // ignore if don't want notifications |
246 if (lastNotification != null && lastNotification.equals(message)) return; | 247 if (!notifications) return; |
247 Toast notification = Toast.makeText(context, message, Toast.LENGTH_SHORT); | 248 // Don't keep telling the user the same thing. |
248 notification.show(); | 249 if (lastNotification != null && lastNotification.equals(message)) return; |
249 lastNotification = message; | 250 // create or use old toast |
251 if (notification == null) { | |
252 notification = Toast.makeText(context, message, Toast.LENGTH_SHORT); | |
253 } | |
254 else { | |
255 notification.setText(message); | |
256 } | |
257 notification.show(); | |
258 lastNotification = message; | |
259 } | |
260 catch (Exception e) { | |
261 Log.e(TAG, "Problem while trying to notify user", e); | |
262 } | |
250 } | 263 } |
251 | 264 |
252 /** | 265 /** |
253 * Ask the {@link TerminalBridge} we're connected to to resize to a specific size. | 266 * Ask the {@link TerminalBridge} we're connected to to resize to a specific size. |
254 * @param width | 267 * @param width |