-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #298 from vicolo-dev/develop
Merge pull request #269 from vicolo-dev/release/0.5.0
- Loading branch information
Showing
32 changed files
with
524 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Changes since v0.4.3: | ||
|
||
🚀 Features | ||
|
||
* Widget support! | ||
* Added analog and digital clock widgets | ||
* Added option to customize size, alignment, color, font weight, formats | ||
* Added localizations | ||
* Chinese, French, Spanish, Turkish and Portuguese mostly complete | ||
* Partial support for Bengali, German, Italian, Norwegian, Polish, Russian,and Vietnamese | ||
* Add your favorite language here: https://hosted.weblate.org/projects/chrono | ||
|
||
✨ Enhancements | ||
|
||
* Added option to specify default page | ||
* Added 'plus' button when selecting melodies and tags | ||
* Added sections in settings to get notification and ignore baterry optimization settings | ||
* Reversed card actions order so delete is at bottom | ||
* Add option to change long date format (displayed on clock screen and clock widget) | ||
* Added option to change first day of week | ||
* Improved spinner time picker interface | ||
* Improved dial time picker 24h interface | ||
* Added discription for audio channel options | ||
* Added option to change separator for digital clock widget | ||
* Reversed card actions order so delete is at bottom | ||
* Add option to change long date format (displayed on clock screen and clock widget) | ||
* Added patreons list in about screen | ||
* Added contributors list in about screen | ||
|
||
🐛 Fixes | ||
|
||
* Fixed app assuming foreground after alarm rings, even though it was closed before | ||
* Fixed tap splash color | ||
* Fixed media, notification and ringtone audio channels not working | ||
* Fixed other apps' music not restarting after alarm rings | ||
* Fixed upcoming alarm notification appearing after alarm rings | ||
* Fixed upcoming alarm notification not updating for repeating alarms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Changes since v0.4.3: | ||
|
||
🚀 Features | ||
|
||
* Widget support! | ||
* Added analog and digital clock widgets | ||
* Added option to customize size, alignment, color, font weight, formats | ||
* Added localizations | ||
* Chinese, French, Spanish, Turkish and Portuguese mostly complete | ||
* Partial support for Bengali, German, Italian, Norwegian, Polish, Russian,and Vietnamese | ||
* Add your favorite language here: https://hosted.weblate.org/projects/chrono | ||
|
||
✨ Enhancements | ||
|
||
* Added option to specify default page | ||
* Added 'plus' button when selecting melodies and tags | ||
* Added sections in settings to get notification and ignore baterry optimization settings | ||
* Reversed card actions order so delete is at bottom | ||
* Add option to change long date format (displayed on clock screen and clock widget) | ||
* Added option to change first day of week | ||
* Improved spinner time picker interface | ||
* Improved dial time picker 24h interface | ||
* Added discription for audio channel options | ||
* Added option to change separator for digital clock widget | ||
* Reversed card actions order so delete is at bottom | ||
* Add option to change long date format (displayed on clock screen and clock widget) | ||
* Added patreons list in about screen | ||
* Added contributors list in about screen | ||
|
||
🐛 Fixes | ||
|
||
* Fixed app assuming foreground after alarm rings, even though it was closed before | ||
* Fixed tap splash color | ||
* Fixed media, notification and ringtone audio channels not working | ||
* Fixed other apps' music not restarting after alarm rings | ||
* Fixed upcoming alarm notification appearing after alarm rings | ||
* Fixed upcoming alarm notification not updating for repeating alarms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Changes since v0.4.3: | ||
|
||
🚀 Features | ||
|
||
* Widget support! | ||
* Added analog and digital clock widgets | ||
* Added option to customize size, alignment, color, font weight, formats | ||
* Added localizations | ||
* Chinese, French, Spanish, Turkish and Portuguese mostly complete | ||
* Partial support for Bengali, German, Italian, Norwegian, Polish, Russian,and Vietnamese | ||
* Add your favorite language here: https://hosted.weblate.org/projects/chrono | ||
|
||
✨ Enhancements | ||
|
||
* Added option to specify default page | ||
* Added 'plus' button when selecting melodies and tags | ||
* Added sections in settings to get notification and ignore baterry optimization settings | ||
* Reversed card actions order so delete is at bottom | ||
* Add option to change long date format (displayed on clock screen and clock widget) | ||
* Added option to change first day of week | ||
* Improved spinner time picker interface | ||
* Improved dial time picker 24h interface | ||
* Added discription for audio channel options | ||
* Added option to change separator for digital clock widget | ||
* Reversed card actions order so delete is at bottom | ||
* Add option to change long date format (displayed on clock screen and clock widget) | ||
* Added patreons list in about screen | ||
* Added contributors list in about screen | ||
|
||
🐛 Fixes | ||
|
||
* Fixed app assuming foreground after alarm rings, even though it was closed before | ||
* Fixed tap splash color | ||
* Fixed media, notification and ringtone audio channels not working | ||
* Fixed other apps' music not restarting after alarm rings | ||
* Fixed upcoming alarm notification appearing after alarm rings | ||
* Fixed upcoming alarm notification not updating for repeating alarms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
✨ Enhancements | ||
|
||
* Updated translations | ||
|
||
🐛 Fixes | ||
|
||
* Removed extra space at the end of long date formats | ||
* Fix timer fullscreen notification not dismissing | ||
* Fix fastest and slowest laps of stopwatch not saving |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
✨ Enhancements | ||
|
||
* Updated translations | ||
|
||
🐛 Fixes | ||
|
||
* Removed extra space at the end of long date formats | ||
* Fix timer fullscreen notification not dismissing | ||
* Fix fastest and slowest laps of stopwatch not saving |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
✨ Enhancements | ||
|
||
* Updated translations | ||
|
||
🐛 Fixes | ||
|
||
* Removed extra space at the end of long date formats | ||
* Fix timer fullscreen notification not dismissing | ||
* Fix fastest and slowest laps of stopwatch not saving |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,76 @@ | ||
import 'package:clock_app/alarm/types/alarm.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_gen/gen_l10n/app_localizations.dart'; | ||
|
||
String getNewAlarmSnackbarText(Alarm alarm) { | ||
String getRemainingAlarmTimeText(BuildContext context, Alarm alarm) { | ||
Duration etaNextAlarm = | ||
alarm.currentScheduleDateTime!.difference(DateTime.now().toLocal()); | ||
|
||
String etaText = ''; | ||
|
||
AppLocalizations localizations = AppLocalizations.of(context)!; | ||
|
||
if (etaNextAlarm.inDays > 0) { | ||
etaText = localizations.daysString(etaNextAlarm.inDays); | ||
} else if (etaNextAlarm.inHours > 0) { | ||
int hours = etaNextAlarm.inHours; | ||
int minutes = etaNextAlarm.inMinutes % 60; | ||
if (minutes > 0) { | ||
etaText = localizations.combinedTime(localizations.hoursString(hours), | ||
localizations.minutesString(minutes)); | ||
} else { | ||
etaText = localizations.hoursString(hours); | ||
} | ||
} else if (etaNextAlarm.inMinutes > 0) { | ||
int minutes = etaNextAlarm.inMinutes; | ||
etaText = localizations.minutesString(minutes); | ||
} else { | ||
etaText = localizations.lessThanOneMinute; | ||
} | ||
|
||
return etaText; | ||
} | ||
|
||
String getShortRemainingAlarmTimeText(BuildContext context, Alarm alarm) { | ||
Duration etaNextAlarm = | ||
alarm.currentScheduleDateTime!.difference(DateTime.now().toLocal()); | ||
|
||
String etaText = ''; | ||
|
||
AppLocalizations localizations = AppLocalizations.of(context)!; | ||
|
||
if (etaNextAlarm.inDays > 0) { | ||
int days = etaNextAlarm.inDays; | ||
String dayTextSuffix = days <= 1 ? 'day' : 'days'; | ||
etaText = '$days $dayTextSuffix'; | ||
etaText = localizations.daysString(etaNextAlarm.inDays); | ||
} else if (etaNextAlarm.inHours > 0) { | ||
int hours = etaNextAlarm.inHours; | ||
int minutes = etaNextAlarm.inMinutes % 60; | ||
String hourTextSuffix = hours <= 1 ? 'hour' : 'hours'; | ||
String minuteTextSuffix = minutes <= 1 ? 'minute' : 'minutes'; | ||
String hoursText = '$hours $hourTextSuffix'; | ||
String minutesText = minutes == 0 ? '' : ' and $minutes $minuteTextSuffix'; | ||
etaText = '$hoursText$minutesText'; | ||
if (minutes > 0) { | ||
etaText = '${localizations.shortHoursString(hours)} ${localizations.shortMinutesString(minutes)}'; | ||
} else { | ||
etaText = localizations.shortHoursString(hours); | ||
} | ||
} else if (etaNextAlarm.inMinutes > 0) { | ||
int minutes = etaNextAlarm.inMinutes; | ||
String minuteTextSuffix = minutes <= 1 ? 'minute' : 'minutes'; | ||
etaText = '$minutes $minuteTextSuffix'; | ||
etaText = localizations.shortMinutesString(minutes); | ||
} else { | ||
etaText = 'less than 1 minute'; | ||
etaText = localizations.shortMinutesString(1); | ||
} | ||
|
||
return 'Alarm will ring in $etaText'; | ||
return etaText; | ||
} | ||
|
||
String getNewAlarmText(BuildContext context, Alarm alarm) { | ||
AppLocalizations localizations = AppLocalizations.of(context)!; | ||
|
||
final etaText = getRemainingAlarmTimeText(context, alarm); | ||
|
||
return localizations.alarmRingInMessage(etaText); | ||
} | ||
|
||
String getNextAlarmText(BuildContext context, Alarm alarm) { | ||
AppLocalizations localizations = AppLocalizations.of(context)!; | ||
|
||
final etaText = getShortRemainingAlarmTimeText(context, alarm); | ||
|
||
return localizations.nextAlarmIn(etaText); | ||
} |
Oops, something went wrong.