Skip to content

Commit

Permalink
Improve models in the library
Browse files Browse the repository at this point in the history
  • Loading branch information
kosratdev committed Aug 30, 2020
2 parents c0fd616 + a521749 commit 18fcc08
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Most cities around the world find their prayer times by using some calculations

## Installation
```
implementation 'dev.kosrat.muslimdata:muslimdata:0.4'
implementation 'dev.kosrat.muslimdata:muslimdata:0.5'
```

## Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ internal interface MuslimDataDao {
"INNER JOIN azkar_chapter_translation as tr on tr.chapter_id = chapter._id " +
"WHERE language = :language and (:categoryId = -1 OR category_id = :categoryId)"
)
fun getAzkarChapters(language: String, categoryId: Long): List<AzkarChapter>?
fun getAzkarChapters(language: String, categoryId: Int): List<AzkarChapter>?

/**
* Get azkar items from the database for the specified chapter id and language.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ package dev.kosrat.muslimdata.models
/**
* Azkar Category class.
*/
data class AzkarCategory internal constructor(val categoryId: Long, val categoryName: String)
data class AzkarCategory internal constructor(val categoryId: Int, val categoryName: String)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package dev.kosrat.muslimdata.models
* chapterName).
*/
data class AzkarChapter internal constructor(
val chapterId: Long,
val categoryId: Long,
val chapterId: Int,
val categoryId: Int,
val chapterName: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ package dev.kosrat.muslimdata.models
* Azkar Item class that holds azkar item information such as (item, translation, and reference).
*/
data class AzkarItem internal constructor(
val itemId: Long,
val chapterId: Long,
val language: String,
val itemId: Int,
val chapterId: Int,
val item: String,
val translation: String,
val reference: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class MuslimRepository(context: Context) {
/**
* Get azkar chapters for the specified language.
*/
suspend fun getAzkarChapters(language: Language, categoryId: Long = -1): List<AzkarChapter>? {
suspend fun getAzkarChapters(language: Language, categoryId: Int = -1): List<AzkarChapter>? {
return withContext(Dispatchers.IO) {
muslimDb.muslimDataDao.getAzkarChapters(language.value, categoryId)
}
Expand Down

0 comments on commit 18fcc08

Please sign in to comment.