Skip to content

Commit

Permalink
Finalized v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
noahweasley committed Mar 26, 2022
1 parent 4e9497e commit d37b62c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import android.content.Context;
import android.content.Intent;

import com.noah.timely.util.Constants;

/**
* <p>An alarm re-scheduler that re-schedules alarm from TimeLY's database.</p>
* <p>
Expand All @@ -23,7 +25,9 @@ public void onReceive(Context context, Intent intent) {
|| /* htc devices */ action.equals("com.htc.intent.action.QUICKBOOT_POWERON");

if (isValidBootAction) {
context.startService(new Intent(context, AlarmReSchedulerService.class));
Intent serviceIntent = new Intent(context, AlarmReSchedulerService.class);
serviceIntent.setAction(Constants.ACTION.SHOW_NOTIFICATION);
context.startService(serviceIntent);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ public int onStartCommand(Intent intent, int flags, int startId) {
List<DataModel> timetables1 = database.getTimeTableData(SchoolDatabase.SCHEDULED_TIMETABLE);
if (!timetables1.isEmpty()) {
// re-schedule alarms; get alarm data from app's database

for (DataModel rawData : timetables1) {
TimetableModel timetable = (TimetableModel) rawData;
registerPendingScheduledTimetables(context, timetable);
Expand All @@ -123,7 +122,6 @@ public int onStartCommand(Intent intent, int flags, int startId) {
cancelNotification(context);
}); // end re-schedule task


return START_STICKY;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.net.Uri;
import android.os.Bundle;
import android.os.SystemClock;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
Expand Down Expand Up @@ -183,7 +184,10 @@ public void onBackPressed() {
private void tryNavigateToMainActivity() {
if (intentReceived) {
intentReceived = false;
startActivity(new Intent(this, MainActivity.class).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
startActivity(new Intent(this, MainActivity.class));
// FIXME: 3/26/2022 remove the call to finish() on this activity and add the normal flag on the intent to
// finish the activity automatically
finish();
} else {
super.onBackPressed();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,7 @@ private void cancelTimetableNotifier(Context context, TimetableModel timetable)
.setDataAndType(Uri.parse("content://com.noah.timely.scheduled.add." + timeInMillis),
"com.noah.timely.scheduled.dataType");

PendingIntent pi = PendingIntent.getBroadcast(context, 1156, timetableIntent,
PendingIntent.FLAG_CANCEL_CURRENT);
PendingIntent pi = PendingIntent.getBroadcast(context, 1156, timetableIntent, PendingIntent.FLAG_CANCEL_CURRENT);
pi.cancel();
manager.cancel(pi);
}
Expand Down
14 changes: 0 additions & 14 deletions app/src/main/res/xml/preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,4 @@

</PreferenceCategory>

<PreferenceCategory
external:allowDividerAbove="true"
external:title="Export and share">

<SwitchPreferenceCompat
android:enabled="true"
external:defaultValue="true"
external:icon="@drawable/ic_baseline_build_24"
external:key="ei_prefer_dialog"
external:summary="@string/ei_dialog_pref"
external:title="Prefer dialogs for export/import" />

</PreferenceCategory>

</PreferenceScreen>

0 comments on commit d37b62c

Please sign in to comment.