Skip to content

Commit

Permalink
Merge pull request #333 from vicolo-dev/release/0.6.0
Browse files Browse the repository at this point in the history
Merge changes form release
  • Loading branch information
azeem-io authored Sep 17, 2024
2 parents 2c83416 + 3d3460e commit 74b30f0
Show file tree
Hide file tree
Showing 143 changed files with 3,358 additions and 1,676 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.19.3' # or, you can use 1.22
flutter-version: '3.22.2' # or, you can use 1.22
channel: 'stable'
cache: true
- run: flutter test --coverage
Expand Down
2 changes: 2 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ android {
}
}



flutter {
source '../..'
}
Expand Down
9 changes: 6 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
<uses-permission
android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<uses-permission
android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<uses-permission android:name="android.permission.USE_EXACT_ALARM" />

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SYSTEM_EXEMPTED" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO"/>

<application
android:label="@string/app_name"
Expand Down Expand Up @@ -112,7 +115,7 @@
/>
<service
android:name="com.pravera.flutter_foreground_task.service.ForegroundService"
android:foregroundServiceType="systemExempted"
android:foregroundServiceType="specialUse"
android:exported="false" />
<!-- <service android:name="me.carda.awesome_notifications.core.services.ForegroundService" -->
<!-- android:enabled="true" -->
Expand Down

This file was deleted.

16 changes: 0 additions & 16 deletions android/app/src/main/kotlin/com/vicolo/chrono/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,10 @@ import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant;



