Skip to content

Instantly share code, notes, and snippets.

@enginebai

enginebai/Model.kt

Created Oct 6, 2019
Embed
What would you like to do?
Gallery model class
const val ALL_MEDIA_ALBUM_NAME = "ALL_MEDIA_ALBUM_NAME"
const val KEY_MEDIA_LIST = "mediaList"
data class AlbumItem(
val name: String,
val folder: String,
val coverImagePath: String
) {
val mediaList = mutableListOf<Media>()
}
class AlbumSetting : Serializable {
var mimeType = MimeType.ALL
var multipleSelection: Boolean = false
var maxSelection = 10
var imageMaxSize: Long? = null
var videoMaxSecond: Int? = null
var videoMinSecond: Int? = null
}
data class Media(
val path: String,
var name: String?,
var album: String?,
var size: Long?,
var datetime: Long?,
var duration: Long?,
var width: Int?,
var height: Int?
)
enum class MimeType(private val typeName: String) {
ALL("all"),
IMAGE("image"),
VIDEO("video");
override fun toString() = typeName
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.