network #28

Merged
AmineB merged 28 commits from davidoskky/ReaderForSelfoss-multiplatform:network into master 2022-08-22 19:01:16 +00:00
Showing only changes of commit 1258ed3ad3 - Show all commits

View File

@ -275,10 +275,10 @@ class ArticleFragment : Fragment(), DIAware {
}
private fun getContentFromMercury(customTabsIntent: CustomTabsIntent) {
if (repository.isNetworkAvailable()) {
AmineB marked this conversation as resolved Outdated

This should only be done if the network is available as it was before.

This should only be done if the network is available as it was before.
binding.progressBar.visibility = View.VISIBLE
val parser = MercuryApi()
AmineB marked this conversation as resolved Outdated

Same here. We are fetching data from an api, and we there is no need to do try anything if there is no network available.

Same here. We are fetching data from an api, and we there is no need to do try anything if there is no network available.

Right!
By the way, what should this Mercury be?
I never saw this work and each time I got the article open in the browser instead.

Right! By the way, what should this Mercury be? I never saw this work and each time I got the article open in the browser instead.

This is mercury. It parses the page and fetch it´s content.

I'll look into why it does not work.

[This is mercury](https://mercury.postlight.com/web-parser/). It parses the page and fetch it´s content. I'll look into why it does not work.
if (repository.isNetworkAvailable()) {
parser.parseUrl(url).enqueue(
object : Callback<ParsedContent> {
override fun onResponse(