feat: 新版贴子 - 看图

This commit is contained in:
HuanCheng65 2023-03-11 00:12:03 +08:00
parent becfa8cbb4
commit ac5998d840
No known key found for this signature in database
GPG Key ID: E9031EF91A805148
1 changed files with 33 additions and 0 deletions

View File

@ -1,11 +1,44 @@
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.models.protos.LoadPicPageData
import com.huanchengfly.tieba.post.models.protos.PhotoViewData
import com.huanchengfly.tieba.post.models.protos.PicItem
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(
threadInfo: ThreadInfo,
index: Int