Skip to content

Commit

Permalink
Merge pull request #164 from vicolo-dev/release/0.4.0-beta1
Browse files Browse the repository at this point in the history
Release/0.4.0 beta1
  • Loading branch information
AhsanSarwar45 authored Apr 10, 2024
2 parents d1cbaf5 + 3277f9e commit e72fd0f
Show file tree
Hide file tree
Showing 154 changed files with 5,384 additions and 1,498 deletions.
1 change: 1 addition & 0 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
- name: Pub Get Packages
run: flutter pub get


- name: Build APK
run: flutter build apk --release --split-per-abi --flavor dev

Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
with:
distribution: 'adopt'
java-version: "17"
cache: 'gradle'
# cache: 'gradle'

- uses: subosito/flutter-action@v2
with:
flutter-version: "3.19.3"
channel: 'stable'
cache: true
cache: false

- name: Create key.properties
run: |
Expand All @@ -44,6 +44,11 @@ jobs:
- name: Turn off analytics
run: flutter config --no-analytics

- name: Clear cache
run: |
flutter clean
rm -rf ~/.gradle/caches
- name: Pub Get Packages
run: flutter pub get

Expand Down
2 changes: 2 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ if (keystorePropertiesFile.exists()) {
}

android {
// namespace "com.vicolo.chrono"

compileSdkVersion 34
ndkVersion flutter.ndkVersion

Expand Down
26 changes: 19 additions & 7 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission
android:name="android.permission.WAKE_LOCK" />
<!-- <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> -->
<!-- <uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" /> -->
<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />
<uses-permission
android:name="android.permission.USE_FULL_SCREEN_INTENT" />
<!-- <uses-permission -->
<!-- android:name="android.permission.SYSTEM_ALERT_WINDOW" /> -->
<uses-permission
android:name="android.permission.VIBRATE" />
<!-- <uses-permission -->
<!-- android:name="android.permission.INTERNET" /> -->
<uses-permission
android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
<!-- For Android 12 and higher -->
Expand All @@ -36,9 +34,6 @@
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
android:showWhenLocked="true"
android:showOnLockScreen="true"
android:turnScreenOn="true"
android:directBootAware="true"
>
<!-- Specifies an Android theme to apply to this Activity as soon as
Expand All @@ -62,6 +57,15 @@
<action android:name="android.intent.action.SET_TIMER" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.DISMISS_ALARM" />
<action android:name="android.intent.action.DISMISS_TIMER" />

<data android:scheme="id" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
Expand All @@ -83,6 +87,7 @@
android:name="dev.fluttercommunity.plus.androidalarmmanager.RebootBroadcastReceiver"
android:enabled="false"
android:exported="true"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED"
android:directBootAware="true"
>
<intent-filter>
Expand All @@ -99,6 +104,13 @@
android:permission="android.permission.BIND_JOB_SERVICE"
android:directBootAware="true"
/>
<!-- <service android:name="me.carda.awesome_notifications.core.services.ForegroundService" -->
<!-- android:enabled="true" -->
<!-- android:exported="false" -->
<!-- android:stopWithTask="true" -->
<!-- android:foregroundServiceType="phoneCall" -->
<!-- tools:replace="android:foregroundServiceType" -->
<!-- ></service> -->
<receiver
android:enabled="true"
android:exported="true"
Expand Down
Binary file added android/app/src/main/res/drawable/alarm_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/app/src/main/res/drawable/clock_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/app/src/main/res/drawable/timer_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ allprojects {
google()
mavenCentral()
}

// subprojects {
// afterEvaluate { project ->
// if (project.hasProperty('android')) {
// project.android {
// if (namespace == null) {
// namespace project.group
// }
// }
// }
// }
// }
}

rootProject.buildDir = '../build'
Expand All @@ -13,6 +25,8 @@ subprojects {
project.evaluationDependsOn(':app')
}

ext.kotlin_version = "1.8.0"

tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-all.zip
10 changes: 5 additions & 5 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@

pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}
settings.ext.flutterSdkPath = flutterSdkPath()
}()

includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

repositories {
google()
Expand All @@ -19,8 +19,8 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
id "com.android.application" version "7.4.2" apply false
id "org.jetbrains.kotlin.android" version "1.8.0" apply false
}

include ":app"
Expand Down
73 changes: 46 additions & 27 deletions lib/alarm/data/alarm_list_filters.dart
Original file line number Diff line number Diff line change
@@ -1,33 +1,52 @@
import 'package:clock_app/alarm/types/alarm.dart';
import 'package:clock_app/common/types/list_filter.dart';
import 'package:clock_app/common/types/tag.dart';
import 'package:clock_app/common/utils/date_time.dart';
import 'package:clock_app/common/utils/list_storage.dart';

