-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start implementation of GitLabRepository
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
app/src/main/kotlin/com/apkupdater/data/gitlab/GitLabApp.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.apkupdater.data.gitlab | ||
|
||
data class GitLabApp( | ||
val packageName: String, | ||
val user: String, | ||
val repo: String | ||
) | ||
|
||
val GitLabApps = listOf( | ||
GitLabApp("com.aurora.store", "AuroraOSS", "AuroraStore"), | ||
GitLabApp("com.github.axet.bookreader", "axet", "android-book-reader") | ||
) |
27 changes: 27 additions & 0 deletions
27
app/src/main/kotlin/com/apkupdater/repository/GitLabRepository.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,27 @@ | ||
package com.apkupdater.repository | ||
|
||
import com.apkupdater.data.gitlab.GitLabApps | ||
import com.apkupdater.data.ui.AppInstalled | ||
import com.apkupdater.prefs.Prefs | ||
import com.apkupdater.service.GitLabService | ||
import kotlinx.coroutines.flow.flow | ||
|
||
|
||
class GitLabRepository( | ||
private val service: GitLabService, | ||
private val prefs: Prefs | ||
) { | ||
|
||
suspend fun updates(apps: List<AppInstalled>) = flow { | ||
|
||
GitLabApps.forEach { app -> | ||
apps.find { it.packageName == app.packageName }?.let { | ||
//checks.add(checkApp(apps, app.user, app.repo, app.packageName, it.version, app.extra)) | ||
} | ||
} | ||
emit(0) | ||
} | ||
|
||
private suspend fun checkApp() {} | ||
|
||
} |