Skip to content

Instantly share code, notes, and snippets.

View NEMMFIELD's full-sized avatar

Никита Марков NEMMFIELD

  • Дубна
View GitHub Profile
fun main() = runBlocking {
val sequence = sequenceOf(0, 1, 2, 3, 4, 5, 6, 7 ,8 ,9 ,10)
val flow = sequence.asFlow()
flow.collect { value ->
println(value)
delay(1000)
when {
value % 5 == 0 -> println("Connected")
value % 3 == 0 -> println("Disconnected")
(value % 5 == 0) && (value % 3 == 0) -> println("Connected")
@NEMMFIELD
NEMMFIELD / FragmentMovieList
Created January 20, 2021 19:59
Movie Scrolling
class FragmentMoviesList : Fragment(), CellClickListener {
private var movieListRecycler: RecyclerView? = null
private lateinit var layoutManager: GridLayoutManager
private var isLoading = false
private lateinit var adapter: MovieListAdapter
private var scope = CoroutineScope(Dispatchers.Main)
private val viewModel: MovieListViewModel by viewModels {
MovieListViewModelFactory(
requireContext()
)