chinwag-android/app/src/main/java/com/keylesspalace/tusky/viewdata/AttachmentViewData.kt
Ivan Kupalov 23d84dfa66 Show image descriptions in gallery (#630)
* Add circleci

* Commit to maybe fix ci

* Suppress false positives in lint

* Disable linting for tests in ci

* Add image descriptions to gallery

* Fix test

* [CI] Attempt to fix OOM error

* [CI] Attempt to fix OOM error, 2

* Add option to open status from media

* fix theme issue

* increase linespacing on media description
2018-05-10 20:13:25 +02:00

23 lines
No EOL
666 B
Kotlin

package com.keylesspalace.tusky.viewdata
import android.os.Parcelable
import com.keylesspalace.tusky.entity.Attachment
import com.keylesspalace.tusky.entity.Status
import kotlinx.android.parcel.Parcelize
@Parcelize
data class AttachmentViewData(
val attachment: Attachment,
val statusId: String,
val statusUrl: String
) : Parcelable {
companion object {
@JvmStatic
fun list(status: Status): List<AttachmentViewData> {
val actionable = status.actionableStatus
return actionable.attachments.map {
AttachmentViewData(it, actionable.id, actionable.url)
}
}
}
}