feat(tv-ui): split pengumuman tab and refine main text-slide behavior

This commit is contained in:
dwindown
2026-04-03 22:03:18 +07:00
parent 14c3850092
commit af82418c09
6 changed files with 1523 additions and 517 deletions

View File

@@ -50,15 +50,19 @@ class AppSettings extends HiveObject {
// Blank screen durations
@HiveField(12)
int blankScreenNormal; // minutes
int blankScreenNormal; // minutes
@HiveField(13)
int blankScreenJumat; // minutes
int blankScreenJumat; // minutes
// Running text items
@HiveField(14)
List<String> runningTexts;
// Center text-slide items (separate from running ticker at bottom).
@HiveField(35)
List<String> textSlides;
// Friday officers
@HiveField(15)
String khatibName;
@@ -81,6 +85,14 @@ class AppSettings extends HiveObject {
@HiveField(32)
String? lastAutoSyncAttemptDate;
// Center hero block duration on main screen (seconds).
@HiveField(33)
int mainCenterSlideDurationSec;
// Per-text announcement slide duration on main screen (seconds).
@HiveField(34)
int announcementSlideDurationSec;
// Slideshow image paths (local)
@HiveField(20)
List<String> slideshowImages;
@@ -128,6 +140,14 @@ class AppSettings extends HiveObject {
@HiveField(31)
int hijriOffsetDays;
// Group: Top header (identity + date on upper area)
@HiveField(36)
double scaleTopHeader;
// Group: Center text slides (pengumuman in main area)
@HiveField(37)
double scaleTextSlideCenter;
AppSettings({
this.masjidName = 'Masjid Al-Ikhlas',
this.masjidAddress = 'Jl. Kebaikan No. 1',
@@ -147,12 +167,18 @@ class AppSettings extends HiveObject {
'Mohon luruskan dan rapatkan shaf',
'Kajian rutin setiap Ahad pagi',
],
this.textSlides = const [
'Mohon luruskan dan rapatkan shaf',
'Kajian rutin setiap Ahad pagi',
],
this.khatibName = 'Ust. Fulan, S.Ag',
this.imamName = 'Ust. Alan, Lc',
this.mainScreenDurationSec = 15,
this.slideDurationSec = 10,
this.lastSyncDate,
this.lastAutoSyncAttemptDate,
this.mainCenterSlideDurationSec = 10,
this.announcementSlideDurationSec = 7,
this.slideshowImages = const [],
this.textScaleIndex = 1,
this.useUnsplashBackground = false,
@@ -165,6 +191,8 @@ class AppSettings extends HiveObject {
this.scaleCardBody = 1.0,
this.scaleRunningText = 1.0,
this.hijriOffsetDays = 0,
this.scaleTopHeader = 1.0,
this.scaleTextSlideCenter = 1.0,
});
AppSettings copyWith({
@@ -183,12 +211,15 @@ class AppSettings extends HiveObject {
int? blankScreenNormal,
int? blankScreenJumat,
List<String>? runningTexts,
List<String>? textSlides,
String? khatibName,
String? imamName,
int? mainScreenDurationSec,
int? slideDurationSec,
String? lastSyncDate,
String? lastAutoSyncAttemptDate,
int? mainCenterSlideDurationSec,
int? announcementSlideDurationSec,
List<String>? slideshowImages,
int? textScaleIndex,
bool? useUnsplashBackground,
@@ -201,6 +232,8 @@ class AppSettings extends HiveObject {
double? scaleCardBody,
double? scaleRunningText,
int? hijriOffsetDays,
double? scaleTopHeader,
double? scaleTextSlideCenter,
}) {
return AppSettings(
masjidName: masjidName ?? this.masjidName,
@@ -218,18 +251,26 @@ class AppSettings extends HiveObject {
blankScreenNormal: blankScreenNormal ?? this.blankScreenNormal,
blankScreenJumat: blankScreenJumat ?? this.blankScreenJumat,
runningTexts: runningTexts ?? this.runningTexts,
textSlides: textSlides ?? this.textSlides,
khatibName: khatibName ?? this.khatibName,
imamName: imamName ?? this.imamName,
mainScreenDurationSec: mainScreenDurationSec ?? this.mainScreenDurationSec,
mainScreenDurationSec:
mainScreenDurationSec ?? this.mainScreenDurationSec,
slideDurationSec: slideDurationSec ?? this.slideDurationSec,
lastSyncDate: lastSyncDate ?? this.lastSyncDate,
lastAutoSyncAttemptDate:
lastAutoSyncAttemptDate ?? this.lastAutoSyncAttemptDate,
mainCenterSlideDurationSec:
mainCenterSlideDurationSec ?? this.mainCenterSlideDurationSec,
announcementSlideDurationSec:
announcementSlideDurationSec ?? this.announcementSlideDurationSec,
slideshowImages: slideshowImages ?? this.slideshowImages,
textScaleIndex: textScaleIndex ?? this.textScaleIndex,
useUnsplashBackground: useUnsplashBackground ?? this.useUnsplashBackground,
useUnsplashBackground:
useUnsplashBackground ?? this.useUnsplashBackground,
unsplashKeyword: unsplashKeyword ?? this.unsplashKeyword,
unsplashRotationHours: unsplashRotationHours ?? this.unsplashRotationHours,
unsplashRotationHours:
unsplashRotationHours ?? this.unsplashRotationHours,
brandedBgImage: brandedBgImage ?? this.brandedBgImage,
runningTextDurations: runningTextDurations ?? this.runningTextDurations,
marqueeAnimType: marqueeAnimType ?? this.marqueeAnimType,
@@ -237,6 +278,9 @@ class AppSettings extends HiveObject {
scaleCardBody: scaleCardBody ?? this.scaleCardBody,
scaleRunningText: scaleRunningText ?? this.scaleRunningText,
hijriOffsetDays: hijriOffsetDays ?? this.hijriOffsetDays,
scaleTopHeader: scaleTopHeader ?? this.scaleTopHeader,
scaleTextSlideCenter:
scaleTextSlideCenter ?? this.scaleTextSlideCenter,
);
}
}
@@ -253,6 +297,7 @@ class AppSettingsAdapter extends TypeAdapter<AppSettings> {
for (int i = 0; i < numOfFields; i++) {
fields[reader.readByte()] = reader.read();
}
final runningTexts = (fields[14] as List?)?.cast<String>() ?? const [];
return AppSettings(
masjidName: fields[0] as String? ?? 'Masjid Al-Ikhlas',
masjidAddress: fields[1] as String? ?? 'Jl. Kebaikan No. 1',
@@ -268,13 +313,17 @@ class AppSettingsAdapter extends TypeAdapter<AppSettings> {
preAdzanLead: fields[11] as int? ?? 10,
blankScreenNormal: fields[12] as int? ?? 15,
blankScreenJumat: fields[13] as int? ?? 45,
runningTexts: (fields[14] as List?)?.cast<String>() ?? const [],
runningTexts: runningTexts,
textSlides:
(fields[35] as List?)?.cast<String>() ?? List<String>.from(runningTexts),
khatibName: fields[15] as String? ?? '',
imamName: fields[16] as String? ?? '',
mainScreenDurationSec: fields[17] as int? ?? 15,
slideDurationSec: fields[18] as int? ?? 10,
lastSyncDate: fields[19] as String?,
lastAutoSyncAttemptDate: fields[32] as String?,
mainCenterSlideDurationSec: fields[33] as int? ?? 10,
announcementSlideDurationSec: fields[34] as int? ?? 7,
slideshowImages: (fields[20] as List?)?.cast<String>() ?? const [],
textScaleIndex: fields[21] as int? ?? 1,
useUnsplashBackground: fields[22] as bool? ?? false,
@@ -287,46 +336,91 @@ class AppSettingsAdapter extends TypeAdapter<AppSettings> {
scaleCardBody: (fields[29] as num?)?.toDouble() ?? 1.0,
scaleRunningText: (fields[30] as num?)?.toDouble() ?? 1.0,
hijriOffsetDays: fields[31] as int? ?? 0,
scaleTopHeader: (fields[36] as num?)?.toDouble() ?? 1.0,
scaleTextSlideCenter: (fields[37] as num?)?.toDouble() ?? 1.0,
);
}
@override
void write(BinaryWriter writer, AppSettings obj) {
writer
..writeByte(38)
..writeByte(0)
..write(obj.masjidName)
..writeByte(1)
..write(obj.masjidAddress)
..writeByte(2)
..write(obj.cityIdApi)
..writeByte(3)
..write(obj.cityDisplayName)
..writeByte(4)
..write(obj.showImsak)
..writeByte(5)
..write(obj.showTerbit)
..writeByte(6)
..write(obj.iqomahSubuh)
..writeByte(7)
..write(obj.iqomahDzuhur)
..writeByte(8)
..write(obj.iqomahAshar)
..writeByte(9)
..write(obj.iqomahMaghrib)
..writeByte(10)
..write(obj.iqomahIsya)
..writeByte(11)
..write(obj.preAdzanLead)
..writeByte(12)
..write(obj.blankScreenNormal)
..writeByte(13)
..write(obj.blankScreenJumat)
..writeByte(14)
..write(obj.runningTexts)
..writeByte(35)
..write(obj.textSlides)
..writeByte(15)
..write(obj.khatibName)
..writeByte(16)
..write(obj.imamName)
..writeByte(17)
..write(obj.mainScreenDurationSec)
..writeByte(18)
..write(obj.slideDurationSec)
..writeByte(19)
..write(obj.lastSyncDate)
..writeByte(32)
..write(obj.lastAutoSyncAttemptDate)
..writeByte(33)
..writeByte(0)..write(obj.masjidName)
..writeByte(1)..write(obj.masjidAddress)
..writeByte(2)..write(obj.cityIdApi)
..writeByte(3)..write(obj.cityDisplayName)
..writeByte(4)..write(obj.showImsak)
..writeByte(5)..write(obj.showTerbit)
..writeByte(6)..write(obj.iqomahSubuh)
..writeByte(7)..write(obj.iqomahDzuhur)
..writeByte(8)..write(obj.iqomahAshar)
..writeByte(9)..write(obj.iqomahMaghrib)
..writeByte(10)..write(obj.iqomahIsya)
..writeByte(11)..write(obj.preAdzanLead)
..writeByte(12)..write(obj.blankScreenNormal)
..writeByte(13)..write(obj.blankScreenJumat)
..writeByte(14)..write(obj.runningTexts)
..writeByte(15)..write(obj.khatibName)
..writeByte(16)..write(obj.imamName)
..writeByte(17)..write(obj.mainScreenDurationSec)
..writeByte(18)..write(obj.slideDurationSec)
..writeByte(19)..write(obj.lastSyncDate)
..writeByte(32)..write(obj.lastAutoSyncAttemptDate)
..writeByte(20)..write(obj.slideshowImages)
..writeByte(21)..write(obj.textScaleIndex)
..writeByte(22)..write(obj.useUnsplashBackground)
..writeByte(23)..write(obj.unsplashKeyword)
..writeByte(24)..write(obj.unsplashRotationHours)
..writeByte(25)..write(obj.brandedBgImage)
..writeByte(26)..write(obj.runningTextDurations)
..writeByte(27)..write(obj.marqueeAnimType)
..writeByte(28)..write(obj.scaleCardLabel)
..writeByte(29)..write(obj.scaleCardBody)
..writeByte(30)..write(obj.scaleRunningText)
..writeByte(31)..write(obj.hijriOffsetDays);
..write(obj.mainCenterSlideDurationSec)
..writeByte(34)
..write(obj.announcementSlideDurationSec)
..writeByte(20)
..write(obj.slideshowImages)
..writeByte(21)
..write(obj.textScaleIndex)
..writeByte(22)
..write(obj.useUnsplashBackground)
..writeByte(23)
..write(obj.unsplashKeyword)
..writeByte(24)
..write(obj.unsplashRotationHours)
..writeByte(25)
..write(obj.brandedBgImage)
..writeByte(26)
..write(obj.runningTextDurations)
..writeByte(27)
..write(obj.marqueeAnimType)
..writeByte(28)
..write(obj.scaleCardLabel)
..writeByte(29)
..write(obj.scaleCardBody)
..writeByte(30)
..write(obj.scaleRunningText)
..writeByte(31)
..write(obj.hijriOffsetDays)
..writeByte(36)
..write(obj.scaleTopHeader)
..writeByte(37)
..write(obj.scaleTextSlideCenter);
}
}
@@ -426,14 +520,23 @@ class DailyPrayerScheduleAdapter extends TypeAdapter<DailyPrayerSchedule> {
void write(BinaryWriter writer, DailyPrayerSchedule obj) {
writer
..writeByte(9)
..writeByte(0)..write(obj.date)
..writeByte(1)..write(obj.imsak)
..writeByte(2)..write(obj.subuh)
..writeByte(3)..write(obj.terbit)
..writeByte(4)..write(obj.dhuha)
..writeByte(5)..write(obj.dzuhur)
..writeByte(6)..write(obj.ashar)
..writeByte(7)..write(obj.maghrib)
..writeByte(8)..write(obj.isya);
..writeByte(0)
..write(obj.date)
..writeByte(1)
..write(obj.imsak)
..writeByte(2)
..write(obj.subuh)
..writeByte(3)
..write(obj.terbit)
..writeByte(4)
..write(obj.dhuha)
..writeByte(5)
..write(obj.dzuhur)
..writeByte(6)
..write(obj.ashar)
..writeByte(7)
..write(obj.maghrib)
..writeByte(8)
..write(obj.isya);
}
}