Skip to content

Commit

Permalink
[1.59.*] Pre-release merge (#289)
Browse files Browse the repository at this point in the history
  • Loading branch information
tramline-github[bot] authored Feb 5, 2024
2 parents 8972c96 + c8e1de5 commit b5ca80a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ val EnTwineStrings =
postsToday = "Today",
openSource = "Support Open Source",
openSourceDesc =
"Twine is built on open-source technologies and is free to use. You can find the source code for Twine and some of my other popular projects on GitHub. Click here to open GitHub and tip for the project.",
"Twine is an open source project and is available for free to use. Click here to know more on how to support this project or, view source code of Twine or some of my other popular projects.",
markAsRead = "Mark as Read",
markAsUnRead = "Mark as Unread",
removeFeed = "Remove feed",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class OpmlManager(
}
} else {
feedLinks.reversed().forEachIndexed { index, feed ->
launch { rssRepository.addFeed(feedLink = feed.link, title = feed.title) }
rssRepository.addFeed(feedLink = feed.link, title = feed.title)
sendProgress(index, totalFeedCount)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ private fun OpenSource(openLink: () -> Unit) {
Surface(
color = AppTheme.colorScheme.tintedSurface,
shape = MaterialTheme.shapes.extraLarge,
modifier = Modifier.fillMaxWidth().padding(16.dp).clickable { openLink() }
modifier = Modifier.fillMaxWidth().padding(16.dp),
onClick = { openLink() }
) {
Column(horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier.padding(16.dp)) {
Icon(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ class IOSLinkHandler(
BrowserType.Default -> {
val canOpenUrl = UIApplication.sharedApplication().canOpenURL(url)
if (canOpenUrl) {
dispatch_async(dispatch_get_main_queue()) {
UIApplication.sharedApplication().openURL(url)
}
openBrowser(url)
} else {
inAppBrowser(url)
}
Expand All @@ -57,10 +55,18 @@ class IOSLinkHandler(
}
}

private fun openBrowser(url: NSURL) {
dispatch_async(dispatch_get_main_queue()) { UIApplication.sharedApplication().openURL(url) }
}

private fun inAppBrowser(url: NSURL) {
val safari = SFSafariViewController(url)
safari.modalPresentationStyle = UIModalPresentationPageSheet
try {
val safari = SFSafariViewController(url)
safari.modalPresentationStyle = UIModalPresentationPageSheet

uiViewControllerProvider().presentViewController(safari, animated = true, completion = null)
uiViewControllerProvider().presentViewController(safari, animated = true, completion = null)
} catch (e: Exception) {
openBrowser(url)
}
}
}

0 comments on commit b5ca80a

Please sign in to comment.