Skip to content

Commit

Permalink
Merge branch 'eu-digital-identity-wallet:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
shoyheim-dd authored Oct 23, 2024
2 parents 88f1f2f + 5b029ff commit 7c56ea7
Show file tree
Hide file tree
Showing 11 changed files with 1,384 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ import eu.europa.ec.analyticslogic.controller.AnalyticsController
import eu.europa.ec.assemblylogic.di.setupKoin
import eu.europa.ec.corelogic.config.WalletCoreConfig
import eu.europa.ec.eudi.wallet.EudiWallet
import eu.europa.ec.resourceslogic.theme.ThemeManager
import eu.europa.ec.resourceslogic.theme.templates.ThemeDimensTemplate
import eu.europa.ec.resourceslogic.theme.values.ThemeColors
import eu.europa.ec.resourceslogic.theme.values.ThemeShapes
import eu.europa.ec.resourceslogic.theme.values.ThemeTypography
import org.koin.android.ext.android.inject

class Application : Application() {
Expand All @@ -38,27 +33,12 @@ class Application : Application() {
setupKoin()
initializeReporting()
initializeEudiWallet()
initializeTheme()
}

private fun initializeReporting() {
analyticsController.initialize(this)
}

private fun initializeTheme() {
ThemeManager.Builder()
.withLightColors(ThemeColors.lightColors)
.withDarkColors(ThemeColors.darkColors)
.withTypography(ThemeTypography.typo)
.withShapes(ThemeShapes.shapes)
.withDimensions(
ThemeDimensTemplate(
screenPadding = 10.0
)
)
.build()
}

private fun initializeEudiWallet() {
EudiWallet.init(
applicationContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ package eu.europa.ec.commonfeature.ui.qr_scan.component
import android.graphics.ImageFormat
import androidx.camera.core.ImageAnalysis
import androidx.camera.core.ImageProxy
import com.google.zxing.BarcodeFormat
import com.google.zxing.BinaryBitmap
import com.google.zxing.DecodeHintType
import com.google.zxing.MultiFormatReader
import com.google.zxing.PlanarYUVLuminanceSource
import com.google.zxing.common.HybridBinarizer
import com.google.zxing.qrcode.QRCodeReader
import java.nio.ByteBuffer

class QrCodeAnalyzer(
Expand All @@ -39,10 +37,11 @@ class QrCodeAnalyzer(

override fun analyze(image: ImageProxy) {
if (image.format in supportedImageFormats) {
val bytes = image.planes.first().buffer.toByteArray()
val plane = image.planes.first()
val bytes = plane.buffer.toByteArray()
val source = PlanarYUVLuminanceSource(
bytes,
image.width,
plane.rowStride,
image.height,
0,
0,
Expand All @@ -52,15 +51,7 @@ class QrCodeAnalyzer(
)
val binaryBmp = BinaryBitmap(HybridBinarizer(source))
try {
val result = MultiFormatReader().apply {
setHints(
mapOf(
DecodeHintType.POSSIBLE_FORMATS to arrayListOf(
BarcodeFormat.QR_CODE
)
)
)
}.decode(binaryBmp)
val result = QRCodeReader().decode(binaryBmp)
onQrCodeScanned(result.text)
} catch (e: Exception) {
e.printStackTrace()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ import eu.europa.ec.eudi.iso18013.transfer.DocItem
import eu.europa.ec.eudi.iso18013.transfer.DocRequest
import eu.europa.ec.eudi.iso18013.transfer.ReaderAuth
import eu.europa.ec.eudi.iso18013.transfer.RequestDocument
import eu.europa.ec.eudi.wallet.issue.openid4vci.Offer.TxCodeSpec
import eu.europa.ec.uilogic.component.AppIcons
import eu.europa.ec.uilogic.component.InfoTextWithNameAndImageData
import eu.europa.ec.uilogic.component.InfoTextWithNameAndValueData
import eu.europa.ec.uilogic.config.ConfigNavigation
import eu.europa.ec.uilogic.config.NavigationType
import eu.europa.ec.uilogic.navigation.DashboardScreens

@VisibleForTesting(otherwise = VisibleForTesting.NONE)
object TestsData {
Expand Down Expand Up @@ -78,8 +82,21 @@ object TestsData {
const val mockedDocumentHasExpired = false
const val mockedUserAuthentication = false
const val mockedVerifierName = "EUDIW Verifier"
const val mockedIssuerName = "EUDIW Issuer"
const val mockedRequestRequiredFieldsTitle = "Verification Data"
const val mockedRequestElementIdentifierNotAvailable = "Not available"
const val mockedOfferedDocumentName = "Offered Document"
const val mockedOfferedDocumentDocType = "mocked_offered_document_doc_type"
const val mockedTxCodeSpecFourDigits = 4
const val mockedSuccessTitle = "Success title"
const val mockedSuccessSubtitle = "Success subtitle"
const val mockedSuccessContentDescription = "Content description"
const val mockedIssuanceErrorMessage = "Issuance error message"
const val mockedInvalidCodeFormatMessage = "Invalid code format message"
const val mockedWalletActivationErrorMessage = "Wallet activation error message"
const val mockedPrimaryButtonText = "Primary button text"
const val mockedRouteArguments = "mockedRouteArguments"
const val mockedTxCode = "mockedTxCode"

const val mockedPidDocType = "eu.europa.ec.eudi.pid.1"
const val mockedPidNameSpace = "eu.europa.ec.eudi.pid.1"
Expand Down Expand Up @@ -536,6 +553,24 @@ object TestsData {
available = true
)

val mockedConfigNavigationTypePop = ConfigNavigation(navigationType = NavigationType.Pop)
val mockedConfigNavigationTypePush = ConfigNavigation(
navigationType = NavigationType.PushRoute(
route = DashboardScreens.Dashboard.screenRoute
)
)
val mockedConfigNavigationTypePopToScreen = ConfigNavigation(
navigationType = NavigationType.PopTo(
screen = DashboardScreens.Dashboard
)
)

val mockedOfferTxCodeSpecFourDigits =
TxCodeSpec(
inputMode = TxCodeSpec.InputMode.NUMERIC,
length = mockedTxCodeSpecFourDigits
)

val mockedOptionalFieldsForPidWithBasicFields = listOf(
TestFieldUi(
elementIdentifier = "family_name",
Expand Down
16 changes: 8 additions & 8 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[versions]
accompanist = "0.34.0"
androidDesugarJdkLibs = "2.1.2"
androidGradlePlugin = "8.7.0"
androidxActivity = "1.9.2"
androidGradlePlugin = "8.7.1"
androidxActivity = "1.9.3"
androidxAppCompat = "1.7.0"
androidxBrowser = "1.8.0"
androidxComposeBom = "2024.09.03"
androidxComposeRuntimeTracing = "1.7.3"
androidxComposeBom = "2024.10.00"
androidxComposeRuntimeTracing = "1.7.4"
androidxCore = "1.13.1"
androidxCoreSplashscreen = "1.0.1"
androidxDataStore = "1.1.1"
androidxEspresso = "3.6.1"
androidxLifecycle = "2.8.6"
androidxMacroBenchmark = "1.3.2"
androidxMacroBenchmark = "1.3.3"
androidxMetrics = "1.0.0-beta01"
androidxNavigation = "2.8.2"
androidxNavigation = "2.8.3"
androidxProfileinstaller = "1.4.1"
androidxTestCore = "1.6.1"
androidxTestExt = "1.2.1"
Expand All @@ -37,7 +37,7 @@ kotlinxCoroutines = "1.8.1"
kotlinxDatetime = "0.4.1"
kotlinxSerializationJson = "1.7.1"
ksp = "2.0.10-1.0.24"
lint = "31.7.0"
lint = "31.7.1"
okhttp = "4.12.0"
protobuf = "3.24.0"
protobufPlugin = "0.9.4"
Expand All @@ -64,7 +64,7 @@ material3 = "1.3.0"
appCenter = "5.0.4"
kover = "0.7.5"
sonar = "5.0.0.4638"
baselineprofile = "1.3.2"
baselineprofile = "1.3.3"
timber = "5.0.1"
treessence = "1.1.2"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class AddDocumentViewModel(
@InjectedParam private val flowType: IssuanceFlowUiConfig,
) : MviViewModel<Event, State, Effect>() {

var issuanceJob: Job? = null
private var issuanceJob: Job? = null

override fun setInitialState(): State = State(
navigatableAction = getNavigatableAction(flowType),
Expand Down
Loading

0 comments on commit 7c56ea7

Please sign in to comment.