HACK: app: add workaround to prevent deeplinking comment replies back to the app
Signed-off-by: Aditya Wasan <adityawasan55@gmail.com>
This commit is contained in:
@@ -62,7 +62,17 @@
|
||||
<data
|
||||
android:host="lobste.rs"
|
||||
android:scheme="https"
|
||||
android:pathPrefix="/s/" />
|
||||
android:pathPattern="/s/......"/>
|
||||
|
||||
<data
|
||||
android:host="lobste.rs"
|
||||
android:scheme="https"
|
||||
android:pathPattern="/s/....../"/>
|
||||
|
||||
<data
|
||||
android:host="lobste.rs"
|
||||
android:scheme="https"
|
||||
android:pathPattern="/s/....../...*"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
|
||||
@@ -100,7 +100,15 @@ private fun CommentsPageInternal(
|
||||
tween(durationMillis = AnimationDuration, easing = FastOutLinearInEasing),
|
||||
)
|
||||
) {
|
||||
FloatingActionButton(onClick = { urlLauncher.launch(details.commentsUrl) }) {
|
||||
// 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.
|
||||
FloatingActionButton(
|
||||
onClick = { urlLauncher.launch(details.commentsUrl.replaceAfterLast('/', "r")) }
|
||||
) {
|
||||
IconResource(
|
||||
resourceId = R.drawable.ic_reply_24dp,
|
||||
contentDescription = Strings.ReplyButtonContentDescription.get()
|
||||
|
||||
Reference in New Issue
Block a user