Bug fix for tutorial always showing

This commit is contained in:
Matthieu 2024-08-31 18:06:29 +02:00
parent 7227562dfa
commit 4e283340bb
2 changed files with 5 additions and 3 deletions

View File

@ -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<PublicFeedStatusDatabaseEntity>()

View File

@ -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<View>(R.id.toggleStoryPost)
while (targetCamera == null) {
targetCamera = findViewById(R.id.toggleStoryPost)