Skip to content

A simple bitmap manager to load image from Android device's gallery

Notifications You must be signed in to change notification settings

carlol/GalleryLoader

Repository files navigation

GalleryLoader

A simple bitmap manager to load image from Android device's gallery

implementation 'io.carlol.android:galleryloader:1.0.2'
  • Simple library for simple task
  • Fragment and Activity support
  • Fix Samsung image rotation issue (this is the goal of the library)

Sample usage

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        btnLoadFromGalleryView.setOnClickListener {
            GalleryLoader.showGalleryChooser(this) // open the chooser intent for gallery
        }
    }

    override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
        super.onActivityResult(requestCode, resultCode, data)

        // extract bitmap
        val bitmap = GalleryLoader.processGalleryChooserResult(this, requestCode, resultCode, data)

        sampleImageView.setImageBitmap(bitmap)
    }

}

About

A simple bitmap manager to load image from Android device's gallery

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published