feat: 新版贴子 - 看图
This commit is contained in:
parent
becfa8cbb4
commit
ac5998d840
|
|
@ -1,11 +1,44 @@
|
||||||
package com.huanchengfly.tieba.post.ui.utils
|
package com.huanchengfly.tieba.post.ui.utils
|
||||||
|
|
||||||
|
import com.huanchengfly.tieba.post.api.models.protos.Post
|
||||||
import com.huanchengfly.tieba.post.api.models.protos.ThreadInfo
|
import com.huanchengfly.tieba.post.api.models.protos.ThreadInfo
|
||||||
import com.huanchengfly.tieba.post.models.protos.LoadPicPageData
|
import com.huanchengfly.tieba.post.models.protos.LoadPicPageData
|
||||||
import com.huanchengfly.tieba.post.models.protos.PhotoViewData
|
import com.huanchengfly.tieba.post.models.protos.PhotoViewData
|
||||||
import com.huanchengfly.tieba.post.models.protos.PicItem
|
import com.huanchengfly.tieba.post.models.protos.PicItem
|
||||||
import com.huanchengfly.tieba.post.utils.ImageUtil
|
import com.huanchengfly.tieba.post.utils.ImageUtil
|
||||||
|
|
||||||
|
fun getPhotoViewData(
|
||||||
|
post: Post,
|
||||||
|
picId: String,
|
||||||
|
picUrl: String,
|
||||||
|
originUrl: String,
|
||||||
|
showOriginBtn: Boolean,
|
||||||
|
originSize: Int
|
||||||
|
): PhotoViewData? {
|
||||||
|
if (post.from_forum == null) return null
|
||||||
|
return PhotoViewData(
|
||||||
|
data_ = LoadPicPageData(
|
||||||
|
forumId = post.from_forum.id,
|
||||||
|
forumName = post.from_forum.name,
|
||||||
|
threadId = post.tid,
|
||||||
|
postId = post.id,
|
||||||
|
objType = "pb",
|
||||||
|
picId = picId,
|
||||||
|
picIndex = 1
|
||||||
|
),
|
||||||
|
picItems = listOf(
|
||||||
|
PicItem(
|
||||||
|
picId = picId,
|
||||||
|
picIndex = 1,
|
||||||
|
url = picUrl,
|
||||||
|
originUrl = originUrl,
|
||||||
|
showOriginBtn = showOriginBtn,
|
||||||
|
originSize = originSize
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
fun getPhotoViewData(
|
fun getPhotoViewData(
|
||||||
threadInfo: ThreadInfo,
|
threadInfo: ThreadInfo,
|
||||||
index: Int
|
index: Int
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue