Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ android {
}

dependencies {
// Room components
implementation "androidx.room:room-runtime:$rootProject.roomVersion"
annotationProcessor "androidx.room:room-compiler:$rootProject.roomVersion"

// Gson
implementation "com.google.code.gson:gson:$rootProject.gsonVersion"
implementation 'androidx.media3:media3-exoplayer:1.7.1'
implementation 'androidx.media3:media3-common:1.7.1'
implementation 'androidx.preference:preference:1.2.1'
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/com/best/deskclock/AlarmInitReceiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import com.best.deskclock.alarms.AlarmNotifications;
import com.best.deskclock.alarms.AlarmStateManager;
import com.best.deskclock.holiday.HolidayRepository;
import com.best.deskclock.controller.Controller;
import com.best.deskclock.data.DataModel;
import com.best.deskclock.data.SettingsDAO;
Expand Down Expand Up @@ -98,6 +99,12 @@ public void onReceive(final Context context, Intent intent) {
Controller.getController().updateShortcuts();
}

// Update holiday data on boot or app update
if (Intent.ACTION_BOOT_COMPLETED.equals(action)
|| Intent.ACTION_MY_PACKAGE_REPLACED.equals(action)) {
HolidayRepository.getInstance(context).updateWorkdayData();
}

// Update alarm status once receive the status update broadcast
if (ACTION_UPDATE_ALARM_STATUS.equals(action)) {
long alarmTime = intent.getLongExtra(TIME, 0L);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN;
import static android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE;

import static com.best.deskclock.settings.PreferencesDefaultValues.ALARM_TIMEOUT_END_OF_RINGTONE;
import static com.best.deskclock.settings.PreferencesDefaultValues.ALARM_TIMEOUT_NEVER;
import static com.best.deskclock.settings.PreferencesDefaultValues.TIMEOUT_END_OF_RINGTONE;
import static com.best.deskclock.settings.PreferencesDefaultValues.TIMEOUT_NEVER;

import android.app.Dialog;
import android.content.Context;
Expand Down Expand Up @@ -185,9 +185,9 @@ public Dialog onCreateDialog(Bundle savedInstanceState) {
mEndOfRingtoneCheckbox = view.findViewById(R.id.end_of_ringtone);

mEditMinutes.setText(String.valueOf(editMinutes));
if (editMinutes == ALARM_TIMEOUT_END_OF_RINGTONE) {
if (editMinutes == TIMEOUT_END_OF_RINGTONE) {
mEditMinutes.setText("");
} else if (editMinutes == ALARM_TIMEOUT_NEVER) {
} else if (editMinutes == TIMEOUT_NEVER) {
mEditMinutes.setText(String.valueOf(0));
}
mEditMinutes.setEnabled(!isEndOfRingtone);
Expand Down Expand Up @@ -260,7 +260,7 @@ private void setAutoSilenceDuration() {
int minutes = 0;

if (mEndOfRingtoneCheckbox.isChecked()) {
minutes = ALARM_TIMEOUT_END_OF_RINGTONE;
minutes = TIMEOUT_END_OF_RINGTONE;
} else {
String minutesText = mEditMinutes.getText() != null ? mEditMinutes.getText().toString() : "";

Expand All @@ -269,7 +269,7 @@ private void setAutoSilenceDuration() {
}

if (minutes == 0) {
minutes = ALARM_TIMEOUT_NEVER;
minutes = TIMEOUT_NEVER;
}
}

Expand Down
Loading
Loading