From 4e283340bb658af10110a107630d603644e50593 Mon Sep 17 00:00:00 2001 From: Matthieu <24-artectrex@users.noreply.shinice.net> Date: Sat, 31 Aug 2024 18:06:29 +0200 Subject: [PATCH] Bug fix for tutorial always showing --- app/src/main/java/org/pixeldroid/app/main/MainActivity.kt | 5 +++-- .../org/pixeldroid/app/postCreation/PostCreationActivity.kt | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/pixeldroid/app/main/MainActivity.kt b/app/src/main/java/org/pixeldroid/app/main/MainActivity.kt index 11327db4..9a57d5b3 100644 --- a/app/src/main/java/org/pixeldroid/app/main/MainActivity.kt +++ b/app/src/main/java/org/pixeldroid/app/main/MainActivity.kt @@ -73,7 +73,6 @@ import org.pixeldroid.app.posts.feeds.uncachedFeeds.UncachedPostsFragment import org.pixeldroid.app.profile.ProfileActivity import org.pixeldroid.app.searchDiscover.SearchDiscoverFragment import org.pixeldroid.app.settings.SettingsActivity -import org.pixeldroid.app.settings.SettingsActivity.SettingsFragment import org.pixeldroid.app.settings.TutorialSettingsDialog.Companion.START_TUTORIAL import org.pixeldroid.app.utils.BaseActivity import org.pixeldroid.app.utils.Tab @@ -704,7 +703,9 @@ class MainActivity : BaseActivity() { } } } Tab.SEARCH_DISCOVER_FEED -> { { SearchDiscoverFragment() } } - Tab.CREATE_FEED -> { { CameraFragment() } } + Tab.CREATE_FEED -> { { CameraFragment().apply { + arguments = Bundle().apply { putInt(START_TUTORIAL, intent.getIntExtra(START_TUTORIAL, -1)) } + } } } Tab.NOTIFICATIONS_FEED -> { { NotificationsFragment() } } Tab.PUBLIC_FEED -> { { PostFeedFragment() diff --git a/app/src/main/java/org/pixeldroid/app/postCreation/PostCreationActivity.kt b/app/src/main/java/org/pixeldroid/app/postCreation/PostCreationActivity.kt index afb5fa62..e0f99a82 100644 --- a/app/src/main/java/org/pixeldroid/app/postCreation/PostCreationActivity.kt +++ b/app/src/main/java/org/pixeldroid/app/postCreation/PostCreationActivity.kt @@ -16,6 +16,7 @@ import kotlinx.coroutines.delay import kotlinx.coroutines.launch import org.pixeldroid.app.R import org.pixeldroid.app.databinding.ActivityPostCreationBinding +import org.pixeldroid.app.settings.TutorialSettingsDialog.Companion.START_TUTORIAL import org.pixeldroid.app.utils.BaseActivity class PostCreationActivity : BaseActivity() { @@ -66,7 +67,7 @@ class PostCreationActivity : BaseActivity() { navController = navHostFragment.navController navController.setGraph(R.navigation.post_creation_graph) - lifecycleScope.launch { + if(intent.getBooleanExtra(START_TUTORIAL, false)) lifecycleScope.launch { var targetCamera = findViewById(R.id.toggleStoryPost) while (targetCamera == null) { targetCamera = findViewById(R.id.toggleStoryPost)