Skip to content

Instantly share code, notes, and snippets.

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

Embed
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
import kotlinx.android.synthetic.main.fragment_list.*
class CategoriesFragment : AbstractFragment() {
override val layoutId = R.layout.fragment_list
private val adapter = CategoriesAdapter()
private lateinit var model: ViewModelCategories
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
model = ViewModelProviders.of(this).get(ViewModelCategories::class.java)
}
override fun onActivityCreated(savedInstanceState: Bundle?) {
super.onActivityCreated(savedInstanceState)
contentView = recycler_view
recycler_view.layoutManager = GridLayoutManager(context, 2)
recycler_view.adapter = adapter
checkData()
}
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.