removing some colons
This commit is contained in:
parent
db6ceae5c5
commit
9bba1b74ec
2 changed files with 9 additions and 9 deletions
|
@ -31,7 +31,7 @@ class ReminderActivity : SimpleActivity() {
|
||||||
private var didVibrate = false
|
private var didVibrate = false
|
||||||
private var alarm: Alarm? = null
|
private var alarm: Alarm? = null
|
||||||
private var mediaPlayer: MediaPlayer? = null
|
private var mediaPlayer: MediaPlayer? = null
|
||||||
private var vibrator: Vibrator? = null;
|
private var vibrator: Vibrator? = null
|
||||||
private var lastVolumeValue = 0.1f
|
private var lastVolumeValue = 0.1f
|
||||||
private var dragDownX = 0f
|
private var dragDownX = 0f
|
||||||
|
|
||||||
|
@ -162,18 +162,18 @@ class ReminderActivity : SimpleActivity() {
|
||||||
lastVolumeValue = 1f
|
lastVolumeValue = 1f
|
||||||
}
|
}
|
||||||
|
|
||||||
val doVibrate = if (alarm != null) alarm!!.vibrate else config.timerVibrate;
|
val doVibrate = if (alarm != null) alarm!!.vibrate else config.timerVibrate
|
||||||
if (doVibrate) {
|
if (doVibrate) {
|
||||||
val pattern = LongArray(2){ 500 };
|
val pattern = LongArray(2) { 500 }
|
||||||
vibrator = getSystemService(Context.VIBRATOR_SERVICE) as Vibrator;
|
vibrator = getSystemService(Context.VIBRATOR_SERVICE) as Vibrator
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
vibrator?.vibrate(VibrationEffect.createWaveform(pattern, 0))
|
vibrator?.vibrate(VibrationEffect.createWaveform(pattern, 0))
|
||||||
} else {
|
} else {
|
||||||
vibrator?.vibrate(pattern, 0);
|
vibrator?.vibrate(pattern, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val soundUri = if (alarm != null) alarm!!.soundUri else config.timerSoundUri;
|
val soundUri = if (alarm != null) alarm!!.soundUri else config.timerSoundUri
|
||||||
if (soundUri != SILENT) {
|
if (soundUri != SILENT) {
|
||||||
try {
|
try {
|
||||||
mediaPlayer = MediaPlayer().apply {
|
mediaPlayer = MediaPlayer().apply {
|
||||||
|
@ -219,8 +219,8 @@ class ReminderActivity : SimpleActivity() {
|
||||||
mediaPlayer?.stop()
|
mediaPlayer?.stop()
|
||||||
mediaPlayer?.release()
|
mediaPlayer?.release()
|
||||||
mediaPlayer = null
|
mediaPlayer = null
|
||||||
vibrator?.cancel();
|
vibrator?.cancel()
|
||||||
vibrator = null;
|
vibrator = null
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun snoozeAlarm() {
|
private fun snoozeAlarm() {
|
||||||
|
|
|
@ -355,7 +355,7 @@ fun Context.getAlarmNotification(pendingIntent: PendingIntent, alarm: Alarm): No
|
||||||
builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
|
builder.setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
|
||||||
|
|
||||||
if (soundUri != SILENT) {
|
if (soundUri != SILENT) {
|
||||||
builder.setSound(Uri.parse(soundUri), AudioManager.STREAM_ALARM);
|
builder.setSound(Uri.parse(soundUri), STREAM_ALARM)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (alarm.vibrate) {
|
if (alarm.vibrate) {
|
||||||
|
|
Loading…
Reference in a new issue