diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/attendee/checkins/CheckInsFragment.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/attendee/checkins/CheckInsFragment.kt index 6673f24ae9d..1933c16571e 100644 --- a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/attendee/checkins/CheckInsFragment.kt +++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/attendee/checkins/CheckInsFragment.kt @@ -116,7 +116,7 @@ class CheckInsFragment : Fragment(R.layout.trace_location_attendee_checkins_frag is CheckInEvent.ShowInformation -> { setupAxisTransition() findNavController().navigate( - CheckInsFragmentDirections.actionCheckInsFragmentToCheckInOnboardingFragment(false) + CheckInsFragmentDirections.actionCheckInsFragmentToCheckInOnboardingFragment(showBottomNav = false) ) } @@ -194,14 +194,17 @@ class CheckInsFragment : Fragment(R.layout.trace_location_attendee_checkins_frag } companion object { - fun createDeepLink(rootUri: String, cleanHistory: Boolean = false): Uri { + fun createDeepLink(rootUri: String, cleanHistory: Boolean = false, isOrganizerOnboarded: Boolean = false): Uri { val encodedUrl = try { URLEncoder.encode(rootUri, Charsets.UTF_8.name()) } catch (e: Exception) { Timber.d(e, "URL Encoding failed url($rootUri)") rootUri // Pass original } - return "cwa://check-in-onboarding/$encodedUrl/?cleanHistory=$cleanHistory&showBottomNav=false".toUri() + return ( + "cwa://check-in-onboarding/$encodedUrl/?cleanHistory=$cleanHistory&showBottomNav=false" + + "&isOrganizerOnboarded=$isOrganizerOnboarded" + ).toUri() } fun canHandle(rootUri: String): Boolean = rootUri.startsWith("https://e.coronawarn.app") diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/attendee/onboarding/CheckInOnboardingFragment.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/attendee/onboarding/CheckInOnboardingFragment.kt index e0e4aae0039..15d9b124fc3 100644 --- a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/attendee/onboarding/CheckInOnboardingFragment.kt +++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/attendee/onboarding/CheckInOnboardingFragment.kt @@ -64,11 +64,18 @@ class CheckInOnboardingFragment : Fragment(R.layout.fragment_trace_location_onbo .setPopUpTo(R.id.checkInOnboardingFragment, true) .build() findNavController().navigate(ConfirmCheckInFragment.uri(locationId), navOption) + } else { + findNavController().navigate( + CheckInOnboardingFragmentDirections.actionCheckInOnboardingFragmentToCheckInsFragment( + uri = args.uri, + cleanHistory = true + ) + ) } } CheckInOnboardingNavigation.SkipOnboardingInfo -> { - if (args.uri == null) { + if (args.showBottomNav || args.isOrganizerOnboarded) { findNavController().navigate( CheckInOnboardingFragmentDirections.actionCheckInOnboardingFragmentToCheckInsFragment( args.uri, diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/organizer/list/TraceLocationEvent.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/organizer/list/TraceLocationEvent.kt index ebf415e656b..34906d47cfa 100644 --- a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/organizer/list/TraceLocationEvent.kt +++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/organizer/list/TraceLocationEvent.kt @@ -6,7 +6,7 @@ sealed class TraceLocationEvent { data class DuplicateItem(val traceLocation: TraceLocation) : TraceLocationEvent() - data class SelfCheckIn(val traceLocation: TraceLocation) : TraceLocationEvent() + data class SelfCheckIn(val traceLocation: TraceLocation, val isOnboarded: Boolean) : TraceLocationEvent() data class ConfirmDeleteItem(val traceLocation: TraceLocation) : TraceLocationEvent() diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/organizer/list/TraceLocationsFragment.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/organizer/list/TraceLocationsFragment.kt index 0ee3927a903..be2572174a2 100644 --- a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/organizer/list/TraceLocationsFragment.kt +++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/organizer/list/TraceLocationsFragment.kt @@ -119,7 +119,7 @@ class TraceLocationsFragment : Fragment(R.layout.trace_location_organizer_trace_ is TraceLocationEvent.SelfCheckIn -> { findNavController().navigate( - CheckInsFragment.createDeepLink(it.traceLocation.locationUrl, true), + CheckInsFragment.createDeepLink(it.traceLocation.locationUrl, true, it.isOnboarded), NavOptions.Builder() .setPopUpTo(R.id.checkInsFragment, true) .build() diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/organizer/list/TraceLocationsViewModel.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/organizer/list/TraceLocationsViewModel.kt index b9689ca03cd..959cba1871f 100644 --- a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/organizer/list/TraceLocationsViewModel.kt +++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/presencetracing/organizer/list/TraceLocationsViewModel.kt @@ -4,6 +4,7 @@ import androidx.lifecycle.LiveData import androidx.lifecycle.asLiveData import dagger.assisted.AssistedFactory import dagger.assisted.AssistedInject +import de.rki.coronawarnapp.presencetracing.TraceLocationSettings import de.rki.coronawarnapp.presencetracing.checkins.CheckInRepository import de.rki.coronawarnapp.presencetracing.checkins.qrcode.TraceLocation import de.rki.coronawarnapp.presencetracing.storage.repo.TraceLocationRepository @@ -24,6 +25,7 @@ class TraceLocationsViewModel @AssistedInject constructor( dispatcherProvider: DispatcherProvider, checkInsRepository: CheckInRepository, private val traceLocationRepository: TraceLocationRepository, + private val settings: TraceLocationSettings ) : CWAViewModel(dispatcherProvider = dispatcherProvider) { val events = SingleLiveEvent() @@ -42,10 +44,11 @@ class TraceLocationsViewModel @AssistedInject constructor( } .map { traceLocations -> traceLocations.map { item -> + val isOnboarded = settings.isOnboardingDone() TraceLocationVH.Item( traceLocation = item.first, canCheckIn = item.second, - onCheckIn = { events.postValue(TraceLocationEvent.SelfCheckIn(it)) }, + onCheckIn = { events.postValue(TraceLocationEvent.SelfCheckIn(it, isOnboarded)) }, onDuplicate = { events.postValue(TraceLocationEvent.DuplicateItem(it)) }, onShowPrint = { events.postValue(TraceLocationEvent.StartQrCodePosterFragment(it)) }, onDeleteItem = { events.postValue(TraceLocationEvent.ConfirmDeleteItem(it)) }, diff --git a/Corona-Warn-App/src/main/res/navigation/trace_location_attendee_nav_graph.xml b/Corona-Warn-App/src/main/res/navigation/trace_location_attendee_nav_graph.xml index c7c145db64f..aa50b0c6285 100644 --- a/Corona-Warn-App/src/main/res/navigation/trace_location_attendee_nav_graph.xml +++ b/Corona-Warn-App/src/main/res/navigation/trace_location_attendee_nav_graph.xml @@ -9,7 +9,7 @@ android:name="de.rki.coronawarnapp.ui.presencetracing.attendee.onboarding.CheckInOnboardingFragment" android:label="CheckInOnboardingFragment" tools:layout="@layout/fragment_trace_location_onboarding"> - + +