From 1d1abd3ad69dfa08e8d4fda236f0a15dec3ca3df Mon Sep 17 00:00:00 2001 From: Alexander Alferov Date: Thu, 11 Mar 2021 17:35:08 +0300 Subject: [PATCH 1/3] Initial commit --- .../test/menu/ui/TestMenuFragmentViewModel.kt | 4 +- ...ocationOrganiserQrCodesListTestFragment.kt | 71 ++++++++++++++++ ...nOrganiserQrCodesListTestFragmentModule.kt | 18 ++++ ...ganiserQrCodesListTestFragmentViewModel.kt | 16 ++++ .../ui/main/MainActivityTestModule.kt | 5 ++ .../res/navigation/test_nav_graph.xml | 8 ++ .../ic_illustration_no_qr_codes.xml | 52 ++++++++++++ .../drawable/ic_illustration_no_qr_codes.xml | 52 ++++++++++++ .../drawable/ic_qr_code_list_item_icon.xml | 39 +++++++++ ...ser_qr_codes_list_item_date_background.xml | 10 +++ ...odes_list_item_qr_code_icon_background.xml | 14 ++++ ...ation_organiser_qr_codes_list_fragment.xml | 83 +++++++++++++++++++ ..._location_organiser_qr_codes_list_item.xml | 83 +++++++++++++++++++ .../src/main/res/values/strings.xml | 14 ++++ 14 files changed, 468 insertions(+), 1 deletion(-) create mode 100644 Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragment.kt create mode 100644 Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragmentModule.kt create mode 100644 Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragmentViewModel.kt create mode 100644 Corona-Warn-App/src/main/res/drawable-night/ic_illustration_no_qr_codes.xml create mode 100644 Corona-Warn-App/src/main/res/drawable/ic_illustration_no_qr_codes.xml create mode 100644 Corona-Warn-App/src/main/res/drawable/ic_qr_code_list_item_icon.xml create mode 100644 Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_date_background.xml create mode 100644 Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_qr_code_icon_background.xml create mode 100644 Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_fragment.xml create mode 100644 Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_item.xml diff --git a/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/menu/ui/TestMenuFragmentViewModel.kt b/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/menu/ui/TestMenuFragmentViewModel.kt index 6d09d4e6bc5..0fd2af8f58c 100644 --- a/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/menu/ui/TestMenuFragmentViewModel.kt +++ b/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/menu/ui/TestMenuFragmentViewModel.kt @@ -11,6 +11,7 @@ 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.keydownload.ui.KeyDownloadTestFragment +import de.rki.coronawarnapp.test.organiser.ui.TraceLocationOrganiserQrCodesListTestFragment import de.rki.coronawarnapp.test.playground.ui.PlaygroundFragment import de.rki.coronawarnapp.test.risklevel.ui.TestRiskLevelCalculationFragment import de.rki.coronawarnapp.test.submission.ui.SubmissionTestFragment @@ -34,7 +35,8 @@ class TestMenuFragmentViewModel @AssistedInject constructor() : CWAViewModel() { ContactDiaryTestFragment.MENU_ITEM, PlaygroundFragment.MENU_ITEM, DataDonationTestFragment.MENU_ITEM, - DeltaonboardingFragment.MENU_ITEM + DeltaonboardingFragment.MENU_ITEM, + TraceLocationOrganiserQrCodesListTestFragment.MENU_ITEM ).let { MutableLiveData(it) } } val showTestScreenEvent = SingleLiveEvent() diff --git a/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragment.kt b/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragment.kt new file mode 100644 index 00000000000..263d9fb889d --- /dev/null +++ b/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragment.kt @@ -0,0 +1,71 @@ +package de.rki.coronawarnapp.test.organiser.ui + +import android.os.Bundle +import android.view.View +import android.view.accessibility.AccessibilityEvent +import androidx.fragment.app.Fragment +import de.rki.coronawarnapp.R +import de.rki.coronawarnapp.databinding.TraceLocationOrganiserQrCodesListFragmentBinding +import de.rki.coronawarnapp.test.menu.ui.TestMenuItem +import de.rki.coronawarnapp.util.di.AutoInject +import de.rki.coronawarnapp.util.ui.viewBindingLazy +import de.rki.coronawarnapp.util.viewmodel.CWAViewModelFactoryProvider +import javax.inject.Inject + +class TraceLocationOrganiserQrCodesListTestFragment : Fragment(R.layout.trace_location_organiser_qr_codes_list_fragment), AutoInject { + + @Inject lateinit var viewModelFactory: CWAViewModelFactoryProvider.Factory +// private val vm: ContactDiaryOverviewViewModel by cwaViewModels { viewModelFactory } + private val binding: TraceLocationOrganiserQrCodesListFragmentBinding by viewBindingLazy() + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + } + + override fun onResume() { + super.onResume() + binding.contentContainer.sendAccessibilityEvent(AccessibilityEvent.TYPE_ANNOUNCEMENT) + } + +// private fun setupMenu(toolbar: Toolbar) = toolbar.apply { +// inflateMenu(R.menu.menu_contact_diary_overview) +// setOnMenuItemClickListener { +// when (it.itemId) { +// R.id.menu_contact_diary_information -> { +// doNavigate( +// ContactDiaryOverviewFragmentDirections +// .actionContactDiaryOverviewFragmentToContactDiaryOnboardingFragment(showBottomNav = false) +// ) +// true +// } +// R.id.menu_contact_diary_export_entries -> { +// vm.onExportPress() +// true +// } +// R.id.menu_contact_diary_edit_persons -> { +// doNavigate( +// ContactDiaryOverviewFragmentDirections +// .actionContactDiaryOverviewFragmentToContactDiaryEditPersonsFragment() +// ) +// true +// } +// R.id.menu_contact_diary_edit_locations -> { +// doNavigate( +// ContactDiaryOverviewFragmentDirections +// .actionContactDiaryOverviewFragmentToContactDiaryEditLocationsFragment() +// ) +// true +// } +// else -> onOptionsItemSelected(it) +// } +// } +// } + + companion object { + val MENU_ITEM = TestMenuItem( + title = "Organiser QR Codes List", + description = "Check organiser qr codes list", + targetId = R.id.test_orginser_qr_codes_list_fragment + ) + } +} diff --git a/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragmentModule.kt b/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragmentModule.kt new file mode 100644 index 00000000000..bde05ae7272 --- /dev/null +++ b/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragmentModule.kt @@ -0,0 +1,18 @@ +package de.rki.coronawarnapp.test.organiser.ui + +import dagger.Binds +import dagger.Module +import dagger.multibindings.IntoMap +import de.rki.coronawarnapp.util.viewmodel.CWAViewModel +import de.rki.coronawarnapp.util.viewmodel.CWAViewModelFactory +import de.rki.coronawarnapp.util.viewmodel.CWAViewModelKey + +@Module +abstract class TraceLocationOrganiserQrCodesListTestFragmentModule { + @Binds + @IntoMap + @CWAViewModelKey(TraceLocationOrganiserQrCodesListTestFragmentViewModel::class) + abstract fun organiserQrCodesListViewModel( + factory: TraceLocationOrganiserQrCodesListTestFragmentViewModel.Factory + ): CWAViewModelFactory +} diff --git a/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragmentViewModel.kt b/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragmentViewModel.kt new file mode 100644 index 00000000000..caccc18214c --- /dev/null +++ b/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragmentViewModel.kt @@ -0,0 +1,16 @@ +package de.rki.coronawarnapp.test.organiser.ui + +import dagger.assisted.AssistedFactory +import dagger.assisted.AssistedInject +import de.rki.coronawarnapp.util.coroutine.DispatcherProvider +import de.rki.coronawarnapp.util.viewmodel.CWAViewModel +import de.rki.coronawarnapp.util.viewmodel.SimpleCWAViewModelFactory + +class TraceLocationOrganiserQrCodesListTestFragmentViewModel @AssistedInject constructor( + dispatcherProvider: DispatcherProvider +) : CWAViewModel(dispatcherProvider = dispatcherProvider) { + + + @AssistedFactory + interface Factory : SimpleCWAViewModelFactory +} diff --git a/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/ui/main/MainActivityTestModule.kt b/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/ui/main/MainActivityTestModule.kt index da9c43ddb5f..fbbb32d50b2 100644 --- a/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/ui/main/MainActivityTestModule.kt +++ b/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/ui/main/MainActivityTestModule.kt @@ -18,6 +18,8 @@ import de.rki.coronawarnapp.test.keydownload.ui.KeyDownloadTestFragment import de.rki.coronawarnapp.test.keydownload.ui.KeyDownloadTestFragmentModule import de.rki.coronawarnapp.test.menu.ui.TestMenuFragment import de.rki.coronawarnapp.test.menu.ui.TestMenuFragmentModule +import de.rki.coronawarnapp.test.organiser.ui.TraceLocationOrganiserQrCodesListTestFragment +import de.rki.coronawarnapp.test.organiser.ui.TraceLocationOrganiserQrCodesListTestFragmentModule import de.rki.coronawarnapp.test.playground.ui.PlaygroundFragment import de.rki.coronawarnapp.test.playground.ui.PlaygroundModule import de.rki.coronawarnapp.test.risklevel.ui.TestRiskLevelCalculationFragment @@ -65,4 +67,7 @@ abstract class MainActivityTestModule { @ContributesAndroidInjector(modules = [DeltaOnboardingFragmentModule::class]) abstract fun deltaOnboarding(): DeltaonboardingFragment + + @ContributesAndroidInjector(modules = [TraceLocationOrganiserQrCodesListTestFragmentModule::class]) + abstract fun organiserQrCodesList(): TraceLocationOrganiserQrCodesListTestFragment } diff --git a/Corona-Warn-App/src/deviceForTesters/res/navigation/test_nav_graph.xml b/Corona-Warn-App/src/deviceForTesters/res/navigation/test_nav_graph.xml index d4b7265dbf3..5de3b498289 100644 --- a/Corona-Warn-App/src/deviceForTesters/res/navigation/test_nav_graph.xml +++ b/Corona-Warn-App/src/deviceForTesters/res/navigation/test_nav_graph.xml @@ -46,6 +46,9 @@ + + diff --git a/Corona-Warn-App/src/main/res/drawable-night/ic_illustration_no_qr_codes.xml b/Corona-Warn-App/src/main/res/drawable-night/ic_illustration_no_qr_codes.xml new file mode 100644 index 00000000000..c6a0b2bc7da --- /dev/null +++ b/Corona-Warn-App/src/main/res/drawable-night/ic_illustration_no_qr_codes.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Corona-Warn-App/src/main/res/drawable/ic_illustration_no_qr_codes.xml b/Corona-Warn-App/src/main/res/drawable/ic_illustration_no_qr_codes.xml new file mode 100644 index 00000000000..c7071cc7be8 --- /dev/null +++ b/Corona-Warn-App/src/main/res/drawable/ic_illustration_no_qr_codes.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Corona-Warn-App/src/main/res/drawable/ic_qr_code_list_item_icon.xml b/Corona-Warn-App/src/main/res/drawable/ic_qr_code_list_item_icon.xml new file mode 100644 index 00000000000..7b2adb69232 --- /dev/null +++ b/Corona-Warn-App/src/main/res/drawable/ic_qr_code_list_item_icon.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + diff --git a/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_date_background.xml b/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_date_background.xml new file mode 100644 index 00000000000..491252a4d09 --- /dev/null +++ b/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_date_background.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_qr_code_icon_background.xml b/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_qr_code_icon_background.xml new file mode 100644 index 00000000000..33a588d81b3 --- /dev/null +++ b/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_qr_code_icon_background.xml @@ -0,0 +1,14 @@ + + + + + diff --git a/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_fragment.xml b/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_fragment.xml new file mode 100644 index 00000000000..1c0e9d12676 --- /dev/null +++ b/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_fragment.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_item.xml b/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_item.xml new file mode 100644 index 00000000000..bc97abe8d28 --- /dev/null +++ b/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_item.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Corona-Warn-App/src/main/res/values/strings.xml b/Corona-Warn-App/src/main/res/values/strings.xml index ee5cad7b727..b5550b76fa0 100644 --- a/Corona-Warn-App/src/main/res/values/strings.xml +++ b/Corona-Warn-App/src/main/res/values/strings.xml @@ -1968,4 +1968,18 @@ "OK" "00:00" + + + + + "Meine QR-Codes" + + "QR-Code" + + "Noch keine QR Codes erstellt" + + "Hier werden alle QR-Codes angezeigt, die Sie für ein Ort oder Event erstellt haben. Sie können die QR-Codes löschen, wenn diese nicht mehr verwendet werden sollen." + From 13c6c160e95f718905b3c7f637076e68662dd1e4 Mon Sep 17 00:00:00 2001 From: Alexander Alferov Date: Fri, 12 Mar 2021 15:17:09 +0300 Subject: [PATCH 2/3] Initial commit --- .../test/menu/ui/TestMenuFragmentViewModel.kt | 4 +- ...ocationOrganiserQrCodesListTestFragment.kt | 71 ---------------- ...nOrganiserQrCodesListTestFragmentModule.kt | 18 ---- ...ganiserQrCodesListTestFragmentViewModel.kt | 16 ---- .../ui/main/MainActivityTestModule.kt | 5 -- .../res/navigation/test_nav_graph.xml | 8 -- .../ic_illustration_no_qr_codes.xml | 52 ------------ .../drawable/ic_illustration_no_qr_codes.xml | 52 ------------ ...ser_qr_codes_list_item_date_background.xml | 2 +- ...odes_list_item_qr_code_icon_background.xml | 2 +- ...ation_organiser_qr_codes_list_fragment.xml | 83 ------------------- ..._location_organiser_qr_codes_list_item.xml | 4 +- .../src/main/res/values-night/colors.xml | 3 + .../src/main/res/values/colors.xml | 3 + .../src/main/res/values/strings.xml | 14 ---- 15 files changed, 11 insertions(+), 326 deletions(-) delete mode 100644 Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragment.kt delete mode 100644 Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragmentModule.kt delete mode 100644 Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragmentViewModel.kt delete mode 100644 Corona-Warn-App/src/main/res/drawable-night/ic_illustration_no_qr_codes.xml delete mode 100644 Corona-Warn-App/src/main/res/drawable/ic_illustration_no_qr_codes.xml delete mode 100644 Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_fragment.xml diff --git a/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/menu/ui/TestMenuFragmentViewModel.kt b/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/menu/ui/TestMenuFragmentViewModel.kt index 0fd2af8f58c..6d09d4e6bc5 100644 --- a/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/menu/ui/TestMenuFragmentViewModel.kt +++ b/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/menu/ui/TestMenuFragmentViewModel.kt @@ -11,7 +11,6 @@ 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.keydownload.ui.KeyDownloadTestFragment -import de.rki.coronawarnapp.test.organiser.ui.TraceLocationOrganiserQrCodesListTestFragment import de.rki.coronawarnapp.test.playground.ui.PlaygroundFragment import de.rki.coronawarnapp.test.risklevel.ui.TestRiskLevelCalculationFragment import de.rki.coronawarnapp.test.submission.ui.SubmissionTestFragment @@ -35,8 +34,7 @@ class TestMenuFragmentViewModel @AssistedInject constructor() : CWAViewModel() { ContactDiaryTestFragment.MENU_ITEM, PlaygroundFragment.MENU_ITEM, DataDonationTestFragment.MENU_ITEM, - DeltaonboardingFragment.MENU_ITEM, - TraceLocationOrganiserQrCodesListTestFragment.MENU_ITEM + DeltaonboardingFragment.MENU_ITEM ).let { MutableLiveData(it) } } val showTestScreenEvent = SingleLiveEvent() diff --git a/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragment.kt b/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragment.kt deleted file mode 100644 index 263d9fb889d..00000000000 --- a/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragment.kt +++ /dev/null @@ -1,71 +0,0 @@ -package de.rki.coronawarnapp.test.organiser.ui - -import android.os.Bundle -import android.view.View -import android.view.accessibility.AccessibilityEvent -import androidx.fragment.app.Fragment -import de.rki.coronawarnapp.R -import de.rki.coronawarnapp.databinding.TraceLocationOrganiserQrCodesListFragmentBinding -import de.rki.coronawarnapp.test.menu.ui.TestMenuItem -import de.rki.coronawarnapp.util.di.AutoInject -import de.rki.coronawarnapp.util.ui.viewBindingLazy -import de.rki.coronawarnapp.util.viewmodel.CWAViewModelFactoryProvider -import javax.inject.Inject - -class TraceLocationOrganiserQrCodesListTestFragment : Fragment(R.layout.trace_location_organiser_qr_codes_list_fragment), AutoInject { - - @Inject lateinit var viewModelFactory: CWAViewModelFactoryProvider.Factory -// private val vm: ContactDiaryOverviewViewModel by cwaViewModels { viewModelFactory } - private val binding: TraceLocationOrganiserQrCodesListFragmentBinding by viewBindingLazy() - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) - } - - override fun onResume() { - super.onResume() - binding.contentContainer.sendAccessibilityEvent(AccessibilityEvent.TYPE_ANNOUNCEMENT) - } - -// private fun setupMenu(toolbar: Toolbar) = toolbar.apply { -// inflateMenu(R.menu.menu_contact_diary_overview) -// setOnMenuItemClickListener { -// when (it.itemId) { -// R.id.menu_contact_diary_information -> { -// doNavigate( -// ContactDiaryOverviewFragmentDirections -// .actionContactDiaryOverviewFragmentToContactDiaryOnboardingFragment(showBottomNav = false) -// ) -// true -// } -// R.id.menu_contact_diary_export_entries -> { -// vm.onExportPress() -// true -// } -// R.id.menu_contact_diary_edit_persons -> { -// doNavigate( -// ContactDiaryOverviewFragmentDirections -// .actionContactDiaryOverviewFragmentToContactDiaryEditPersonsFragment() -// ) -// true -// } -// R.id.menu_contact_diary_edit_locations -> { -// doNavigate( -// ContactDiaryOverviewFragmentDirections -// .actionContactDiaryOverviewFragmentToContactDiaryEditLocationsFragment() -// ) -// true -// } -// else -> onOptionsItemSelected(it) -// } -// } -// } - - companion object { - val MENU_ITEM = TestMenuItem( - title = "Organiser QR Codes List", - description = "Check organiser qr codes list", - targetId = R.id.test_orginser_qr_codes_list_fragment - ) - } -} diff --git a/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragmentModule.kt b/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragmentModule.kt deleted file mode 100644 index bde05ae7272..00000000000 --- a/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragmentModule.kt +++ /dev/null @@ -1,18 +0,0 @@ -package de.rki.coronawarnapp.test.organiser.ui - -import dagger.Binds -import dagger.Module -import dagger.multibindings.IntoMap -import de.rki.coronawarnapp.util.viewmodel.CWAViewModel -import de.rki.coronawarnapp.util.viewmodel.CWAViewModelFactory -import de.rki.coronawarnapp.util.viewmodel.CWAViewModelKey - -@Module -abstract class TraceLocationOrganiserQrCodesListTestFragmentModule { - @Binds - @IntoMap - @CWAViewModelKey(TraceLocationOrganiserQrCodesListTestFragmentViewModel::class) - abstract fun organiserQrCodesListViewModel( - factory: TraceLocationOrganiserQrCodesListTestFragmentViewModel.Factory - ): CWAViewModelFactory -} diff --git a/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragmentViewModel.kt b/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragmentViewModel.kt deleted file mode 100644 index caccc18214c..00000000000 --- a/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/organiser/ui/TraceLocationOrganiserQrCodesListTestFragmentViewModel.kt +++ /dev/null @@ -1,16 +0,0 @@ -package de.rki.coronawarnapp.test.organiser.ui - -import dagger.assisted.AssistedFactory -import dagger.assisted.AssistedInject -import de.rki.coronawarnapp.util.coroutine.DispatcherProvider -import de.rki.coronawarnapp.util.viewmodel.CWAViewModel -import de.rki.coronawarnapp.util.viewmodel.SimpleCWAViewModelFactory - -class TraceLocationOrganiserQrCodesListTestFragmentViewModel @AssistedInject constructor( - dispatcherProvider: DispatcherProvider -) : CWAViewModel(dispatcherProvider = dispatcherProvider) { - - - @AssistedFactory - interface Factory : SimpleCWAViewModelFactory -} diff --git a/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/ui/main/MainActivityTestModule.kt b/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/ui/main/MainActivityTestModule.kt index fbbb32d50b2..da9c43ddb5f 100644 --- a/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/ui/main/MainActivityTestModule.kt +++ b/Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/ui/main/MainActivityTestModule.kt @@ -18,8 +18,6 @@ import de.rki.coronawarnapp.test.keydownload.ui.KeyDownloadTestFragment import de.rki.coronawarnapp.test.keydownload.ui.KeyDownloadTestFragmentModule import de.rki.coronawarnapp.test.menu.ui.TestMenuFragment import de.rki.coronawarnapp.test.menu.ui.TestMenuFragmentModule -import de.rki.coronawarnapp.test.organiser.ui.TraceLocationOrganiserQrCodesListTestFragment -import de.rki.coronawarnapp.test.organiser.ui.TraceLocationOrganiserQrCodesListTestFragmentModule import de.rki.coronawarnapp.test.playground.ui.PlaygroundFragment import de.rki.coronawarnapp.test.playground.ui.PlaygroundModule import de.rki.coronawarnapp.test.risklevel.ui.TestRiskLevelCalculationFragment @@ -67,7 +65,4 @@ abstract class MainActivityTestModule { @ContributesAndroidInjector(modules = [DeltaOnboardingFragmentModule::class]) abstract fun deltaOnboarding(): DeltaonboardingFragment - - @ContributesAndroidInjector(modules = [TraceLocationOrganiserQrCodesListTestFragmentModule::class]) - abstract fun organiserQrCodesList(): TraceLocationOrganiserQrCodesListTestFragment } diff --git a/Corona-Warn-App/src/deviceForTesters/res/navigation/test_nav_graph.xml b/Corona-Warn-App/src/deviceForTesters/res/navigation/test_nav_graph.xml index 5de3b498289..d4b7265dbf3 100644 --- a/Corona-Warn-App/src/deviceForTesters/res/navigation/test_nav_graph.xml +++ b/Corona-Warn-App/src/deviceForTesters/res/navigation/test_nav_graph.xml @@ -46,9 +46,6 @@ - - diff --git a/Corona-Warn-App/src/main/res/drawable-night/ic_illustration_no_qr_codes.xml b/Corona-Warn-App/src/main/res/drawable-night/ic_illustration_no_qr_codes.xml deleted file mode 100644 index c6a0b2bc7da..00000000000 --- a/Corona-Warn-App/src/main/res/drawable-night/ic_illustration_no_qr_codes.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/Corona-Warn-App/src/main/res/drawable/ic_illustration_no_qr_codes.xml b/Corona-Warn-App/src/main/res/drawable/ic_illustration_no_qr_codes.xml deleted file mode 100644 index c7071cc7be8..00000000000 --- a/Corona-Warn-App/src/main/res/drawable/ic_illustration_no_qr_codes.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_date_background.xml b/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_date_background.xml index 491252a4d09..7494dcc2e09 100644 --- a/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_date_background.xml +++ b/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_date_background.xml @@ -6,5 +6,5 @@ android:bottomLeftRadius="@dimen/radius_card" android:bottomRightRadius="@dimen/radius_card" /> - + diff --git a/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_qr_code_icon_background.xml b/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_qr_code_icon_background.xml index 33a588d81b3..d36e2112fa8 100644 --- a/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_qr_code_icon_background.xml +++ b/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_qr_code_icon_background.xml @@ -10,5 +10,5 @@ android:startColor="#A93F45" android:centerColor="#6C648C" android:endColor="#3C8CBB" - android:angle="135" /> + android:angle="125" /> diff --git a/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_fragment.xml b/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_fragment.xml deleted file mode 100644 index 1c0e9d12676..00000000000 --- a/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_fragment.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_item.xml b/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_item.xml index bc97abe8d28..e0262ce7681 100644 --- a/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_item.xml +++ b/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_item.xml @@ -10,8 +10,8 @@ #A7A7A7 #FFFFFF + + + #434445 diff --git a/Corona-Warn-App/src/main/res/values/colors.xml b/Corona-Warn-App/src/main/res/values/colors.xml index 8bcf5822056..a459e542b50 100644 --- a/Corona-Warn-App/src/main/res/values/colors.xml +++ b/Corona-Warn-App/src/main/res/values/colors.xml @@ -88,4 +88,7 @@ @color/colorAccent #999999 + + + #FFFFFF diff --git a/Corona-Warn-App/src/main/res/values/strings.xml b/Corona-Warn-App/src/main/res/values/strings.xml index b5550b76fa0..ee5cad7b727 100644 --- a/Corona-Warn-App/src/main/res/values/strings.xml +++ b/Corona-Warn-App/src/main/res/values/strings.xml @@ -1968,18 +1968,4 @@ "OK" "00:00" - - - - - "Meine QR-Codes" - - "QR-Code" - - "Noch keine QR Codes erstellt" - - "Hier werden alle QR-Codes angezeigt, die Sie für ein Ort oder Event erstellt haben. Sie können die QR-Codes löschen, wenn diese nicht mehr verwendet werden sollen." - From 01eac61153fdcc53285a677b43ad620c2f3ff452 Mon Sep 17 00:00:00 2001 From: Matthias Urhahn Date: Fri, 12 Mar 2021 20:06:44 +0100 Subject: [PATCH 3/3] Add "HighLightView" that allows setting caption text and allows children to be added to a constraint layout with gradient background. --- .../common/TraceLocationCardHighlightView.kt | 46 ++++++++++++++++++ ...odes_list_item_qr_code_icon_background.xml | 14 ------ ...ocation_view_cardhighlight_background.xml} | 9 ++-- ...e_location_view_cardhighlight_gradient.xml | 13 +++++ ..._location_organiser_qr_codes_list_item.xml | 47 +++++++------------ .../trace_location_view_cardhighlight.xml | 36 ++++++++++++++ Corona-Warn-App/src/main/res/values/attrs.xml | 4 ++ 7 files changed, 121 insertions(+), 48 deletions(-) create mode 100644 Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/eventregistration/common/TraceLocationCardHighlightView.kt delete mode 100644 Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_qr_code_icon_background.xml rename Corona-Warn-App/src/main/res/drawable/{trace_location_organiser_qr_codes_list_item_date_background.xml => trace_location_view_cardhighlight_background.xml} (67%) create mode 100644 Corona-Warn-App/src/main/res/drawable/trace_location_view_cardhighlight_gradient.xml create mode 100644 Corona-Warn-App/src/main/res/layout/trace_location_view_cardhighlight.xml diff --git a/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/eventregistration/common/TraceLocationCardHighlightView.kt b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/eventregistration/common/TraceLocationCardHighlightView.kt new file mode 100644 index 00000000000..9308fcb8b48 --- /dev/null +++ b/Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/eventregistration/common/TraceLocationCardHighlightView.kt @@ -0,0 +1,46 @@ +package de.rki.coronawarnapp.ui.eventregistration.common + +import android.content.Context +import android.util.AttributeSet +import android.view.LayoutInflater +import android.widget.TextView +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.core.content.ContextCompat +import androidx.core.content.withStyledAttributes +import androidx.core.view.children +import de.rki.coronawarnapp.R + +class TraceLocationCardHighlightView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : ConstraintLayout(context, attrs, defStyleAttr) { + + private val captionView: TextView by lazy { findViewById(R.id.caption) } + private val containerView: ConstraintLayout by lazy { findViewById(R.id.container) } + + init { + LayoutInflater.from(context).inflate(R.layout.trace_location_view_cardhighlight, this, true) + + background = ContextCompat.getDrawable(context, R.drawable.trace_location_view_cardhighlight_background) + + context.withStyledAttributes(attrs, R.styleable.TraceLocationHighlightView) { + val captionText = getText(R.styleable.TraceLocationHighlightView_android_text) ?: "" + captionView.text = captionText + } + } + + override fun onFinishInflate() { + children + .filter { it != captionView && it != containerView } + .forEach { + removeView(it) + containerView.addView(it) + } + super.onFinishInflate() + } + + fun setCaption(caption: String) { + captionView.text = caption + } +} diff --git a/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_qr_code_icon_background.xml b/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_qr_code_icon_background.xml deleted file mode 100644 index d36e2112fa8..00000000000 --- a/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_qr_code_icon_background.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - diff --git a/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_date_background.xml b/Corona-Warn-App/src/main/res/drawable/trace_location_view_cardhighlight_background.xml similarity index 67% rename from Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_date_background.xml rename to Corona-Warn-App/src/main/res/drawable/trace_location_view_cardhighlight_background.xml index 7494dcc2e09..dc85b552d1a 100644 --- a/Corona-Warn-App/src/main/res/drawable/trace_location_organiser_qr_codes_list_item_date_background.xml +++ b/Corona-Warn-App/src/main/res/drawable/trace_location_view_cardhighlight_background.xml @@ -1,10 +1,9 @@ - - - + android:radius="0dp" /> + diff --git a/Corona-Warn-App/src/main/res/drawable/trace_location_view_cardhighlight_gradient.xml b/Corona-Warn-App/src/main/res/drawable/trace_location_view_cardhighlight_gradient.xml new file mode 100644 index 00000000000..bacb62a6b0b --- /dev/null +++ b/Corona-Warn-App/src/main/res/drawable/trace_location_view_cardhighlight_gradient.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_item.xml b/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_item.xml index e0262ce7681..60c7911c140 100644 --- a/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_item.xml +++ b/Corona-Warn-App/src/main/res/layout/trace_location_organiser_qr_codes_list_item.xml @@ -1,6 +1,5 @@ - - + tools:text="21.01.2021"> - + + + - \ No newline at end of file diff --git a/Corona-Warn-App/src/main/res/layout/trace_location_view_cardhighlight.xml b/Corona-Warn-App/src/main/res/layout/trace_location_view_cardhighlight.xml new file mode 100644 index 00000000000..4baec8d5c1d --- /dev/null +++ b/Corona-Warn-App/src/main/res/layout/trace_location_view_cardhighlight.xml @@ -0,0 +1,36 @@ + + + + + + + \ No newline at end of file diff --git a/Corona-Warn-App/src/main/res/values/attrs.xml b/Corona-Warn-App/src/main/res/values/attrs.xml index 6ff2a5d3b28..21217d0f0c4 100644 --- a/Corona-Warn-App/src/main/res/values/attrs.xml +++ b/Corona-Warn-App/src/main/res/values/attrs.xml @@ -46,4 +46,8 @@ + + + + \ No newline at end of file