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
@Module | |
@InstallIn(SingletonComponent::class) | |
object WorkManagerInitializer : Initializer<WorkManager> { | |
@Provides | |
@Singleton | |
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") |
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
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? = " " |