-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
80 changed files
with
2,915 additions
and
67 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
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
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 |
---|---|---|
|
@@ -175,4 +175,4 @@ DEPENDENCIES | |
fastlane | ||
|
||
BUNDLED WITH | ||
1.17.2 | ||
1.17.3 |
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
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
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,10 @@ | ||
package dependency.lib | ||
|
||
import dependency.Dependency | ||
|
||
object Work : Dependency { | ||
|
||
override val group = "androidx.work" | ||
override val artifact = "work" | ||
override val version = "2.5.0" | ||
} |
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
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
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
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
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
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,10 @@ | ||
package dependency.test | ||
|
||
import dependency.Dependency | ||
|
||
object Mockk : Dependency { | ||
|
||
override val group = "io.mockk" | ||
override val artifact = "mockk" | ||
override val version = "1.10.6" | ||
} |
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
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
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
kotlin.code.style=official | ||
|
||
android.enableJetifier=true | ||
android.useAndroidX=true | ||
org.gradle.parallel=true | ||
|
||
|
@@ -19,5 +18,3 @@ POM_LICENCE_DIST=repo | |
POM_DEVELOPER_ID=algolia | ||
POM_DEVELOPER_NAME=The Algolia Team | ||
POM_DEVELOPER_EMAIL=[email protected] | ||
|
||
RELEASE_SIGNING_ENABLED=false |
This file was deleted.
Oops, something went wrong.
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
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
36 changes: 36 additions & 0 deletions
36
...c/main/java/com/algolia/instantsearch/helper/android/list/RetryablePageKeyedDataSource.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,36 @@ | ||
package com.algolia.instantsearch.helper.android.list | ||
|
||
import androidx.paging.PageKeyedDataSource | ||
import kotlinx.coroutines.CoroutineDispatcher | ||
import kotlinx.coroutines.asExecutor | ||
import kotlinx.coroutines.withContext | ||
|
||
/** | ||
* A [PageKeyedDataSource] with retry capability. | ||
*/ | ||
public abstract class RetryablePageKeyedDataSource<Key, Value>(private val retryDispatcher: CoroutineDispatcher) : | ||
PageKeyedDataSource<Key, Value>() { | ||
|
||
internal var retry: (() -> Any)? = null | ||
|
||
public suspend fun retry() { | ||
retry?.let { prevRetry -> | ||
retry = null | ||
withContext(retryDispatcher) { | ||
prevRetry() | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Retries the latest call. | ||
*/ | ||
public fun retryAsync() { | ||
retry?.let { prevRetry -> | ||
retry = null | ||
retryDispatcher.asExecutor().execute { | ||
prevRetry() | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.