Last change
on this file since 481 was 298, checked in by Nicholas Riley, 18 years ago |
Fix problems with alert sound playing: stop if user hits any key; don't auto-enter keyguard while sound is playing.
|
File size:
658 bytes
|
Line | |
---|
1 | package net.sabi.pester;
|
---|
2 |
|
---|
3 | import danger.app.Event;
|
---|
4 | import danger.ui.AlertWindow;
|
---|
5 | import danger.util.DEBUG;
|
---|
6 |
|
---|
7 | public class AlarmAlertWindow extends AlertWindow {
|
---|
8 | boolean mShowTonePlaying;
|
---|
9 |
|
---|
10 | protected void startShowTone() {
|
---|
11 | super.startShowTone();
|
---|
12 | mShowTonePlaying = true;
|
---|
13 | }
|
---|
14 |
|
---|
15 | protected void stopShowTone() {
|
---|
16 | super.stopShowTone();
|
---|
17 | mShowTonePlaying = false;
|
---|
18 | }
|
---|
19 |
|
---|
20 | public boolean blocksKeyGuard() {
|
---|
21 | return mShowTonePlaying;
|
---|
22 | }
|
---|
23 |
|
---|
24 | public boolean eventRawKeyDown(int keycode, Event event) {
|
---|
25 | // this also covers widgets, dirpad, etc.
|
---|
26 | if (mShowTonePlaying)
|
---|
27 | stopShowTone();
|
---|
28 | return super.eventRawKeyDown(keycode, event);
|
---|
29 | }
|
---|
30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.