PontiacGTX
03/31/2022, 2:10 PMPontiacGTX
03/31/2022, 2:12 PMfun loadImages(){
recyclerView!!.setHasFixedSize(true)
recyclerView!!.layoutManager = GridLayoutManager(this.activity,4)
try {
this.imageList = ImageGallery.GetImagesList(this.context as Context )
}
catch (ex:Exception)
{
println(ex.message)
}
try { galleryAdapter = GalleryAdapter(this.context as Context,imageList,
object : IPhotoInterface {
override fun onPhotoClick(stringPath: String):Unit {
//process picture on click
imageIntent = android.content.Intent(context,SecondaryActivity::class.java)
imageIntent.putExtra("image_file",File(stringPath))
try{
startActivity(imageIntent)
}catch(except:Exception)
{
println(except.message)
}
}
})
recyclerView?.adapter = galleryAdapter
galleryNumberText?.text = "${imageList.size} images"
}
catch(ex:Exception)
{
println(ex.message)
}
}