Commit d8239a65 authored by Christophe Henry's avatar Christophe Henry
Browse files

Merge branch 'fix-open-browser-problem' into 'develop'

Fix #106: 'Open' button has disapeared

Closes #106

See merge request !119
parents d09d41b8 29d5e9b6
Pipeline #4838 passed with stage
in 0 seconds
# Development # Development
# 1.3.4
## Bug fixes
* Fix [#106](https://git.feneas.org/christophehenry/freshrss-android/-/issues/106) regression introduced in 1.3.3 ([!119](https://git.feneas.org/christophehenry/freshrss-android/-/merge_requests/119))
# 1.3.3
## Features ## Features
* Add possibility to enable a debug mode ([!108](https://git.feneas.org/christophehenry/freshrss-android/-/merge_requests/108)) * Add possibility to enable a debug mode ([!108](https://git.feneas.org/christophehenry/freshrss-android/-/merge_requests/108))
......
...@@ -109,7 +109,7 @@ dependencies { ...@@ -109,7 +109,7 @@ dependencies {
def fragment_version = "1.2.5" def fragment_version = "1.2.5"
def lifecycle_version = "2.2.0" def lifecycle_version = "2.2.0"
def room_version = "2.2.5" def room_version = "2.2.5"
def roomigrant_version = "0.2.6" def roomigrant_version = "0.2.0"
def jackson_version = "2.11.2" def jackson_version = "2.11.2"
def espresso_version = "3.3.0" def espresso_version = "3.3.0"
def espresso_idling_version = "3.3.0" def espresso_idling_version = "3.3.0"
...@@ -160,8 +160,8 @@ dependencies { ...@@ -160,8 +160,8 @@ dependencies {
implementation "androidx.room:room-runtime:$room_version" implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.room:room-rxjava2:$room_version" implementation "androidx.room:room-rxjava2:$room_version"
implementation "io.reactivex.rxjava2:rxandroid:2.1.1" implementation "io.reactivex.rxjava2:rxandroid:2.1.1"
implementation "com.github.RBusarow.Roomigrant:RoomigrantLib:$roomigrant_version" implementation "com.github.MatrixDev.Roomigrant:RoomigrantLib:$roomigrant_version"
kapt "com.github.RBusarow.Roomigrant:RoomigrantCompiler:$roomigrant_version" kapt "com.github.MatrixDev.Roomigrant:RoomigrantCompiler:$roomigrant_version"
// HTTP and promises // HTTP and promises
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_version" implementation "com.fasterxml.jackson.module:jackson-module-kotlin:$jackson_version"
......
...@@ -5,37 +5,31 @@ import androidx.core.view.GravityCompat ...@@ -5,37 +5,31 @@ import androidx.core.view.GravityCompat
import androidx.drawerlayout.widget.DrawerLayout import androidx.drawerlayout.widget.DrawerLayout
import androidx.test.espresso.Espresso.onView import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.NoActivityResumedException import androidx.test.espresso.NoActivityResumedException
import androidx.test.espresso.action.ViewActions import androidx.test.espresso.action.ViewActions.*
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.matches import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.contrib.DrawerActions import androidx.test.espresso.contrib.DrawerActions
import androidx.test.espresso.contrib.DrawerMatchers.isClosed import androidx.test.espresso.contrib.DrawerMatchers.isClosed
import androidx.test.espresso.contrib.DrawerMatchers.isOpen import androidx.test.espresso.contrib.DrawerMatchers.isOpen
import androidx.test.espresso.matcher.ViewMatchers.* import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest import androidx.test.filters.LargeTest
import androidx.test.platform.app.InstrumentationRegistry import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.ActivityTestRule
import androidx.test.runner.lifecycle.ActivityLifecycleMonitorRegistry import androidx.test.runner.lifecycle.ActivityLifecycleMonitorRegistry
import androidx.test.runner.lifecycle.Stage import androidx.test.runner.lifecycle.Stage
import fr.chenry.android.freshrss.R import fr.chenry.android.freshrss.R
import fr.chenry.android.freshrss.utils.FreshRSSBaseTest import fr.chenry.android.freshrss.utils.FreshRSSBaseTest
import junit.framework.TestCase.assertFalse import junit.framework.TestCase.assertFalse
import org.junit.Assert.*
import org.junit.Rule import org.junit.Rule
import org.junit.Test import org.junit.Test
import org.junit.rules.ExpectedException
import org.junit.runner.RunWith import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class) @RunWith(AndroidJUnit4::class)
@LargeTest @LargeTest
class MainActivityTest: FreshRSSBaseTest() { class MainActivityTest: FreshRSSBaseTest() {
@get:Rule
val activityRule = ActivityTestRule(MainActivity::class.java)
@get:Rule @get:Rule
var exceptionRule = ExpectedException.none()!! val activityRule = ActivityScenarioRule(MainActivity::class.java)
@Test @Test
fun `drawer-is-closed-when-adding-a-new-subscription`() { fun `drawer-is-closed-when-adding-a-new-subscription`() {
...@@ -52,13 +46,13 @@ class MainActivityTest: FreshRSSBaseTest() { ...@@ -52,13 +46,13 @@ class MainActivityTest: FreshRSSBaseTest() {
fun `drawer-is-closed-before-application-exits`() { fun `drawer-is-closed-before-application-exits`() {
onView(withId(R.id.activity_main_navigation_drawer)).perform(DrawerActions.open()) onView(withId(R.id.activity_main_navigation_drawer)).perform(DrawerActions.open())
onView(withId(R.id.activity_main_navigation_drawer)).check(matches(isOpen())) onView(withId(R.id.activity_main_navigation_drawer)).check(matches(isOpen()))
onView(isRoot()).perform(ViewActions.pressBack()) onView(isRoot()).perform(pressBack())
onView(withId(R.id.activity_main_navigation_drawer)).check(matches(isClosed())) onView(withId(R.id.activity_main_navigation_drawer)).check(matches(isClosed()))
// We assert that pressing back again exists the app // We assert that pressing back again exists the app
exceptionRule.expect(NoActivityResumedException::class.java) assertThrows(NoActivityResumedException::class.java) {
onView(isRoot()).perform(ViewActions.pressBack()) onView(isRoot()).perform(pressBack())
}
} }
// See https://stackoverflow.com/a/60341723/3459089 // See https://stackoverflow.com/a/60341723/3459089
......
...@@ -3,31 +3,30 @@ package fr.chenry.android.freshrss.components.articles ...@@ -3,31 +3,30 @@ package fr.chenry.android.freshrss.components.articles
import android.app.Activity.RESULT_OK import android.app.Activity.RESULT_OK
import android.app.Instrumentation import android.app.Instrumentation
import android.content.Intent import android.content.Intent
import androidx.fragment.app.testing.FragmentScenario
import androidx.fragment.app.testing.launchFragmentInContainer import androidx.fragment.app.testing.launchFragmentInContainer
import androidx.test.espresso.Espresso.onView import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.* import androidx.test.espresso.action.ViewActions.*
import androidx.test.espresso.assertion.ViewAssertions.*
import androidx.test.espresso.intent.Intents
import androidx.test.espresso.intent.Intents.intended import androidx.test.espresso.intent.Intents.intended
import androidx.test.espresso.intent.Intents.intending import androidx.test.espresso.intent.Intents.intending
import androidx.test.espresso.intent.matcher.IntentMatchers.* import androidx.test.espresso.intent.matcher.IntentMatchers.*
import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.espresso.matcher.ViewMatchers.* import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.espresso.web.assertion.WebViewAssertions.webMatches import androidx.test.espresso.web.assertion.WebViewAssertions.webMatches
import androidx.test.espresso.web.sugar.Web.onWebView import androidx.test.espresso.web.sugar.Web.onWebView
import androidx.test.espresso.web.webdriver.DriverAtoms.findElement import androidx.test.espresso.web.webdriver.DriverAtoms.findElement
import androidx.test.espresso.web.webdriver.DriverAtoms.getText import androidx.test.espresso.web.webdriver.DriverAtoms.getText
import androidx.test.espresso.web.webdriver.Locator import androidx.test.espresso.web.webdriver.Locator
import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest import androidx.test.filters.LargeTest
import androidx.test.internal.runner.junit4.statement.UiThreadStatement.runOnUiThread
import fr.chenry.android.freshrss.MainNavDirections
import fr.chenry.android.freshrss.R import fr.chenry.android.freshrss.R
import fr.chenry.android.freshrss.activities.MainActivity import fr.chenry.android.freshrss.activities.MainActivity
import fr.chenry.android.freshrss.components.articles.webviewutils.FRSSWebView import fr.chenry.android.freshrss.components.articles.webviewutils.FRSSWebView
import fr.chenry.android.freshrss.components.articles.webviewutils.ShareIntent import fr.chenry.android.freshrss.components.articles.webviewutils.ShareIntent
import fr.chenry.android.freshrss.utils.* import fr.chenry.android.freshrss.utils.DisableAnimationsRule
import fr.chenry.android.freshrss.utils.FreshRSSBaseTest
import fr.chenry.android.freshrss.utils.factories.ArticleFactory import fr.chenry.android.freshrss.utils.factories.ArticleFactory
import fr.chenry.android.freshrss.utils.factories.SubscriptionFactory
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import org.hamcrest.Matcher import org.hamcrest.Matcher
import org.hamcrest.Matchers.* import org.hamcrest.Matchers.*
...@@ -36,16 +35,30 @@ import org.junit.runner.RunWith ...@@ -36,16 +35,30 @@ import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class) @RunWith(AndroidJUnit4::class)
@LargeTest @LargeTest
@Ignore("Something makes the instrumented tests to randomly crash for no obvious reason")
class ArticleDetailFragmentTest: FreshRSSBaseTest() { class ArticleDetailFragmentTest: FreshRSSBaseTest() {
private val bundle = ArticleDetailFragmentArgs(application.article.id).toBundle() private val brokenArticle = ArticleFactory.createArticle(streamId = application.feed.id).let {
it.copy(href = it.href.replace("https?://".toRegex(), ""))
}
@get:Rule private val bundle = ArticleDetailFragmentArgs(application.article.id).toBundle()
val activityRule = IntentsTestRule(MainActivity::class.java)
@get:Rule @get:Rule(order = 0)
val disableAnimationsRule = DisableAnimationsRule() val disableAnimationsRule = DisableAnimationsRule()
@get:Rule(order = 1)
val activityRule = ActivityScenarioRule(MainActivity::class.java)
@Before
fun setUp() {
Intents.init()
runBlocking {
application.db.insertArticles(listOf(brokenArticle))
}
}
@After
fun tearDown() = Intents.release()
@Test @Test
fun `should-display-article`() { fun `should-display-article`() {
launchFragmentInContainer<ArticleDetailFragment>( launchFragmentInContainer<ArticleDetailFragment>(
...@@ -70,7 +83,8 @@ class ArticleDetailFragmentTest: FreshRSSBaseTest() { ...@@ -70,7 +83,8 @@ class ArticleDetailFragmentTest: FreshRSSBaseTest() {
fragmentArgs = bundle fragmentArgs = bundle
) )
val expectedExtraText = ShareIntent.format(ShareIntent.getTemplateAttributes(application.feed.title, application.article)) val expectedExtraText =
ShareIntent.format(ShareIntent.getTemplateAttributes(application.feed.title, application.article))
intending(any(Intent::class.java)).respondWithFunction { intending(any(Intent::class.java)).respondWithFunction {
Instrumentation.ActivityResult(RESULT_OK, Intent()) Instrumentation.ActivityResult(RESULT_OK, Intent())
...@@ -100,4 +114,14 @@ class ArticleDetailFragmentTest: FreshRSSBaseTest() { ...@@ -100,4 +114,14 @@ class ArticleDetailFragmentTest: FreshRSSBaseTest() {
onView(withId(R.id.fab_open_browser)).perform(click()) onView(withId(R.id.fab_open_browser)).perform(click())
intended(allOf(hasAction(Intent.ACTION_VIEW), hasData(application.article.url))) intended(allOf(hasAction(Intent.ACTION_VIEW), hasData(application.article.url)))
} }
@Test
fun `should-not-display-browser-button-when-no-app-can-open`() {
launchFragmentInContainer<ArticleDetailFragment>(
themeResId = R.style.AppTheme,
fragmentArgs = ArticleDetailFragmentArgs(brokenArticle.id).toBundle()
)
onView(withId(R.id.fab_open_browser)).check(matches(not(isDisplayed())))
}
} }
package fr.chenry.android.freshrss.components.navigationdrawer package fr.chenry.android.freshrss.components.navigationdrawer
import androidx.annotation.StringRes
import androidx.fragment.app.testing.launchFragmentInContainer import androidx.fragment.app.testing.launchFragmentInContainer
import androidx.test.espresso.Espresso.onView import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.* import androidx.test.espresso.action.ViewActions.*
...@@ -8,31 +7,30 @@ import androidx.test.espresso.assertion.ViewAssertions.matches ...@@ -8,31 +7,30 @@ import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.contrib.DrawerActions import androidx.test.espresso.contrib.DrawerActions
import androidx.test.espresso.contrib.DrawerMatchers import androidx.test.espresso.contrib.DrawerMatchers
import androidx.test.espresso.matcher.ViewMatchers.* import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.ext.junit.rules.ActivityScenarioRule
import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest import androidx.test.filters.LargeTest
import androidx.test.rule.ActivityTestRule
import fr.chenry.android.freshrss.R import fr.chenry.android.freshrss.R
import fr.chenry.android.freshrss.activities.MainActivity import fr.chenry.android.freshrss.activities.MainActivity
import fr.chenry.android.freshrss.utils.* import fr.chenry.android.freshrss.utils.*
import org.hamcrest.Matchers.equalTo import org.hamcrest.Matchers.*
import org.hamcrest.Matchers.matchesPattern
import org.junit.* import org.junit.*
import org.junit.runner.RunWith import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class) @RunWith(AndroidJUnit4::class)
@LargeTest @LargeTest
class SettingsFragmentTest: FreshRSSBaseTest() { class SettingsFragmentTest: FreshRSSBaseTest() {
@get:Rule @get:Rule
val activityRule = ActivityTestRule(MainActivity::class.java) val activityRule = ActivityScenarioRule(MainActivity::class.java)
@get:Rule @get:Rule
val disableAnimationsRule = DisableAnimationsRule() val disableAnimationsRule = DisableAnimationsRule()
@Before @Before
fun setUp() { fun setUp() {
activityRule.activity.requireF().preferences.reset() activityRule.scenario.onActivity {
it.requireF().preferences.reset()
}
} }
@Test @Test
...@@ -43,11 +41,13 @@ class SettingsFragmentTest: FreshRSSBaseTest() { ...@@ -43,11 +41,13 @@ class SettingsFragmentTest: FreshRSSBaseTest() {
onView(isRoot()).check {_, noViewFoundException -> onView(isRoot()).check {_, noViewFoundException ->
if(noViewFoundException != null) throw noViewFoundException if(noViewFoundException != null) throw noViewFoundException
val activity = activityRule.activity as MainActivity activityRule.scenario.onActivity {
assertThat( assertThat(
activity.navigation.currentDestination!!, it.navigation.currentDestination!!,
equalTo(activity.navigation.graph.findNode(R.id.settingsFragment)) equalTo(it.navigation.graph.findNode(R.id.settingsFragment))
) )
}
} }
} }
......
...@@ -15,11 +15,9 @@ class DisableAnimationsRule: TestRule { ...@@ -15,11 +15,9 @@ class DisableAnimationsRule: TestRule {
override fun apply(base: Statement, description: Description?) = object: Statement() { override fun apply(base: Statement, description: Description?) = object: Statement() {
override fun evaluate() { override fun evaluate() {
disableAnimations() disableAnimations()
try{ val result = runCatching(base::evaluate)
base.evaluate() enableAnimations()
} finally { if(result.isFailure) throw result.exceptionOrNull()!!
enableAnimations()
}
} }
} }
......
...@@ -10,13 +10,9 @@ import fr.chenry.android.freshrss.utils.factories.ArticleFactory ...@@ -10,13 +10,9 @@ import fr.chenry.android.freshrss.utils.factories.ArticleFactory
import fr.chenry.android.freshrss.utils.factories.SubscriptionFactory import fr.chenry.android.freshrss.utils.factories.SubscriptionFactory
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
@Suppress("unused")
class FreshRSSTestRunner: AndroidJUnitRunner() { class FreshRSSTestRunner: AndroidJUnitRunner() {
override fun newApplication(cl: ClassLoader, className: String, context: Context): Application =
super.newApplication(cl, FreshRSSTestApplication::class.java.name, context)
override fun newApplication(cl: ClassLoader, className: String, context: Context): Application {
return super.newApplication(cl, FreshRSSTestApplication::class.java.name, context)
}
class FreshRSSTestApplication: FreshRSSApplication() { class FreshRSSTestApplication: FreshRSSApplication() {
val feed = SubscriptionFactory.createSubscriptions(1)[0] val feed = SubscriptionFactory.createSubscriptions(1)[0]
...@@ -33,6 +29,9 @@ class FreshRSSTestRunner: AndroidJUnitRunner() { ...@@ -33,6 +29,9 @@ class FreshRSSTestRunner: AndroidJUnitRunner() {
} }
} }
// Disable ACRA
override fun initAcra() = NOOP()
companion object { companion object {
const val TEST_DB_NAME = "freshrss-test.db" const val TEST_DB_NAME = "freshrss-test.db"
} }
......
...@@ -10,7 +10,9 @@ object ArticleFactory { ...@@ -10,7 +10,9 @@ object ArticleFactory {
fun createArticle( fun createArticle(
id: String = TestUtils.idNumber().valid(), id: String = TestUtils.idNumber().valid(),
title: String = TestUtils.starTrek().character(), title: String = TestUtils.starTrek().character(),
href: String = TestUtils.internet().url(), href: String = TestUtils.internet().url().let {
if(!"https?://.*".toRegex().matches(it)) "https://$it" else it
},
author: String = TestUtils.book().author(), author: String = TestUtils.book().author(),
content: String = TestUtils.lorem().paragraph(5), content: String = TestUtils.lorem().paragraph(5),
streamId: String = TestUtils.idNumber().valid(), streamId: String = TestUtils.idNumber().valid(),
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest <manifest
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="fr.chenry.android.freshrss"> package="fr.chenry.android.freshrss">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<dist:module dist:instant="true" />
<application <application
android:name=".FreshRSSApplication" android:name=".FreshRSSApplication"
...@@ -36,24 +34,19 @@ ...@@ -36,24 +34,19 @@
android:theme="@style/AppTheme.NoActionBar"> android:theme="@style/AppTheme.NoActionBar">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity <activity
android:name=".activities.LoginActivity" android:name=".activities.LoginActivity"
android:label="@string/app_name" android:label="@string/app_name"
android:persistableMode="persistAcrossReboots" /> android:persistableMode="persistAcrossReboots"
<activity />
android:name=".activities.MainActivity" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" /> <activity
</intent-filter> android:name=".activities.MainActivity"
</activity> android:label="@string/app_name"
/>
</application> </application>
</manifest> </manifest>
\ No newline at end of file
...@@ -5,6 +5,7 @@ import android.app.NotificationChannel ...@@ -5,6 +5,7 @@ import android.app.NotificationChannel
import android.content.Context import android.content.Context
import android.content.SharedPreferences import android.content.SharedPreferences
import android.os.Build import android.os.Build
import androidx.annotation.VisibleForTesting
import androidx.core.app.NotificationManagerCompat import androidx.core.app.NotificationManagerCompat
import androidx.room.Room import androidx.room.Room
import androidx.work.* import androidx.work.*
...@@ -38,7 +39,6 @@ import kotlin.math.max ...@@ -38,7 +39,6 @@ import kotlin.math.max
resChannelImportance = NotificationManagerCompat.IMPORTANCE_MAX resChannelImportance = NotificationManagerCompat.IMPORTANCE_MAX
) )
open class FreshRSSApplication: Application(), SharedPreferences.OnSharedPreferenceChangeListener { open class FreshRSSApplication: Application(), SharedPreferences.OnSharedPreferenceChangeListener {
open val preferences: FreshRSSPreferences by lazy {FreshRSSPreferences(this)} open val preferences: FreshRSSPreferences by lazy {FreshRSSPreferences(this)}
open val workManager by lazy {WorkManager.getInstance(this)} open val workManager by lazy {WorkManager.getInstance(this)}
open val notificationManager: NotificationManagerCompat by lazy {NotificationManagerCompat.from(this)} open val notificationManager: NotificationManagerCompat by lazy {NotificationManagerCompat.from(this)}
...@@ -50,7 +50,7 @@ open class FreshRSSApplication: Application(), SharedPreferences.OnSharedPrefere ...@@ -50,7 +50,7 @@ open class FreshRSSApplication: Application(), SharedPreferences.OnSharedPrefere
override fun attachBaseContext(base: Context?) { override fun attachBaseContext(base: Context?) {
super.attachBaseContext(base) super.attachBaseContext(base)
ACRA.init(this) initAcra()
} }
override fun onCreate() { override fun onCreate() {
...@@ -112,6 +112,11 @@ open class FreshRSSApplication: Application(), SharedPreferences.OnSharedPrefere ...@@ -112,6 +112,11 @@ open class FreshRSSApplication: Application(), SharedPreferences.OnSharedPrefere
) enqueuePeriodicWork(max(0, initialDelay)) ) enqueuePeriodicWork(max(0, initialDelay))
} }
// Allows to disengage ACRA in tests
@VisibleForTesting
open fun initAcra() = ACRA.init(this)
@VisibleForTesting
fun isPeriodicRefreshEnabled() = preferences.refreshFrequency > 0 fun isPeriodicRefreshEnabled() = preferences.refreshFrequency > 0
private suspend fun enqueuePeriodicWork(initialDelay: Long = 0, initialDelayTimeUnit: TimeUnit = TimeUnit.MINUTES) = private suspend fun enqueuePeriodicWork(initialDelay: Long = 0, initialDelayTimeUnit: TimeUnit = TimeUnit.MINUTES) =
......
package fr.chenry.android.freshrss.components.articles package fr.chenry.android.freshrss.components.articles
import android.content.Intent import android.content.Intent
import android.net.Uri
import android.os.Bundle import android.os.Bundle
import android.view.* import android.view.*
import android.widget.Toast import android.widget.Toast
...@@ -44,26 +45,27 @@ class ArticleDetailFragment: Fragment(), View.OnClickListener { ...@@ -44,26 +45,27 @@ class ArticleDetailFragment: Fragment(), View.OnClickListener {