Skip to content

Commit

Permalink
SonicOPT
Browse files Browse the repository at this point in the history
  • Loading branch information
orbitalsonic committed Jan 7, 2025
1 parent 5808ea2 commit cb27d77
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 29 deletions.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ data class PrayerItem(
var prayerList: List<PrayerTimes>
)
```

#### PrayerTimes
```kotlin
/**
Expand All @@ -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
/**
Expand All @@ -300,6 +342,7 @@ data class FastingItem(
```
---


## Configuration Options

### High Latitude Adjustment (`HighLatitudeAdjustment`)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
)
Original file line number Diff line number Diff line change
Expand Up @@ -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.
)
Original file line number Diff line number Diff line change
Expand Up @@ -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<PrayerTimes>
var date: Long, // The date of the specific day's prayer times in milliseconds.
var prayerList: List<PrayerTimes> // List of prayer times and additional details for the day.
)

Original file line number Diff line number Diff line change
Expand Up @@ -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.
)

Original file line number Diff line number Diff line change
Expand Up @@ -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.
)

0 comments on commit cb27d77

Please sign in to comment.