class MainActivity: FlutterActivity() {
private val CHANNEL = "com.vicolo.chrono/alarm"

// // create static method channel
// companion object {
// lateinit var channel: MethodChannel
// }

// override fun onCreate(savedInstanceState: Bundle?) {
// super.onCreate(savedInstanceState)
// // MethodChannelHolder.init(flutterView)
// // MethodChannelHolder.invokeMethod("onBoot")
// }

override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)
// GeneratedPluginRegistrant.registerWith(flutterEngine)
// flutterEngine.plugins.add(InitiateCallsToDartInBgPlugin())

}
}
1 change: 1 addition & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ allprojects {
repositories {
google()
mavenCentral()
maven { url "${project(':background_fetch').projectDir}/libs" }
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:clock_app/alarm/data/alarm_settings_schema.dart';
import 'package:clock_app/alarm/types/notification_action.dart';
import 'package:clock_app/common/types/list_filter.dart';
import 'package:clock_app/icons/flux_icons.dart';
import 'package:clock_app/notifications/widgets/notification_actions/area_notification_action.dart';
import 'package:clock_app/notifications/widgets/notification_actions/buttons_notification_action.dart';
Expand Down Expand Up @@ -73,6 +74,30 @@ SettingGroup alarmAppSettingsSchema = SettingGroup(
]),
SettingGroup("Filters",
(context) => AppLocalizations.of(context)!.filtersSettingGroup, [
// CustomizableListSetting<ListFilter>(
// "Tasks",
// (context) => AppLocalizations.of(context)!.tasksSetting,
// [],
// // kDebugMode
// // ? [AlarmTask(AlarmTaskType.math), AlarmTask(AlarmTaskType.sequence)]
// // : [],
// alarmTaskSchemasMap.keys.map((key) => AlarmTask(key)).toList(),
// addCardBuilder: (item) => AlarmTaskCard(task: item, isAddCard: true),
// cardBuilder: (item, [onDelete, onDuplicate]) => AlarmTaskCard(
// task: item,
// isAddCard: false,
// onPressDelete: onDelete,
// onPressDuplicate: onDuplicate,
// ),
// valueDisplayBuilder: (context, setting) {
// return Text("${setting.value.length} tasks");
// },
// itemPreviewBuilder: (item) => TryAlarmTaskButton(alarmTask: item),
// // onChange: (context, value)async{
// // await appSettings.save();
// // }
// ),

SwitchSetting("Show Filters",
(context) => AppLocalizations.of(context)!.showFiltersSetting, true),
SwitchSetting("Show Sort",
Expand Down
27 changes: 27 additions & 0 deletions lib/alarm/data/alarm_events_sort_options.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import 'package:clock_app/alarm/types/alarm.dart';
import 'package:clock_app/alarm/types/alarm_event.dart';
import 'package:clock_app/common/types/list_filter.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

final List<ListSortOption<AlarmEvent>> alarmEventSortOptions = [
ListSortOption((context) => "Earlies start date", sortStartDateAscending),
ListSortOption((context) => "Latest start date", sortStartDateDescending),
ListSortOption((context) => "Earlies event date", sortEventDateAscending),
ListSortOption((context) => "Latest event date", sortEventDateDescending),
];

int sortStartDateAscending(AlarmEvent a, AlarmEvent b) {
return a.startDate.compareTo(b.startDate);
}

int sortStartDateDescending(AlarmEvent a, AlarmEvent b) {
return b.startDate.compareTo(a.startDate);
}

int sortEventDateAscending(AlarmEvent a, AlarmEvent b) {
return a.eventTime.compareTo(b.eventTime);
}

int sortEventDateDescending(AlarmEvent a, AlarmEvent b) {
return b.eventTime.compareTo(a.eventTime);
}
38 changes: 10 additions & 28 deletions lib/alarm/data/alarm_settings_schema.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'package:clock_app/alarm/types/schedules/weekly_alarm_schedule.dart';
import 'package:clock_app/alarm/widgets/alarm_task_card.dart';
import 'package:clock_app/alarm/widgets/try_alarm_task_button.dart';
import 'package:clock_app/audio/audio_channels.dart';
import 'package:clock_app/audio/screens/ringtones_screen.dart';
import 'package:clock_app/audio/types/ringtone_player.dart';
import 'package:clock_app/common/data/weekdays.dart';
import 'package:clock_app/common/logic/tags.dart';
Expand All @@ -19,13 +20,11 @@ import 'package:clock_app/common/types/tag.dart';
import 'package:clock_app/common/types/weekday.dart';
import 'package:clock_app/common/utils/ringtones.dart';
import 'package:clock_app/settings/data/settings_schema.dart';
import 'package:clock_app/settings/screens/ringtones_screen.dart';
import 'package:clock_app/settings/screens/tags_screen.dart';
import 'package:clock_app/settings/types/setting.dart';
import 'package:clock_app/settings/types/setting_enable_condition.dart';
import 'package:clock_app/settings/types/setting_group.dart';
import 'package:clock_app/timer/types/time_duration.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';

Expand Down Expand Up @@ -78,20 +77,6 @@ SettingGroup alarmSettingsSchema = SettingGroup(
),
],
),
// DynamicToggleSetting(
// "Week Days",
// (context) => AppLocalizations.of(context)!.alarmWeekdaysSetting,
// () {
// return weekdays
// .map((weekday) => SelectSettingOption(
// (context) => weekday.getAbbreviation(context), weekday))
// .toList();
// },
// enableConditions: [
// ValueCondition(["Type"], (value) => value == WeeklyAlarmSchedule)
// ],
// ),

ToggleSetting(
"Week Days",
(context) => AppLocalizations.of(context)!.alarmWeekdaysSetting,
Expand Down Expand Up @@ -122,7 +107,7 @@ SettingGroup alarmSettingsSchema = SettingGroup(
DateTimeSetting(
"Date Range",
(context) => AppLocalizations.of(context)!.alarmRangeSetting,
[DateTime.now(), DateTime.now().add(const Duration(days: 2))],
[],
rangeOnly: true,
enableConditions: [
ValueCondition(["Type"], (value) => value == RangeAlarmSchedule)
Expand Down Expand Up @@ -195,14 +180,13 @@ SettingGroup alarmSettingsSchema = SettingGroup(
],
// shouldCloseOnSelect: false,
),
SwitchSetting(
SwitchSetting(
"start_melody_at_random_pos",
(context) => AppLocalizations.of(context)!.startMelodyAtRandomPos,
false,
getDescription: (context) => AppLocalizations.of(context)!.startMelodyAtRandomPosDescription,

getDescription: (context) => AppLocalizations.of(context)!
.startMelodyAtRandomPosDescription,
),

SliderSetting(
"Volume",
(context) => AppLocalizations.of(context)!.volumeSetting,
Expand Down Expand Up @@ -309,12 +293,13 @@ SettingGroup alarmSettingsSchema = SettingGroup(
"Length",
],
),
ListSetting<AlarmTask>(
CustomizableListSetting<AlarmTask>(
"Tasks",
(context) => AppLocalizations.of(context)!.tasksSetting,
kDebugMode
? [AlarmTask(AlarmTaskType.math), AlarmTask(AlarmTaskType.sequence)]
: [],
[],
// kDebugMode
// ? [AlarmTask(AlarmTaskType.math), AlarmTask(AlarmTaskType.sequence)]
// : [],
alarmTaskSchemasMap.keys.map((key) => AlarmTask(key)).toList(),
addCardBuilder: (item) => AlarmTaskCard(task: item, isAddCard: true),
cardBuilder: (item, [onDelete, onDuplicate]) => AlarmTaskCard(
Expand All @@ -327,9 +312,6 @@ SettingGroup alarmSettingsSchema = SettingGroup(
return Text("${setting.value.length} tasks");
},
itemPreviewBuilder: (item) => TryAlarmTaskButton(alarmTask: item),
// onChange: (context, value)async{
// await appSettings.save();
// }
),
DynamicMultiSelectSetting<Tag>(
"Tags",
Expand Down
Loading

0 comments on commit 74b30f0

Please sign in to comment.