|
@@ -9,7 +9,6 @@ import java.util.TimerTask;
|
9
|
9
|
|
10
|
10
|
public class SlidingOverlaysQueue implements SlidingOverlay.SlidingListener{
|
11
|
11
|
|
12
|
|
- private static final int SUSTAIN_DURATION = 3000;
|
13
|
12
|
private static final int SHORT_SUSTAIN_DURATION = 500;
|
14
|
13
|
|
15
|
14
|
protected Timer autoDismissTimer = null;
|
|
@@ -60,23 +59,27 @@ public class SlidingOverlaysQueue implements SlidingOverlay.SlidingListener{
|
60
|
59
|
|
61
|
60
|
@Override
|
62
|
61
|
public void onSlidingOverlayShown() {
|
63
|
|
- int autoDismissDuration = pendingHide || queue.size() > 1
|
64
|
|
- ? SHORT_SUSTAIN_DURATION
|
65
|
|
- : SUSTAIN_DURATION;
|
66
|
|
- pendingHide = false;
|
|
62
|
+ Integer autoDismissTimerSec = queue.peek().getAutoDismissTimerSec();
|
67
|
63
|
|
68
|
|
- autoDismissTimer = new Timer();
|
69
|
|
- autoDismissTimer.schedule(new TimerTask() {
|
70
|
|
- @Override
|
71
|
|
- public void run() {
|
72
|
|
- NavigationApplication.instance.runOnMainThread(new Runnable() {
|
73
|
|
- @Override
|
74
|
|
- public void run() {
|
75
|
|
- queue.peek().hide();
|
76
|
|
- }
|
77
|
|
- });
|
78
|
|
- }
|
79
|
|
- }, autoDismissDuration);
|
|
64
|
+ if (autoDismissTimerSec != null || pendingHide || queue.size() > 1) {
|
|
65
|
+ int autoDismissDuration = autoDismissTimerSec != null
|
|
66
|
+ ? autoDismissTimerSec * 1000
|
|
67
|
+ : SHORT_SUSTAIN_DURATION;
|
|
68
|
+ pendingHide = false;
|
|
69
|
+
|
|
70
|
+ autoDismissTimer = new Timer();
|
|
71
|
+ autoDismissTimer.schedule(new TimerTask() {
|
|
72
|
+ @Override
|
|
73
|
+ public void run() {
|
|
74
|
+ NavigationApplication.instance.runOnMainThread(new Runnable() {
|
|
75
|
+ @Override
|
|
76
|
+ public void run() {
|
|
77
|
+ queue.peek().hide();
|
|
78
|
+ }
|
|
79
|
+ });
|
|
80
|
+ }
|
|
81
|
+ }, autoDismissDuration);
|
|
82
|
+ }
|
80
|
83
|
}
|
81
|
84
|
|
82
|
85
|
@Override
|