forked from quran/quran_android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quran#1903 from aabdurrahman/reclib
- Loading branch information
Showing
9 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
plugins { | ||
id 'com.android.library' | ||
id 'org.jetbrains.kotlin.android' | ||
id 'com.squareup.anvil' | ||
} | ||
|
||
android { | ||
compileSdkVersion deps.android.build.compileSdkVersion | ||
defaultConfig { | ||
minSdkVersion deps.android.build.minSdkVersion | ||
targetSdkVersion deps.android.build.targetSdkVersion | ||
} | ||
} | ||
|
||
anvil { generateDaggerFactories = true } | ||
|
||
dependencies { | ||
implementation project(path: ':common:data') | ||
|
||
implementation "androidx.annotation:annotation:${androidxAnnotationVersion}" | ||
|
||
// dagger | ||
implementation deps.dagger.runtime | ||
|
||
// coroutines | ||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:${coroutinesVersion}" | ||
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${coroutinesVersion}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<manifest package="com.quran.recitation.common"/> |
5 changes: 5 additions & 0 deletions
5
common/recitation/src/main/java/com/quran/recitation/common/Recitation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.quran.recitation.common | ||
|
||
interface Recitation { | ||
fun recitedAyahs(): List<RecitedAyah> | ||
} |
12 changes: 12 additions & 0 deletions
12
common/recitation/src/main/java/com/quran/recitation/common/RecitationSession.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.quran.recitation.common | ||
|
||
import com.quran.data.model.SuraAyah | ||
|
||
interface RecitationSession { | ||
fun id(): String | ||
|
||
fun startAyah(): SuraAyah | ||
fun currentAyah(): SuraAyah | ||
|
||
fun recitation(): Recitation | ||
} |
5 changes: 5 additions & 0 deletions
5
common/recitation/src/main/java/com/quran/recitation/common/RecitationType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.quran.recitation.common | ||
|
||
interface RecitationType { | ||
fun isValid(): Boolean | ||
} |
11 changes: 11 additions & 0 deletions
11
common/recitation/src/main/java/com/quran/recitation/common/RecitedAyah.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.quran.recitation.common | ||
|
||
import com.quran.data.model.SuraAyah | ||
|
||
interface RecitedAyah { | ||
fun ayah(): SuraAyah | ||
fun recitedSections(): List<RecitedSection> | ||
|
||
fun startTime(): Double? = recitedSections().firstOrNull()?.startTime() | ||
fun endTime(): Double? = recitedSections().lastOrNull()?.endTime() | ||
} |
20 changes: 20 additions & 0 deletions
20
common/recitation/src/main/java/com/quran/recitation/common/RecitedSection.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.quran.recitation.common | ||
|
||
import com.quran.data.model.AyahWord | ||
import com.quran.data.model.SuraAyah | ||
|
||
interface RecitedSection { | ||
fun type(): RecitationType | ||
fun ayah(): SuraAyah | ||
fun recitedWords(): List<RecitedWord> | ||
|
||
fun startWord(): AyahWord? | ||
fun endWord(): AyahWord? | ||
|
||
fun prevSection(): RecitedSection? | ||
fun nextSection(): RecitedSection? | ||
|
||
fun hasTimingInfo(): Boolean | ||
fun startTime(): Double? | ||
fun endTime(): Double? | ||
} |
13 changes: 13 additions & 0 deletions
13
common/recitation/src/main/java/com/quran/recitation/common/RecitedWord.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.quran.recitation.common | ||
|
||
import com.quran.data.model.AyahWord | ||
|
||
interface RecitedWord { | ||
fun text(): String | ||
|
||
fun hasTimingInfo(): Boolean | ||
fun startTime(): Double? | ||
fun endTime(): Double? | ||
|
||
fun matchedWords(): List<AyahWord> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters