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

Extend poster testability (EXPOSUREAPP-6308) #2792

Merged
merged 16 commits into from
Apr 12, 2021
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import de.rki.coronawarnapp.test.crash.ui.SettingsCrashReportFragment
import de.rki.coronawarnapp.test.datadonation.ui.DataDonationTestFragment
import de.rki.coronawarnapp.test.debugoptions.ui.DebugOptionsFragment
import de.rki.coronawarnapp.test.deltaonboarding.ui.DeltaonboardingFragment
import de.rki.coronawarnapp.test.eventregistration.ui.EventRegistrationTestFragment
import de.rki.coronawarnapp.test.presencetracing.ui.PresenceTracingTestFragment
import de.rki.coronawarnapp.test.keydownload.ui.KeyDownloadTestFragment
import de.rki.coronawarnapp.test.playground.ui.PlaygroundFragment
import de.rki.coronawarnapp.test.risklevel.ui.TestRiskLevelCalculationFragment
Expand All @@ -36,7 +36,7 @@ class TestMenuFragmentViewModel @AssistedInject constructor() : CWAViewModel() {
PlaygroundFragment.MENU_ITEM,
DataDonationTestFragment.MENU_ITEM,
DeltaonboardingFragment.MENU_ITEM,
EventRegistrationTestFragment.MENU_ITEM,
PresenceTracingTestFragment.MENU_ITEM,
).let { MutableLiveData(it) }
}
val showTestScreenEvent = SingleLiveEvent<TestMenuItem>()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.rki.coronawarnapp.test.eventregistration.ui
package de.rki.coronawarnapp.test.presencetracing.ui

import android.annotation.SuppressLint
import android.os.Bundle
Expand All @@ -11,7 +11,7 @@ import androidx.core.text.scale
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import de.rki.coronawarnapp.R
import de.rki.coronawarnapp.databinding.FragmentTestEventregistrationBinding
import de.rki.coronawarnapp.databinding.FragmentTestPresenceTracingBinding
import de.rki.coronawarnapp.eventregistration.checkins.qrcode.TraceLocation
import de.rki.coronawarnapp.test.menu.ui.TestMenuItem
import de.rki.coronawarnapp.util.ContextExtensions.getColorCompat
Expand All @@ -24,12 +24,12 @@ import de.rki.coronawarnapp.util.viewmodel.cwaViewModels
import javax.inject.Inject

@SuppressLint("SetTextI18n")
class EventRegistrationTestFragment : Fragment(R.layout.fragment_test_eventregistration), AutoInject {
class PresenceTracingTestFragment : Fragment(R.layout.fragment_test_presence_tracing), AutoInject {

@Inject lateinit var viewModelFactory: CWAViewModelFactoryProvider.Factory
private val viewModel: EventRegistrationTestFragmentViewModel by cwaViewModels { viewModelFactory }
private val viewModel: PresenceTracingTestViewModel by cwaViewModels { viewModelFactory }

private val binding: FragmentTestEventregistrationBinding by viewBindingLazy()
private val binding: FragmentTestPresenceTracingBinding by viewBindingLazy()

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
Expand Down Expand Up @@ -71,8 +71,8 @@ class EventRegistrationTestFragment : Fragment(R.layout.fragment_test_eventregis
lastOrganiserLocationUrl.text = styleText("URL", traceLocation.locationUrl)
qrcodeButton.setOnClickListener {
doNavigate(
EventRegistrationTestFragmentDirections
.actionEventRegistrationTestFragmentToQrCodePosterFragmentTest(traceLocation.id)
PresenceTracingTestFragmentDirections
.actionPresenceTracingTestFragmentToQrCodePosterTestFragment(traceLocation.id)
)
}
}
Expand Down Expand Up @@ -112,7 +112,7 @@ class EventRegistrationTestFragment : Fragment(R.layout.fragment_test_eventregis
buildSpannedString {
bold {
color(requireContext().getColorCompat(R.color.colorAccent)) {
append("$key=")
append("$key = ")
}
}

Expand All @@ -121,14 +121,14 @@ class EventRegistrationTestFragment : Fragment(R.layout.fragment_test_eventregis
append(value.toString())
}
}
append("\n")
appendLine()
}

companion object {
val MENU_ITEM = TestMenuItem(
title = "Event Registration",
description = "View & Control the event registration.",
targetId = R.id.eventRegistrationTestFragment
title = "Presence Tracing",
description = "View & Control presence tracing",
targetId = R.id.presenceTracingTestFragment
)
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.rki.coronawarnapp.test.eventregistration.ui
package de.rki.coronawarnapp.test.presencetracing.ui

import dagger.Binds
import dagger.Module
Expand All @@ -8,11 +8,11 @@ import de.rki.coronawarnapp.util.viewmodel.CWAViewModelFactory
import de.rki.coronawarnapp.util.viewmodel.CWAViewModelKey

@Module
abstract class EventRegistrationTestFragmentModule {
abstract class PresenceTracingTestFragmentModule {
@Binds
@IntoMap
@CWAViewModelKey(EventRegistrationTestFragmentViewModel::class)
abstract fun testEventRegistrationFragment(
factory: EventRegistrationTestFragmentViewModel.Factory
@CWAViewModelKey(PresenceTracingTestViewModel::class)
abstract fun testPresenceTracingFragment(
factory: PresenceTracingTestViewModel.Factory
): CWAViewModelFactory<out CWAViewModel>
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.rki.coronawarnapp.test.eventregistration.ui
package de.rki.coronawarnapp.test.presencetracing.ui

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
Expand Down Expand Up @@ -26,7 +26,7 @@ import kotlinx.coroutines.flow.map
import timber.log.Timber
import kotlin.system.measureTimeMillis

class EventRegistrationTestFragmentViewModel @AssistedInject constructor(
class PresenceTracingTestViewModel @AssistedInject constructor(
dispatcherProvider: DispatcherProvider,
traceLocationRepository: TraceLocationRepository,
checkInRepository: CheckInRepository,
Expand Down Expand Up @@ -144,5 +144,5 @@ class EventRegistrationTestFragmentViewModel @AssistedInject constructor(
}

@AssistedFactory
interface Factory : SimpleCWAViewModelFactory<EventRegistrationTestFragmentViewModel>
interface Factory : SimpleCWAViewModelFactory<PresenceTracingTestViewModel>
}
Loading