Skip to content

Instantly share code, notes, and snippets.

View DivS-15's full-sized avatar

Divyansh Saraswat DivS-15

View GitHub Profile
object WorkManagerInitializer : Initializer<WorkManager> {
override fun create(@ApplicationContext context: Context): WorkManager {
val configuration = Configuration.Builder().build()
WorkManager.initialize(context, configuration)
Log.d("Hilt Init", "WorkManager initialized by Hilt this time")
private const val STARTING_PAGE_TOKEN = " "
class VideosPagingSource @Inject constructor(
private val coroutineScope: CoroutineScope,
private val remoteApiService: VideosRemoteInterface
) : PagingSource<String, Item>() {
override fun getRefreshKey(state: PagingState<String, Item>): String? {
var current: String? = " "