Skip to content

Instantly share code, notes, and snippets.

@illuzor illuzor/CategoriesFragment.kt Secret
Created Sep 21, 2018

What would you like to do?
package com.illuzor.lesson.wallpapers.screens
import android.os.Bundle
import androidx.lifecycle.ViewModelProviders
import androidx.recyclerview.widget.GridLayoutManager
import com.illuzor.lesson.wallpapers.R
import com.illuzor.lesson.wallpapers.adapters.CategoriesAdapter
import com.illuzor.lesson.wallpapers.model.ViewModelCategories
class CategoriesFragment : AbstractFragment() {
override val layoutId = R.layout.fragment_list
private val adapter = CategoriesAdapter()
private lateinit var model: ViewModelCategories
override fun onCreate(savedInstanceState: Bundle?) {
model = ViewModelProviders.of(this).get(
override fun onActivityCreated(savedInstanceState: Bundle?) {
contentView = recycler_view
recycler_view.layoutManager = GridLayoutManager(context, 2)
recycler_view.adapter = adapter
private fun checkData() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.