Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/on off dim screen #1551

Merged
merged 25 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
69e6049
fix: Improve Quran Download and Navigation Experience (#1452)
YassinNouh21 Dec 1, 2024
243ae96
Update pubspec.yaml
ibrahim-zehhaf-mawaqit Dec 1, 2024
da6736a
fix: Resolve overlapping and focus issues for Back and Switch buttons…
YassinNouh21 Dec 1, 2024
6679d80
fix: Resolve pop-up issue when selecting Listening mode (#1455)
YassinNouh21 Dec 1, 2024
6601d42
Update pubspec.yaml
ibrahim-zehhaf-mawaqit Dec 2, 2024
195620e
merge main branch
ghassenbenzahra123 Dec 3, 2024
50435b9
Merge branch 'release-1.18.0' of https://github.com/mawaqit/android-t…
ghassenbenzahra123 Dec 22, 2024
e2645b9
fix merger conflict'
ghassenbenzahra123 Dec 22, 2024
8f70412
Merge branch 'release-1.18.0' of https://github.com/mawaqit/android-t…
ghassenbenzahra123 Dec 27, 2024
f345678
Merge branch 'release-1.18.0' of https://github.com/mawaqit/android-t…
ghassenbenzahra123 Dec 29, 2024
fec0e6a
Merge branch 'release-1.18.0' of https://github.com/mawaqit/android-t…
ghassenbenzahra123 Dec 31, 2024
52bdf78
Fix/reboot loop onvo bug (#1527)
ghassenbenzahra123 Jan 16, 2025
6016b8a
Fix/schedule on off (#1535)
ghassenbenzahra123 Jan 16, 2025
24eeb6a
Update pubspec.yaml
ibrahim-zehhaf-mawaqit Jan 17, 2025
a28c0cb
Merge branch 'release-1.18.0' of https://github.com/mawaqit/android-t…
ghassenbenzahra123 Jan 17, 2025
17d229d
change command on off screen tablet
ghassenbenzahra123 Jan 19, 2025
b151723
reenable screen lock feature
ghassenbenzahra123 Jan 20, 2025
5e6fba9
reshedule on different day
ghassenbenzahra123 Jan 23, 2025
b2ea227
Merge branch 'release-1.19' into fix/on-off-dim-screen
ghassenbenzahra123 Jan 23, 2025
16c1235
format code
ghassenbenzahra123 Jan 23, 2025
9c81faf
Merge branch 'fix/on-off-dim-screen' of https://github.com/mawaqit/an…
ghassenbenzahra123 Jan 23, 2025
1f4e88b
format code
ghassenbenzahra123 Jan 23, 2025
a60a41c
reenable on/off setting for tablet
ghassenbenzahra123 Jan 24, 2025
0466b3a
remove shuruk schedule timer
ghassenbenzahra123 Jan 28, 2025
f739143
remove print statements & add proper logging
ghassenbenzahra123 Jan 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/app/src/main/kotlin/com/flyweb/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ fun connectToNetworkWPA(call: MethodCall, result: MethodChannel.Result) {
AsyncTask.execute {
try {
val commands = listOf(
"input keyevent 26"
"echo 0 > /sys/class/backlight/backlight/brightness"
)
executeCommand(commands, result) // Lock the device
} catch (e: Exception) {
Expand All @@ -273,7 +273,7 @@ fun connectToNetworkWPA(call: MethodCall, result: MethodChannel.Result) {
AsyncTask.execute {
try {
val commands = listOf(
"input keyevent 82"
"echo 110 > /sys/class/backlight/backlight/brightness"
)
executeCommand(commands, result) // Lock the device
} catch (e: Exception) {
Expand Down
1 change: 1 addition & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Future<void> main() async {
Hive.registerAdapter(ReciterModelAdapter());
Hive.registerAdapter(MoshafModelAdapter());
MediaKit.ensureInitialized();

runApp(
riverpod.ProviderScope(
child: MyApp(),
Expand Down
43 changes: 43 additions & 0 deletions lib/src/domain/error/screen_on_off_exceptions.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
abstract class SchedulingException implements Exception {
final String message;
final String errorCode;

SchedulingException(this.message, this.errorCode);

@override
String toString() => 'Error ($errorCode): $message';
}

class ScheduleToggleScreenException extends SchedulingException {
ScheduleToggleScreenException(String message)
: super('Error occurred while scheduling toggle screen: $message', 'SCHEDULE_TOGGLE_SCREEN_ERROR');
}

class RestoreScheduledTimersException extends SchedulingException {
RestoreScheduledTimersException(String message)
: super('Error occurred while restoring scheduled timers: $message', 'RESTORE_SCHEDULED_TIMERS_ERROR');
}

class SchedulePrayerTimeException extends SchedulingException {
SchedulePrayerTimeException(String message)
: super('Error occurred while scheduling prayer time: $message', 'SCHEDULE_PRAYER_TIME_ERROR');
}

class LoadScheduledTimersException extends SchedulingException {
LoadScheduledTimersException(String message)
: super('Error occurred while loading scheduled timers: $message', 'LOAD_SCHEDULED_TIMERS_ERROR');
}

class DailyReschedulingException extends SchedulingException {
DailyReschedulingException(String message)
: super('Error occurred while handling daily rescheduling: $message', 'DAILY_RESCHEDULING_ERROR');
}

class TimerExecutionException extends SchedulingException {
TimerExecutionException(String message)
: super('Error occurred while executing timer action: $message', 'TIMER_EXECUTION_ERROR');
}

class UnknownSchedulingException extends SchedulingException {
UnknownSchedulingException(String message) : super('Unknown scheduling error: $message', 'UNKNOWN_SCHEDULING_ERROR');
}
19 changes: 9 additions & 10 deletions lib/src/pages/SettingScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -416,18 +416,17 @@ class _SettingScreenState extends ConsumerState<SettingScreen> {
style: theme.textTheme.headlineSmall,
textAlign: TextAlign.center,
),
if (timeShiftManager.isLauncherInstalled)
_SettingItem(
title: S.of(context).screenLock,
subtitle: S.of(context).screenLockDesc,
icon: Icon(Icons.power_settings_new, size: 35),
onTap: () => showDialog(
context: context,
builder: (context) => ScreenLockModal(
timeShiftManager: timeShiftManager,
),
_SettingItem(
title: S.of(context).screenLock,
subtitle: S.of(context).screenLockDesc,
icon: Icon(Icons.power_settings_new, size: 35),
onTap: () => showDialog(
context: context,
builder: (context) => ScreenLockModal(
timeShiftManager: timeShiftManager,
),
),
),
_SettingItem(
title: S.of(context).appTimezone,
subtitle: S.of(context).descTimezone,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/services/mosque_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class MosqueManager extends ChangeNotifier with WeatherMixin, AudioMixin, Mosque
final today = useTomorrowTimes ? AppDateTime.tomorrow() : AppDateTime.now();
final timeShiftManager = TimeShiftManager();

if (isDeviceRooted && isToggleScreenActivated && timeShiftManager.isLauncherInstalled) {
if (isDeviceRooted && isToggleScreenActivated) {
ToggleScreenFeature.handleDailyRescheduling(
isIshaFajrOnly: isIshaFajrOnly,
timeStrings: e.dayTimesStrings(today, salahOnly: false),
Expand Down
Loading