Skip to content

Instantly share code, notes, and snippets.

@enginebai
Created October 6, 2019 01:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enginebai/dc865a428e4fe107e78bab592a0c0298 to your computer and use it in GitHub Desktop.
Save enginebai/dc865a428e4fe107e78bab592a0c0298 to your computer and use it in GitHub Desktop.
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