mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-22 12:03:09 -04:00
Fixed: When opening the "Online Library" screen from an app shortcut, clicking on the reader screen did not work, causing the GetContentShortcutTest
to fail.
This commit is contained in:
parent
67a05315a7
commit
cf31f53484
@ -30,6 +30,7 @@ fun reader(func: ReaderRobot.() -> Unit) = ReaderRobot().applyWithViewHierarchyP
|
||||
class ReaderRobot : BaseRobot() {
|
||||
fun assertReaderScreenDisplayed(composeTestRule: ComposeContentTestRule) {
|
||||
composeTestRule.apply {
|
||||
waitForIdle()
|
||||
waitUntilTimeout()
|
||||
onNodeWithTag(READER_SCREEN_TESTING_TAG).assertExists()
|
||||
}
|
||||
|
@ -47,6 +47,7 @@ import androidx.lifecycle.lifecycleScope
|
||||
import androidx.lifecycle.repeatOnLifecycle
|
||||
import androidx.navigation.NavController
|
||||
import androidx.navigation.NavOptions
|
||||
import androidx.navigation.NavGraph.Companion.findStartDestination
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import eu.mhutti1.utils.storage.StorageDevice
|
||||
import eu.mhutti1.utils.storage.StorageDeviceUtils
|
||||
@ -268,7 +269,13 @@ class KiwixMainActivity : CoreMainActivity() {
|
||||
|
||||
private fun handleGetContentIntent(intent: Intent?) {
|
||||
if (intent?.action == ACTION_GET_CONTENT) {
|
||||
navigate(KiwixDestination.Downloads.route)
|
||||
navigate(KiwixDestination.Downloads.route) {
|
||||
launchSingleTop = true
|
||||
popUpTo(navController.graph.findStartDestination().id) {
|
||||
saveState = true
|
||||
}
|
||||
restoreState = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,8 @@ import androidx.lifecycle.lifecycleScope
|
||||
import androidx.navigation.NavDirections
|
||||
import androidx.navigation.NavHostController
|
||||
import androidx.navigation.NavOptions
|
||||
import androidx.navigation.NavOptionsBuilder
|
||||
import androidx.navigation.navOptions
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
@ -362,6 +364,10 @@ abstract class CoreMainActivity : BaseActivity(), WebViewProvider {
|
||||
navController.navigate(route, navOptions)
|
||||
}
|
||||
|
||||
fun navigate(route: String, builder: NavOptionsBuilder.() -> Unit) {
|
||||
navigate(route, navOptions(builder))
|
||||
}
|
||||
|
||||
private fun openSettings() {
|
||||
handleDrawerOnNavigation()
|
||||
navigate(settingsFragmentRoute)
|
||||
|
Loading…
x
Reference in New Issue
Block a user