30 lines
994 B
Kotlin
30 lines
994 B
Kotlin
package com.example.testes
|
|
|
|
import android.os.Bundle
|
|
import androidx.fragment.app.Fragment
|
|
import android.view.LayoutInflater
|
|
import android.view.View
|
|
import android.view.ViewGroup
|
|
import androidx.recyclerview.widget.GridLayoutManager
|
|
import androidx.recyclerview.widget.RecyclerView
|
|
|
|
class ImageGridFragment(val images: List<BooruImage>) : Fragment() {
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
super.onCreate(savedInstanceState)
|
|
}
|
|
|
|
override fun onCreateView(
|
|
inflater: LayoutInflater, container: ViewGroup?,
|
|
savedInstanceState: Bundle?
|
|
): View? {
|
|
// Inflate the layout for this fragment
|
|
val layoutView = inflater.inflate(R.layout.fragment_image_grid, container, false)
|
|
|
|
val recyclerView : RecyclerView = layoutView.findViewById(R.id.imageGridRecV)
|
|
recyclerView.adapter = ImageGridAdapter(images)
|
|
recyclerView.layoutManager = GridLayoutManager(layoutView.context, 3)
|
|
|
|
return layoutView
|
|
}
|
|
} |