Skip to content

Commit

Permalink
Merge pull request quran#1903 from aabdurrahman/reclib
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedre authored Mar 4, 2022
2 parents 210f2cc + c7de88b commit 6b8cac3
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 0 deletions.
28 changes: 28 additions & 0 deletions common/recitation/build.gradle
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}"
}
1 change: 1 addition & 0 deletions common/recitation/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<manifest package="com.quran.recitation.common"/>
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>
}
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
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.quran.recitation.common

interface RecitationType {
fun isValid(): Boolean
}
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()
}
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?
}
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>
}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ include ':common:di'
include ':common:networking'
include ':common:pages'
include ':common:reading'
include ':common:recitation'
include ':common:search'
include ':common:toolbar'
include ':common:upgrade'
Expand Down

0 comments on commit 6b8cac3

Please sign in to comment.