Created
October 6, 2019 01:54
-
-
Save enginebai/dc865a428e4fe107e78bab592a0c0298 to your computer and use it in GitHub Desktop.
Gallery model class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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