final List<ListFilter<Alarm>> alarmListFilters = [
ListFilter(
'All',
(alarm) => true,
),
ListFilter(
'Today',
(alarm) {
final List<ListFilterItem<Alarm>> alarmListFilters = [
ListFilterSelect("Date", [

ListFilter(
'Today',
(alarm) {
if (alarm.currentScheduleDateTime == null) return false;
return alarm.currentScheduleDateTime!.isToday();
},
),
ListFilter('Tomorrow', (alarm) {
if (alarm.currentScheduleDateTime == null) return false;
return alarm.currentScheduleDateTime!.isToday();
},
),
ListFilter('Tomorrow', (alarm) {
if (alarm.currentScheduleDateTime == null) return false;
return alarm.currentScheduleDateTime!.isTomorrow();
return alarm.currentScheduleDateTime!.isTomorrow();
}),
]),
ListFilterSelect("State", [

ListFilter(
'Active',
(alarm) => alarm.isEnabled && !alarm.isFinished,
),
ListFilter(
'Snoozed',
(alarm) => alarm.isSnoozed,
),
ListFilter(
'Disabled',
(alarm) => !alarm.isEnabled,
),
ListFilter(
'Completed',
(alarm) => alarm.isFinished,
),
]),
//
DynamicListFilterMultiSelect("Tags", () {
final tags = loadListSync<Tag>("tags");
return tags.map((tag) {
return ListFilter<Alarm>(
tag.name,
(alarm) => alarm.tags.any((element) => element.id == tag.id),
id: tag.id,
);
}).toList();
}),
ListFilter(
'Snoozed',
(alarm) => alarm.isSnoozed,
),
ListFilter(
'Disabled',
(alarm) => !alarm.isEnabled,
),
ListFilter(
'Completed',
(alarm) => alarm.isFinished,
),
];
];
40 changes: 29 additions & 11 deletions lib/alarm/data/alarm_settings_schema.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ 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/types/ringtone_player.dart';
import 'package:clock_app/common/logic/tags.dart';
import 'package:clock_app/common/types/file_item.dart';
import 'package:clock_app/common/types/tag.dart';
import 'package:clock_app/common/utils/ringtones.dart';
import 'package:clock_app/settings/data/settings_schema.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/material.dart';

const alarmSchemaVersion = 4;
const alarmSchemaVersion = 5;

SettingGroup alarmSettingsSchema = SettingGroup(
version: alarmSchemaVersion,
Expand Down Expand Up @@ -56,22 +59,22 @@ SettingGroup alarmSettingsSchema = SettingGroup(
ToggleSettingOption("S", 7),
],
enableConditions: [
ValueCondition(["Type"], (value)=>value==WeeklyAlarmSchedule)
ValueCondition(["Type"], (value) => value == WeeklyAlarmSchedule)
],
),
DateTimeSetting(
"Dates",
[],
enableConditions: [
ValueCondition(["Type"], (value)=>value==DatesAlarmSchedule)
ValueCondition(["Type"], (value) => value == DatesAlarmSchedule)
],
),
DateTimeSetting(
"Date Range",
[],
rangeOnly: true,
enableConditions: [
ValueCondition(["Type"], (value)=>value==RangeAlarmSchedule)
ValueCondition(["Type"], (value) => value == RangeAlarmSchedule)
],
),
SelectSetting<RangeInterval>(
Expand All @@ -81,7 +84,7 @@ SettingGroup alarmSettingsSchema = SettingGroup(
SelectSettingOption("Weekly", RangeInterval.weekly),
],
enableConditions: [
ValueCondition(["Type"], (value)=>value==RangeAlarmSchedule)
ValueCondition(["Type"], (value) => value == RangeAlarmSchedule)
],
),
],
Expand All @@ -99,7 +102,7 @@ SettingGroup alarmSettingsSchema = SettingGroup(
onChange: (context, index) {
RingtonePlayer.stop();
},
shouldCloseOnSelect: false,
// shouldCloseOnSelect: false,
),
SelectSetting<AndroidAudioUsage>(
"Audio Channel", audioChannelOptions,
Expand All @@ -112,7 +115,7 @@ SettingGroup alarmSettingsSchema = SettingGroup(
DurationSetting(
"Time To Full Volume", const TimeDuration(minutes: 1),
enableConditions: [
ValueCondition(["Rising Volume"], (value)=>value==true)
ValueCondition(["Rising Volume"], (value) => value == true)
]),
],
),
Expand All @@ -129,21 +132,21 @@ SettingGroup alarmSettingsSchema = SettingGroup(
[
SwitchSetting("Enabled", true),
SliderSetting("Length", 1, 30, 5, unit: "minutes", enableConditions: [
ValueCondition(["Enabled"], (value)=>value==true)
ValueCondition(["Enabled"], (value) => value == true)
]),
SliderSetting("Max Snoozes", 1, 10, 3,
unit: "times",
snapLength: 1,
description:
"The maximum number of times the alarm can be snoozed before it is dismissed",
enableConditions: [
ValueCondition(["Enabled"], (value)=>value==true)
ValueCondition(["Enabled"], (value) => value == true)
]),
SettingGroup("While Snoozed", [
SwitchSetting("Prevent Disabling", false),
SwitchSetting("Prevent Deletion", false),
], enableConditions: [
ValueCondition(["Enabled"], (value)=>value==true)
ValueCondition(["Enabled"], (value) => value == true)
]),
],
icon: Icons.snooze_rounded,
Expand All @@ -157,12 +160,27 @@ SettingGroup alarmSettingsSchema = SettingGroup(
[],
alarmTaskSchemasMap.keys.map((key) => AlarmTask(key)).toList(),
addCardBuilder: (item) => AlarmTaskCard(task: item, isAddCard: true),
cardBuilder: (item) => AlarmTaskCard(task: item, isAddCard: false),
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();
// }
),
DynamicMultiSelectSetting<Tag>(
"Tags",
getTagOptions,
defaultValue: [],
),

// ListSetting<Tag>()
// CustomSetting<AlarmTaskList>("Tasks", AlarmTaskList([]),
// (context, setting) {
// return CustomizeAlarmTasksScreen(setting: setting);
Expand Down
Loading

0 comments on commit e72fd0f

Please sign in to comment.