Skip to content

Commit

Permalink
#8: exchanged sound files
Browse files Browse the repository at this point in the history
  • Loading branch information
arburk committed Nov 19, 2023
1 parent 8fcca9d commit d700a1d
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,3 @@ Sounds are downloaded by [freesound.org](https://freesound.org/) with credits to

- [elliottdj](https://freesound.org/people/elliottdj/sounds/685903/) published
under [Creative Commons 0 License](https://creativecommons.org/publicdomain/zero/1.0/).
- [tim.kahn](https://freesound.org/people/tim.kahn/sounds/95245/) published under
the [Attribution 4.0 License](https://creativecommons.org/licenses/by/4.0/).
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class PreferenceManagerWrapper {
}
if (pref_key_sound_warning_of_next_round == key) {
val defaultWarning =
Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + context.packageName + "/" + R.raw.one_minute_left)
Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://" + context.packageName + "/" + R.raw.one_minute_warning)
PreferenceManager.getDefaultSharedPreferences(context).edit().putString(key, defaultWarning.toString()).apply()
return defaultWarning
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class TimerService : Service(), SharedPreferences.OnSharedPreferenceChangeListen
}

override fun onCreate() {
// Start up the thread running the service. Note that we create a
// Start up the thread running the service. Note that we create a
// separate thread because the service normally runs in the process's
// main thread, which we don't want to block. We also make it
// background priority so CPU-intensive work will not disrupt our UI.
Expand Down Expand Up @@ -188,7 +188,7 @@ class TimerService : Service(), SharedPreferences.OnSharedPreferenceChangeListen
.setSound(PreferenceManagerWrapper.getChannelNotificationSound(this))
.setDefaults(Notification.DEFAULT_VIBRATE)
.setVibrate(LongArray(1) { 500L })
// TOODO: Fix issue with correct timer handling
// TODO: Fix issue with correct timer handling
// .setContentIntent(pendingIntentTimer)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ class PickRingtoneContract : ActivityResultContract<Int, Uri?>() {
return null
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
return intent?.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI, Uri::class.java)
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
intent?.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI, Uri::class.java)
} else {
@Suppress("DEPRECATION") // can be removed with removal of support for Build.VERSION.SDK_INT < 33
intent?.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI)
}

return intent?.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI)
}
}
Binary file added app/src/main/res/raw/fight.wav
Binary file not shown.
Binary file removed app/src/main/res/raw/one_minute_left.wav
Binary file not shown.
Binary file added app/src/main/res/raw/one_minute_warning.wav
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ kotlin.code.style=official
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false
# Enable non-final resource IDs for faster incremental compilation
android.nonFinalResIds=true

0 comments on commit d700a1d

Please sign in to comment.