Skip to content
forked from lwj1994/Matisse

🎆 A well-designed local image and video selector for Android

License

Notifications You must be signed in to change notification settings

minibugdev/Matisse

 
 

Repository files navigation

Matisse

Convert Java to Kotlin

Usage

picker

// pickerLauncher
private val pickerLauncher = registerForActivityResult(StartActivityForResult()) { result ->
    if (RESULT_OK == result.resultCode) {
        val data = result.data
        adapter!!.setData(Matisse.obtainResult(data), Matisse.obtainPathResult(data))
    }
}

Matisse.from(this)
       .choose(MimeType.ofImage())
       // ....
       .forResult(pickerLauncher);

capture

you can directly call capture

// captureLauncher
    private val captureLauncher = registerForActivityResult(StartActivityForResult()) { result ->
        if (RESULT_OK == result.resultCode) {
            val data = result.data
            adapter!!.setData(Matisse.obtainResult(data), Matisse.obtainPathResult(data))
        }
    }

Matisse.from(SampleActivity.this)
       .performCapture(new CaptureStrategy(true, "com.zhihu.matisse.sample.kt.fileprovider", "test"), captureLauncher);

About

🎆 A well-designed local image and video selector for Android

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Kotlin 100.0%