From 4416b6792dc75f3c7f4bfc70abffdb3d80caeee2 Mon Sep 17 00:00:00 2001 From: Ash Date: Sun, 10 Jul 2022 22:59:09 +0800 Subject: [PATCH] Fix initial filter and page on startup --- .../java/me/ash/reader/ui/page/common/HomeEntry.kt | 13 ++++++++----- app/src/main/res/values-hi-rIN/strings.xml | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/me/ash/reader/ui/page/common/HomeEntry.kt b/app/src/main/java/me/ash/reader/ui/page/common/HomeEntry.kt index 3808ad4..8a6b61f 100644 --- a/app/src/main/java/me/ash/reader/ui/page/common/HomeEntry.kt +++ b/app/src/main/java/me/ash/reader/ui/page/common/HomeEntry.kt @@ -53,11 +53,6 @@ fun HomeEntry( } LaunchedEffect(Unit) { - navController.currentBackStackEntryFlow.collectLatest { - Log.i("RLog", "isReadingPage: ${navController.currentDestination?.route}") - delay(310L) - isReadingPage = navController.currentDestination?.route == "${RouteName.READING}/{articleId}" - } when (context.initialPage) { 1 -> { navController.navigate(RouteName.FLOW) { @@ -77,6 +72,14 @@ fun HomeEntry( } ) ) + + // This is finally + navController.currentBackStackEntryFlow.collectLatest { + Log.i("RLog", "currentBackStackEntry: ${navController.currentDestination?.route}") + // Animation duration takes 310 ms + delay(310L) + isReadingPage = navController.currentDestination?.route == "${RouteName.READING}/{articleId}" + } } LaunchedEffect(openArticleId) { diff --git a/app/src/main/res/values-hi-rIN/strings.xml b/app/src/main/res/values-hi-rIN/strings.xml index 60958e1..e1e861a 100644 --- a/app/src/main/res/values-hi-rIN/strings.xml +++ b/app/src/main/res/values-hi-rIN/strings.xml @@ -95,7 +95,7 @@ लोकल, नया आर एस एस रंग अथवा शैली थीम , रंग शैली , लिपि आकार - Interaction + प्रभाव शुरू होने पे , हैप्टिक फीडबैक भाषाएँ अंग्रेजी , चाइनीज, और..