Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Organizer Flow: Add Onboarding Screen to Menu (DEV) #2731

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package de.rki.coronawarnapp.ui.eventregistration.organizer.list
import android.os.Bundle
import android.view.View
import android.view.accessibility.AccessibilityEvent
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.widget.Toolbar
import androidx.core.view.isGone
Expand Down Expand Up @@ -108,7 +107,9 @@ class TraceLocationsFragment : Fragment(R.layout.trace_location_organizer_trace_
setOnMenuItemClickListener {
when (it.itemId) {
R.id.menu_information -> {
Toast.makeText(requireContext(), "Information // TODO", Toast.LENGTH_SHORT).show()
findNavController().navigate(
R.id.action_traceLocationOrganizerListFragment_to_traceLocationOrganizerQRInfoFragment
)
true
}
R.id.menu_remove_all -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,24 @@ class TraceLocationQRInfoFragment : Fragment(R.layout.trace_location_organizer_q
when (it) {
is TraceLocationQRInfoNavigationEvents.NavigateToDataPrivacy ->
findNavController().navigate("coronawarnapp://contactdiary/dataPrivacy".toUri())

is TraceLocationQRInfoNavigationEvents.NavigateToMyQrCodes -> {
settings.qrInfoAcknowledged = true
doNavigate(
TraceLocationQRInfoFragmentDirections
.actionTraceLocationOrganizerQRInfoFragmentToTraceLocationOrganizerListFragment()
)

if (isAlreadyOnboarded()) {
popBackStack()
} else {
settings.qrInfoAcknowledged = true
doNavigate(
TraceLocationQRInfoFragmentDirections
.actionTraceLocationOrganizerQRInfoFragmentToTraceLocationOrganizerListFragment()
)
}
}
}
}
}

private fun isAlreadyOnboarded(): Boolean {
return settings.qrInfoAcknowledged
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
<action
android:id="@+id/action_traceLocationOrganizerListFragment_to_traceLocationCreateFragment"
app:destination="@id/traceLocationCreateFragment" />
<action
android:id="@+id/action_traceLocationOrganizerListFragment_to_traceLocationOrganizerQRInfoFragment"
app:destination="@id/traceLocationOrganizerQRInfoFragment" />
</fragment>

</navigation>