From 30fc750e17e322d6612d3d3543b5c16df5e0e694 Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Mon, 1 Dec 2025 22:24:56 +0800 Subject: [PATCH] Show tag content on long click to avoid misclicks --- .../com/hippo/ehviewer/ui/screen/GalleryDetailContent.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/GalleryDetailContent.kt b/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/GalleryDetailContent.kt index 37586d287..a736e066e 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/GalleryDetailContent.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/ui/screen/GalleryDetailContent.kt @@ -721,15 +721,17 @@ fun BelowHeader(galleryDetail: GalleryDetail, voteTag: VoteTag) { val upTag = stringResource(R.string.tag_vote_up) val downTag = stringResource(R.string.tag_vote_down) val withDraw = stringResource(R.string.tag_vote_withdraw) + fun search(tag: String) = navigate(ListUrlBuilder(mode = ListUrlBuilder.MODE_TAG, mKeyword = tag).asDst()) GalleryTags( tagGroups = tags, - onTagClick = { - navigate(ListUrlBuilder(mode = ListUrlBuilder.MODE_TAG, mKeyword = it).asDst()) - }, + onTagClick = ::search, onTagLongClick = { tag, translation, vote -> val rawValue = tag.substringAfter(':') launchIO { awaitSelectAction { + onSelect(ctx.getString(R.string.search_bar_hint, tag)) { + withUIContext { search(tag) } + } onSelect(copy) { addTextToClipboard(tag) }