pawegio / KAndroid

Kotlin library for Android
Apache License 2.0
894 stars 81 forks source link

Vals for check external storage readable/writable #26

Closed illuzor closed 7 years ago

illuzor commented 7 years ago

I would like to propose two useful vals:

val isExternalStorageWritable
    get() = Environment.MEDIA_MOUNTED == Environment.getExternalStorageState()

val isExternalStorageReadable
    get() = Environment.MEDIA_MOUNTED_READ_ONLY == Environment.getExternalStorageState() || externalStorageWritable

But I don`t know where to add them. I mean which file. Maybe create a new one?

pawegio commented 7 years ago