Minor revisions (comments).
This commit is contained in:
parent
1813f3faa6
commit
d7bf2832ea
@ -9,6 +9,7 @@ import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
@ -17,10 +18,6 @@ import com.triggertrap.seekarc.SeekArc;
|
||||
|
||||
// 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 {
|
||||
private static Intent notifyIntent;
|
||||
public static Boolean alertFinished, userCancelled;
|
||||
@ -36,15 +33,18 @@ public class AlarmAlertActivity extends Activity {
|
||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
Window window = getWindow();
|
||||
// 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
|
||||
| WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD
|
||||
| WindowManager.LayoutParams.FLAG_KEEP_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);
|
||||
|
||||
notifyIntent = new Intent(getApplicationContext(), AlarmNotify.class);
|
||||
|
@ -21,7 +21,6 @@ public class AlarmKlaxon {
|
||||
private static Vibrator vibrator;
|
||||
|
||||
public static void start(final Context context) {
|
||||
|
||||
/**
|
||||
*
|
||||
* TODO add raw ring tone to use as fallback
|
||||
|
@ -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 allow snooze state
|
||||
*/
|
||||
|
||||
public class AlarmReceiver extends BroadcastReceiver {
|
||||
@ -105,8 +104,6 @@ public class AlarmReceiver extends BroadcastReceiver {
|
||||
// Close the dialogue and switch to notification
|
||||
// if the Activity has not been closed by the user
|
||||
// (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) ||
|
||||
alarmStatus.contentEquals(ALARM_SNOOZED)) {
|
||||
return;
|
||||
|
@ -6,6 +6,8 @@
|
||||
xmlns:seekarc="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:background="#000000"
|
||||
tools:context=".AlarmNotificationActivity">
|
||||
|
||||
<RelativeLayout
|
||||
|
Loading…
Reference in New Issue
Block a user