mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 15:17:05 +05:30
android: port deeplinks from develop branch
Fixes #306 Co-Authored-By: Aditya Wasan <adityawasan55@gmail.com>
This commit is contained in:
parent
85d92dd132
commit
a58c30ea6b
3 changed files with 68 additions and 3 deletions
|
@ -61,10 +61,21 @@ fun CommentsHeader(
|
|||
Spacer(Modifier.height(4.dp))
|
||||
|
||||
if (postDetails.url.isNotBlank()) {
|
||||
// Post links from lobste.rs are of the form $baseUrl/s/$postId/$postTitle
|
||||
// Interestingly, lobste.rs does not actually care for the value of $postTitle, and will
|
||||
// happily accept both a missing as well as a completely arbitrary $postTitle. We
|
||||
// leverage this to create a new URL format which looks like
|
||||
// $baseUrl/s/$postId/$postTitle/r, and does not trigger our deeplinks,
|
||||
// instead opening in the custom tab as we want it to.
|
||||
PostLink(
|
||||
link = postDetails.url,
|
||||
modifier =
|
||||
Modifier.clickable { postActions.viewPost(postDetails.url, postDetails.commentsUrl) },
|
||||
Modifier.clickable {
|
||||
postActions.viewPost(
|
||||
postDetails.url,
|
||||
postDetails.commentsUrl.replaceAfterLast('/', "r")
|
||||
)
|
||||
},
|
||||
)
|
||||
Spacer(Modifier.height(4.dp))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue