Minor revisions (comments).

This commit is contained in:
Timothy Allen 2014-03-27 21:59:12 +02:00
parent 1813f3faa6
commit d7bf2832ea
4 changed files with 11 additions and 13 deletions

View File

@ -9,6 +9,7 @@ import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.util.Log; import android.util.Log;
import android.view.View;
import android.view.Window; import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.Button; import android.widget.Button;
@ -17,10 +18,6 @@ import com.triggertrap.seekarc.SeekArc;
// TODO See GlowPad. // TODO See GlowPad.
// TODO sound audible alarm -- see AlarmKlaxon.java
// TODO Lower alarm volume if in phone call (and detect phone call!)
// TODO Snooze? set another alarm for the next half-hour (or grace_period / 2)?
public class AlarmAlertActivity extends Activity { public class AlarmAlertActivity extends Activity {
private static Intent notifyIntent; private static Intent notifyIntent;
public static Boolean alertFinished, userCancelled; public static Boolean alertFinished, userCancelled;
@ -36,15 +33,18 @@ public class AlarmAlertActivity extends Activity {
requestWindowFeature(Window.FEATURE_NO_TITLE); requestWindowFeature(Window.FEATURE_NO_TITLE);
Window window = getWindow(); Window window = getWindow();
// Set to use the full screen // Set to use the full screen
int fullScreen = WindowManager.LayoutParams.FLAG_FULLSCREEN;
if (Build.VERSION.SDK_INT >= 19) {
fullScreen = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
}
window.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED window.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
| WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON | WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON
| WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON
| fullScreen | WindowManager.LayoutParams.FLAG_ALLOW_LOCK_WHILE_SCREEN_ON
| WindowManager.LayoutParams.FLAG_FULLSCREEN
); );
if (Build.VERSION.SDK_INT >= 16) {
window.getDecorView().
setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_FULLSCREEN);
}
setContentView(R.layout.alarm_alert); setContentView(R.layout.alarm_alert);
notifyIntent = new Intent(getApplicationContext(), AlarmNotify.class); notifyIntent = new Intent(getApplicationContext(), AlarmNotify.class);

View File

@ -21,7 +21,6 @@ public class AlarmKlaxon {
private static Vibrator vibrator; private static Vibrator vibrator;
public static void start(final Context context) { public static void start(final Context context) {
/** /**
* *
* TODO add raw ring tone to use as fallback * TODO add raw ring tone to use as fallback

View File

@ -20,7 +20,6 @@ import java.util.Calendar;
* *
* TODO display notification if alarm is about to go off (and allow user to cancel it before alarm goes off) * TODO display notification if alarm is about to go off (and allow user to cancel it before alarm goes off)
* *
* TODO allow snooze state
*/ */
public class AlarmReceiver extends BroadcastReceiver { public class AlarmReceiver extends BroadcastReceiver {
@ -105,8 +104,6 @@ public class AlarmReceiver extends BroadcastReceiver {
// Close the dialogue and switch to notification // Close the dialogue and switch to notification
// if the Activity has not been closed by the user // if the Activity has not been closed by the user
// (that is, snoozeAlert and dismissAlert have not been called) // (that is, snoozeAlert and dismissAlert have not been called)
// TODO don't run if we've just snoozed from home/back button, but do run if
// TODO we want to finish the snooze alert activity...
if (alarmStatus.contentEquals(ALARM_DISMISSED) || if (alarmStatus.contentEquals(ALARM_DISMISSED) ||
alarmStatus.contentEquals(ALARM_SNOOZED)) { alarmStatus.contentEquals(ALARM_SNOOZED)) {
return; return;

View File

@ -6,6 +6,8 @@
xmlns:seekarc="http://schemas.android.com/apk/res-auto" xmlns:seekarc="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center"
android:background="#000000"
tools:context=".AlarmNotificationActivity"> tools:context=".AlarmNotificationActivity">
<RelativeLayout <RelativeLayout