From cb27d77325e539601a08b526de20991305868838 Mon Sep 17 00:00:00 2001 From: Hypersoft Inc Date: Tue, 7 Jan 2025 18:41:06 +0500 Subject: [PATCH] SonicOPT --- README.md | 43 +++++++++++++++++++ .../sonicopt/models/FastingItem.kt | 14 +++--- .../sonicopt/models/PrayerCustomAngle.kt | 12 +++++- .../sonicopt/models/PrayerItem.kt | 8 ++-- .../sonicopt/models/PrayerManualCorrection.kt | 25 +++++++---- .../sonicopt/models/PrayerTimes.kt | 14 +++--- 6 files changed, 87 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 7dbf6d9..a4eb0f1 100644 --- a/README.md +++ b/README.md @@ -268,6 +268,7 @@ data class PrayerItem( var prayerList: List ) ``` + #### PrayerTimes ```kotlin /** @@ -283,6 +284,47 @@ data class PrayerTimes( var isCurrentPrayer: Boolean = false ) ``` + +#### PrayerManualCorrection +```kotlin +/** + * Represents manual corrections to prayer times. + * + * Each correction is specified in minutes and applied to adjust prayer times. + * Corrections are restricted to a range of -59 to +59 minutes. + * If a correction exceeds this range, it is reset to 0 (no correction). + * + * @property fajrMinute Manual adjustment for Fajr prayer. + * @property zuhrMinute Manual adjustment for Zuhr prayer. + * @property asrMinute Manual adjustment for Asr prayer. + * @property maghribMinute Manual adjustment for Maghrib prayer. + * @property ishaMinute Manual adjustment for Isha prayer. + */ +data class PrayerManualCorrection( + var fajrMinute: Int = 0, + var zuhrMinute: Int = 0, + var asrMinute: Int = 0, + var maghribMinute: Int = 0, + var ishaMinute: Int = 0 +) +``` + +#### PrayerCustomAngle +```kotlin +/** + * Represents custom angles for Fajr and Isha prayers. + * + * These angles are used when the prayer time convention is set to CUSTOM. + * + * @property fajrAngle The custom angle for calculating Fajr prayer time. + * @property ishaAngle The custom angle for calculating Isha prayer time. + */ +data class PrayerCustomAngle( + val fajrAngle: Double = 9.0, + val ishaAngle: Double = 14.0 +) +``` + #### FastingItem ```kotlin /** @@ -300,6 +342,7 @@ data class FastingItem( ``` --- + ## Configuration Options ### High Latitude Adjustment (`HighLatitudeAdjustment`) diff --git a/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/FastingItem.kt b/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/FastingItem.kt index 236fc14..b1e6d1a 100644 --- a/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/FastingItem.kt +++ b/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/FastingItem.kt @@ -9,14 +9,14 @@ package com.orbitalsonic.sonicopt.models */ /** - * Represents the Sehri (pre-dawn meal) and Iftaar (breaking fast) times for a specific day. + * Represents fasting times for a specific day, including Sehri and Iftaar times. * - * @property date in milli seconds. - * @property sehriTime The time for Sehri, equivalent to Fajr prayer time. - * @property iftaarTime The time for Iftaar, equivalent to Maghrib prayer time. + * @property date The date of the fasting times in milliseconds since epoch. + * @property sehriTime The time for Sehri (pre-dawn meal), equivalent to the Fajr prayer time. + * @property iftaarTime The time for Iftaar (breaking the fast), equivalent to the Maghrib prayer time. */ data class FastingItem( - var date:Long, - val sehriTime: String, - val iftaarTime: String + var date: Long, // The date of the specific fasting day in milliseconds. + val sehriTime: String, // Time for Sehri, usually matches Fajr prayer time. + val iftaarTime: String // Time for Iftaar, usually matches Maghrib prayer time. ) diff --git a/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/PrayerCustomAngle.kt b/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/PrayerCustomAngle.kt index 9ddd19a..31f023c 100644 --- a/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/PrayerCustomAngle.kt +++ b/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/PrayerCustomAngle.kt @@ -9,7 +9,15 @@ package com.orbitalsonic.sonicopt.models */ +/** + * Represents custom angles for Fajr and Isha prayers. + * + * These angles are used when the prayer time convention is set to CUSTOM. + * + * @property fajrAngle The custom angle for calculating Fajr prayer time. + * @property ishaAngle The custom angle for calculating Isha prayer time. + */ data class PrayerCustomAngle( - val fajrAngle: Double = 9.0, - val ishaAngle: Double = 14.0 + val fajrAngle: Double = 9.0, // Default angle for Fajr prayer. + val ishaAngle: Double = 14.0 // Default angle for Isha prayer. ) diff --git a/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/PrayerItem.kt b/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/PrayerItem.kt index 7b60f65..5d0584b 100644 --- a/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/PrayerItem.kt +++ b/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/PrayerItem.kt @@ -11,11 +11,11 @@ package com.orbitalsonic.sonicopt.models /** * Represents the prayer times for a specific day. * - * @property date in milli seconds. - * @property prayerList List of all five prayers and sunrise & sunset. + * @property date The date of the prayer times in milliseconds since epoch. + * @property prayerList A list containing the details of all five prayers, including sunrise and sunset times. */ data class PrayerItem( - var date:Long, - var prayerList:List + var date: Long, // The date of the specific day's prayer times in milliseconds. + var prayerList: List // List of prayer times and additional details for the day. ) diff --git a/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/PrayerManualCorrection.kt b/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/PrayerManualCorrection.kt index d4e903a..73e9b55 100644 --- a/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/PrayerManualCorrection.kt +++ b/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/PrayerManualCorrection.kt @@ -9,15 +9,22 @@ package com.orbitalsonic.sonicopt.models */ /** - * Time Should be in minutes - * Only allow manual corrections within the range of -59 to 59 minutes. - * If the correction is outside this range, set it to 0 (no correction). + * Represents manual corrections to prayer times. + * + * Each correction is specified in minutes and applied to adjust prayer times. + * Corrections are restricted to a range of -59 to +59 minutes. + * If a correction exceeds this range, it is reset to 0 (no correction). + * + * @property fajrMinute Manual adjustment for Fajr prayer. + * @property zuhrMinute Manual adjustment for Zuhr prayer. + * @property asrMinute Manual adjustment for Asr prayer. + * @property maghribMinute Manual adjustment for Maghrib prayer. + * @property ishaMinute Manual adjustment for Isha prayer. */ data class PrayerManualCorrection( - var fajrMinute: Int = 0, - var zuhrMinute: Int = 0, - var asrMinute: Int = 0, - var maghribMinute: Int = 0, - var ishaMinute: Int = 0 + var fajrMinute: Int = 0, // Adjustment for Fajr prayer in minutes. + var zuhrMinute: Int = 0, // Adjustment for Zuhr prayer in minutes. + var asrMinute: Int = 0, // Adjustment for Asr prayer in minutes. + var maghribMinute: Int = 0, // Adjustment for Maghrib prayer in minutes. + var ishaMinute: Int = 0 // Adjustment for Isha prayer in minutes. ) - diff --git a/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/PrayerTimes.kt b/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/PrayerTimes.kt index f615864..05f4398 100644 --- a/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/PrayerTimes.kt +++ b/sonicopt/src/main/java/com/orbitalsonic/sonicopt/models/PrayerTimes.kt @@ -9,15 +9,15 @@ package com.orbitalsonic.sonicopt.models */ /** - * Represents the prayer times for a specific day. + * Represents the details of an individual prayer time. * - * @property prayerName The name of the prayer (e.g., Fajr, Dhuhr, etc.). - * @property prayerTime The time of the prayer, formatted as per user settings. - * @property isCurrentPrayer Indicates whether this prayer is currently active. + * @property prayerName The name of the prayer (e.g., Fajr, Dhuhr, Asr, Maghrib, Isha). + * @property prayerTime The time of the prayer as a string, formatted based on user preferences. + * @property isCurrentPrayer A flag indicating whether this prayer is currently active (true) or not (false). */ data class PrayerTimes( - var prayerName: String, - var prayerTime: String, - var isCurrentPrayer: Boolean = false + var prayerName: String, // The name of the prayer. + var prayerTime: String, // The formatted prayer time. + var isCurrentPrayer: Boolean = false // Indicates if this is the currently active prayer. )