diff options
-rw-r--r-- | src/com/android/stk/StkApp.java | 8 | ||||
-rw-r--r-- | src/com/android/stk/StkDialogActivity.java | 12 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/com/android/stk/StkApp.java b/src/com/android/stk/StkApp.java index 0f0af52..4484493 100644 --- a/src/com/android/stk/StkApp.java +++ b/src/com/android/stk/StkApp.java @@ -32,8 +32,12 @@ abstract class StkApp extends Application { static final int MENU_ID_BACK = android.view.Menu.FIRST + 1; static final int MENU_ID_HELP = android.view.Menu.FIRST + 2; - // UI timeout, 30 seconds - used for display dialog and activities. - static final int UI_TIMEOUT = (40 * 1000); + // Display Text timeouts + static final int DISP_TEXT_CLEAR_AFTER_DELAY_TIMEOUT = (15 * 1000); + static final int DISP_TEXT_WAIT_FOR_USER_TIMEOUT = (60 * 1000); + + // UI timeout, 30 seconds - used for menues and input + static final int UI_TIMEOUT = (30 * 1000); // Tone default timeout - 2 seconds static final int TONE_DFEAULT_TIMEOUT = (2 * 1000); diff --git a/src/com/android/stk/StkDialogActivity.java b/src/com/android/stk/StkDialogActivity.java index 3fd3ef7..127f51b 100644 --- a/src/com/android/stk/StkDialogActivity.java +++ b/src/com/android/stk/StkDialogActivity.java @@ -126,7 +126,7 @@ public class StkDialogActivity extends Activity implements View.OnClickListener @Override public void onResume() { super.onResume(); - startTimeOut(); + startTimeOut(mTextMsg.userClear); } @Override @@ -175,12 +175,18 @@ public class StkDialogActivity extends Activity implements View.OnClickListener mTimeoutHandler.removeMessages(MSG_ID_TIMEOUT); } - private void startTimeOut() { + private void startTimeOut(boolean waitForUserToClear) { // Reset timeout. cancelTimeOut(); int dialogDuration = StkApp.calculateDurationInMilis(mTextMsg.duration); + // If duration is specified, this has priority. If not, set timeout + // according to condition given by the card. if (dialogDuration == 0) { - dialogDuration = StkApp.UI_TIMEOUT; + if (waitForUserToClear) { + dialogDuration = StkApp.DISP_TEXT_WAIT_FOR_USER_TIMEOUT; + } else { + dialogDuration = StkApp.DISP_TEXT_CLEAR_AFTER_DELAY_TIMEOUT; + } } mTimeoutHandler.sendMessageDelayed(mTimeoutHandler .obtainMessage(MSG_ID_TIMEOUT), dialogDuration); |