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

rebase 1.19 #1547

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import 'package:mawaqit/src/services/audio_manager.dart';
import 'package:mawaqit/src/services/FeatureManager.dart';
import 'package:mawaqit/src/services/mosque_manager.dart';
import 'package:mawaqit/src/services/theme_manager.dart';
import 'package:mawaqit/src/services/toggle_screen_feature_manager.dart';
import 'package:mawaqit/src/services/user_preferences_manager.dart';
import 'package:media_kit/media_kit.dart';
import 'package:path_provider/path_provider.dart';
Expand Down Expand Up @@ -62,6 +63,8 @@ Future<void> main() async {
],
),
);
await Future.delayed(const Duration(seconds: 5));
await ToggleScreenFeature.restoreScheduledTimers();
},
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class RandomHadithRemoteDataSource {
final document = XmlDocument.from(response.data)!;

final hadithXmlList = document.getElements('hadith');
log('random_hadith: RandomHadithRemoteDataSource: xml list ${hadithXmlList![0]}', time: DateTime.now());
log('random_hadith: RandomHadithRemoteDataSource: xml list ${hadithXmlList![3]}', time: DateTime.now());
return hadithXmlList;
},
debugName: 'random_hadith: getRandomHadithXML',
Expand Down
19 changes: 10 additions & 9 deletions lib/src/pages/SettingScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -416,17 +416,18 @@ class _SettingScreenState extends ConsumerState<SettingScreen> {
style: theme.textTheme.headlineSmall,
textAlign: TextAlign.center,
),
_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,
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).appTimezone,
subtitle: S.of(context).descTimezone,
Expand Down
3 changes: 3 additions & 0 deletions lib/src/pages/home/widgets/FlashWidget.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:marquee/marquee.dart';
import 'package:mawaqit/i18n/AppLanguage.dart';
import 'package:mawaqit/src/helpers/RelativeSizes.dart';
Expand Down Expand Up @@ -42,6 +43,8 @@ class _FlashWidgetState extends State<FlashWidget> {
velocity: 90,
blankSpace: 400,
style: TextStyle(
fontFamily:
flash.orientation == 'rtl' ? GoogleFonts.notoKufiArabic().fontFamily : GoogleFonts.roboto().fontFamily,
height: 1,
fontSize: 3.4.vwr,
fontWeight: FontWeight.bold,
Expand Down
33 changes: 10 additions & 23 deletions lib/src/services/mosque_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import 'package:mawaqit/src/const/constants.dart';
import 'package:mawaqit/src/helpers/Api.dart';
import 'package:mawaqit/src/helpers/PerformanceHelper.dart';
import 'package:mawaqit/src/helpers/SharedPref.dart';
import 'package:mawaqit/src/helpers/TimeShiftManager.dart';
import 'package:mawaqit/src/mawaqit_image/mawaqit_cache.dart';
import 'package:mawaqit/src/models/mosque.dart';
import 'package:mawaqit/src/models/mosqueConfig.dart';
Expand Down Expand Up @@ -216,29 +217,15 @@ class MosqueManager extends ChangeNotifier with WeatherMixin, AudioMixin, Mosque
(e) {
times = e;
final today = useTomorrowTimes ? AppDateTime.tomorrow() : AppDateTime.now();
if (isDeviceRooted) {
if (isToggleScreenActivated) {
ToggleScreenFeature.getLastEventDate().then((lastEventDate) async {
if (lastEventDate != null && lastEventDate.day != today.day) {
isEventsSet = false; // Reset the flag if it's a new day
await ToggleScreenFeature.cancelAllScheduledTimers();
ToggleScreenFeature.toggleFeatureState(false);
ToggleScreenFeature.checkEventsScheduled().then((_) {
if (!isEventsSet) {
ToggleScreenFeature.scheduleToggleScreen(
isIshaFajrOnly,
e.dayTimesStrings(today, salahOnly: false),
minuteBefore,
minuteAfter,
);
ToggleScreenFeature.toggleFeatureState(true);
ToggleScreenFeature.setLastEventDate(today);
isEventsSet = true;
}
});
}
});
}
final timeShiftManager = TimeShiftManager();

if (isDeviceRooted && isToggleScreenActivated && timeShiftManager.isLauncherInstalled) {
ToggleScreenFeature.handleDailyRescheduling(
isIshaFajrOnly: isIshaFajrOnly,
timeStrings: e.dayTimesStrings(today, salahOnly: false),
minuteBefore: minuteBefore,
minuteAfter: minuteAfter,
);
}

notifyListeners();
Expand Down
Loading
Loading