From 273d5551ed9c053b8af97c52a7f7c88733dcd2b0 Mon Sep 17 00:00:00 2001 From: "Kosrat D. Ahmad" Date: Sun, 30 Aug 2020 22:10:47 +0300 Subject: [PATCH 1/2] Refactor Long to Int in the models --- .../src/main/java/dev/kosrat/muslimdata/database/Room.kt | 2 +- .../main/java/dev/kosrat/muslimdata/models/AzkarCategory.kt | 2 +- .../main/java/dev/kosrat/muslimdata/models/AzkarChapter.kt | 4 ++-- .../src/main/java/dev/kosrat/muslimdata/models/AzkarItem.kt | 5 ++--- .../dev/kosrat/muslimdata/repository/MuslimRepository.kt | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/muslim-data/src/main/java/dev/kosrat/muslimdata/database/Room.kt b/muslim-data/src/main/java/dev/kosrat/muslimdata/database/Room.kt index 8b8d7fa..bbd9168 100644 --- a/muslim-data/src/main/java/dev/kosrat/muslimdata/database/Room.kt +++ b/muslim-data/src/main/java/dev/kosrat/muslimdata/database/Room.kt @@ -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? + fun getAzkarChapters(language: String, categoryId: Int): List? /** * Get azkar items from the database for the specified chapter id and language. diff --git a/muslim-data/src/main/java/dev/kosrat/muslimdata/models/AzkarCategory.kt b/muslim-data/src/main/java/dev/kosrat/muslimdata/models/AzkarCategory.kt index 9e92939..e92509f 100644 --- a/muslim-data/src/main/java/dev/kosrat/muslimdata/models/AzkarCategory.kt +++ b/muslim-data/src/main/java/dev/kosrat/muslimdata/models/AzkarCategory.kt @@ -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) diff --git a/muslim-data/src/main/java/dev/kosrat/muslimdata/models/AzkarChapter.kt b/muslim-data/src/main/java/dev/kosrat/muslimdata/models/AzkarChapter.kt index 8bb4e97..5111344 100644 --- a/muslim-data/src/main/java/dev/kosrat/muslimdata/models/AzkarChapter.kt +++ b/muslim-data/src/main/java/dev/kosrat/muslimdata/models/AzkarChapter.kt @@ -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 ) diff --git a/muslim-data/src/main/java/dev/kosrat/muslimdata/models/AzkarItem.kt b/muslim-data/src/main/java/dev/kosrat/muslimdata/models/AzkarItem.kt index 733ac1c..8612963 100644 --- a/muslim-data/src/main/java/dev/kosrat/muslimdata/models/AzkarItem.kt +++ b/muslim-data/src/main/java/dev/kosrat/muslimdata/models/AzkarItem.kt @@ -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 diff --git a/muslim-data/src/main/java/dev/kosrat/muslimdata/repository/MuslimRepository.kt b/muslim-data/src/main/java/dev/kosrat/muslimdata/repository/MuslimRepository.kt index c63097e..01678ad 100644 --- a/muslim-data/src/main/java/dev/kosrat/muslimdata/repository/MuslimRepository.kt +++ b/muslim-data/src/main/java/dev/kosrat/muslimdata/repository/MuslimRepository.kt @@ -95,7 +95,7 @@ class MuslimRepository(context: Context) { /** * Get azkar chapters for the specified language. */ - suspend fun getAzkarChapters(language: Language, categoryId: Long = -1): List? { + suspend fun getAzkarChapters(language: Language, categoryId: Int = -1): List? { return withContext(Dispatchers.IO) { muslimDb.muslimDataDao.getAzkarChapters(language.value, categoryId) } From a521749356e6b968e91a85d4f53ba0f38747f999 Mon Sep 17 00:00:00 2001 From: "Kosrat D. Ahmad" Date: Sun, 30 Aug 2020 22:13:04 +0300 Subject: [PATCH 2/2] Change library version in README file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b6c3c34..9f73551 100644 --- a/README.md +++ b/README.md @@ -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