aboutsummaryrefslogtreecommitdiff
path: root/mediapicker/src/main/kotlin/ca/allanwang/kau/imagepicker/MediaModel.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-08-01 10:48:37 -0700
committerGitHub <noreply@github.com>2017-08-01 10:48:37 -0700
commit7d894be6de118357ec908d2d171b6152ce67307d (patch)
treef34f0676e78433f7f58d6a5bad800430f8e767a0 /mediapicker/src/main/kotlin/ca/allanwang/kau/imagepicker/MediaModel.kt
parent48213d0b427c478865c75fee912ff1ae8bbaffb5 (diff)
downloadkau-3.2.1.tar.gz
kau-3.2.1.tar.bz2
kau-3.2.1.zip
Imagepicker -> mediapicker (#16)3.2.1
* Readme * Fix kau direction bits * Truly support transparent ripples * Update changelog * Test rect as base * Replace fab transition with generic fade scale transition * Add scalexy func * Add scaleXY * Add arguments to fadeScaleTransition * Clean up ink indicator * Create setOnSingleTapListener * Fix lint and add rndColor * Create kotterknife resettables * Add readme and missing objec * Create lazy resettable registered * Update core docs * Opt for separate class for resettable registry * Clean up resettable registry * Rename functions * Add ripple callback listener * Adjust kprefactivity desc color * Add more transitions * Add delete keys option * Add instrumentation tests * switch id * Revert automatic instrumental tests * Generify imagepickercore and prepare video alternative * Create working video picker * Address possible null issue * Update searchview * Make layouts public * Add changelog test * Update logo link * Add custom color gif * Rename imagepicker to mediapicker * Clean up * Fix remaining merge conflicts * Update readme * Update readme
Diffstat (limited to 'mediapicker/src/main/kotlin/ca/allanwang/kau/imagepicker/MediaModel.kt')
-rw-r--r--mediapicker/src/main/kotlin/ca/allanwang/kau/imagepicker/MediaModel.kt78
1 files changed, 0 insertions, 78 deletions
diff --git a/mediapicker/src/main/kotlin/ca/allanwang/kau/imagepicker/MediaModel.kt b/mediapicker/src/main/kotlin/ca/allanwang/kau/imagepicker/MediaModel.kt
deleted file mode 100644
index c384d48..0000000
--- a/mediapicker/src/main/kotlin/ca/allanwang/kau/imagepicker/MediaModel.kt
+++ /dev/null
@@ -1,78 +0,0 @@
-package ca.allanwang.kau.imagepicker
-
-import android.database.Cursor
-import android.database.SQLException
-import android.net.Uri
-import android.os.Parcel
-import android.os.Parcelable
-import android.provider.MediaStore
-import android.support.annotation.NonNull
-import java.io.File
-
-
-/**
- * Created by Allan Wang on 2017-07-14.
- */
-
-data class MediaModel(
- val data: String, val mimeType: String, val size: Long, val dateModified: Long, val displayName: String?
-) : Parcelable {
-
- @Throws(SQLException::class)
- constructor(@NonNull cursor: Cursor) : this(
- cursor.getString(0),
- cursor.getString(1),
- cursor.getLong(2),
- cursor.getLong(3),
- cursor.getString(4)
- )
-
- constructor(parcel: Parcel) : this(
- parcel.readString(),
- parcel.readString(),
- parcel.readLong(),
- parcel.readLong(),
- parcel.readString())
-
- override fun writeToParcel(parcel: Parcel, flags: Int) {
- parcel.writeString(this.data)
- parcel.writeString(this.mimeType)
- parcel.writeLong(this.size)
- parcel.writeLong(this.dateModified)
- parcel.writeString(this.displayName)
- }
-
- val isGif
- get() = mimeType.endsWith("gif")
-
- val isImage
- get() = mimeType.endsWith("image")
-
- val isVideo
- get() = mimeType.endsWith("video")
-
- val uri: Uri by lazy { Uri.fromFile(File(data)) }
-
- override fun describeContents(): Int {
- return 0
- }
-
- companion object CREATOR : Parcelable.Creator<MediaModel> {
- val projection = arrayOf(
- MediaStore.MediaColumns.DATA,
- MediaStore.MediaColumns.MIME_TYPE,
- MediaStore.MediaColumns.SIZE,
- MediaStore.MediaColumns.DATE_MODIFIED,
- MediaStore.MediaColumns.DISPLAY_NAME
- )
-
- override fun createFromParcel(parcel: Parcel): MediaModel {
- return MediaModel(parcel)
- }
-
- override fun newArray(size: Int): Array<MediaModel?> {
- return arrayOfNulls(size)
- }
- }
-
-} \ No newline at end of file