From 5d818dfeec01775758b7f1c04e05feefe2191580 Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 13 Mar 2022 22:23:22 +0100 Subject: [PATCH] Renamed EpcQrCodeCreator to EpcQrCodeGenerator --- .../{EpcQrCodeCreator.kt => EpcQrCodeGenerator.kt} | 6 +----- .../main/java/net/codinux/banking/epcqrcode/MainActivity.kt | 3 ++- .../codinux/banking/epcqrcode/windows/main/MainWindow.kt | 2 +- .../net/codinux/banking/epcqrcode/rest/EpcQrCodeResource.kt | 6 +++--- EpcQrCodeiOSApp/EpcQrCodeiOSApp/ContentView.swift | 4 ++-- 5 files changed, 9 insertions(+), 12 deletions(-) rename EpcQrCode/src/commonMain/kotlin/net/codinux/banking/epcqrcode/{EpcQrCodeCreator.kt => EpcQrCodeGenerator.kt} (94%) diff --git a/EpcQrCode/src/commonMain/kotlin/net/codinux/banking/epcqrcode/EpcQrCodeCreator.kt b/EpcQrCode/src/commonMain/kotlin/net/codinux/banking/epcqrcode/EpcQrCodeGenerator.kt similarity index 94% rename from EpcQrCode/src/commonMain/kotlin/net/codinux/banking/epcqrcode/EpcQrCodeCreator.kt rename to EpcQrCode/src/commonMain/kotlin/net/codinux/banking/epcqrcode/EpcQrCodeGenerator.kt index e04af6c..582f7e7 100644 --- a/EpcQrCode/src/commonMain/kotlin/net/codinux/banking/epcqrcode/EpcQrCodeCreator.kt +++ b/EpcQrCode/src/commonMain/kotlin/net/codinux/banking/epcqrcode/EpcQrCodeGenerator.kt @@ -1,11 +1,7 @@ package net.codinux.banking.epcqrcode -open class EpcQrCodeCreator { - -// companion object { -// val AmountNumberFormat = Decim -// } +open class EpcQrCodeGenerator { open fun generate(param: EpcQrCodeConfig): EpcQrCode { diff --git a/EpcQrCodeAndroidApp/src/main/java/net/codinux/banking/epcqrcode/MainActivity.kt b/EpcQrCodeAndroidApp/src/main/java/net/codinux/banking/epcqrcode/MainActivity.kt index ef38147..a2734b1 100644 --- a/EpcQrCodeAndroidApp/src/main/java/net/codinux/banking/epcqrcode/MainActivity.kt +++ b/EpcQrCodeAndroidApp/src/main/java/net/codinux/banking/epcqrcode/MainActivity.kt @@ -8,6 +8,7 @@ import kotlin.concurrent.thread class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -32,7 +33,7 @@ class MainActivity : AppCompatActivity() { val density = resources.displayMetrics.density val config = EncodeToQrCodeConfig((EncodeToQrCodeConfig.DefaultWidth * density).toInt(), (EncodeToQrCodeConfig.DefaultHeight * density).toInt()) - val qrCodeContent = EpcQrCodeCreator().generateAsString(param) + val qrCodeContent = EpcQrCodeGenerator().generateAsString(param) // TODO: this takes a very long time. Improve it val generatedQrCode = QrCodeGenerator().generateQrCode(qrCodeContent, config) diff --git a/EpcQrCodeJavaFxApp/src/main/kotlin/net/codinux/banking/epcqrcode/windows/main/MainWindow.kt b/EpcQrCodeJavaFxApp/src/main/kotlin/net/codinux/banking/epcqrcode/windows/main/MainWindow.kt index e282702..3f42745 100644 --- a/EpcQrCodeJavaFxApp/src/main/kotlin/net/codinux/banking/epcqrcode/windows/main/MainWindow.kt +++ b/EpcQrCodeJavaFxApp/src/main/kotlin/net/codinux/banking/epcqrcode/windows/main/MainWindow.kt @@ -268,7 +268,7 @@ class MainWindow : View(FX.messages["application.title"]) { private fun generateQrCode() { val param = EpcQrCodeConfig(receiver.value, iban.value, bic.value, amount.value, reference.value) - val qrCodeContent = EpcQrCodeCreator().generateAsString(param) + val qrCodeContent = EpcQrCodeGenerator().generateAsString(param) generatedQrCodeImage.value = generateQrCode(qrCodeContent) diff --git a/EpcQrCodeRest/src/main/kotlin/net/codinux/banking/epcqrcode/rest/EpcQrCodeResource.kt b/EpcQrCodeRest/src/main/kotlin/net/codinux/banking/epcqrcode/rest/EpcQrCodeResource.kt index 5c07714..9cb000f 100644 --- a/EpcQrCodeRest/src/main/kotlin/net/codinux/banking/epcqrcode/rest/EpcQrCodeResource.kt +++ b/EpcQrCodeRest/src/main/kotlin/net/codinux/banking/epcqrcode/rest/EpcQrCodeResource.kt @@ -2,7 +2,7 @@ package net.codinux.banking.epcqrcode.rest import net.codinux.banking.epcqrcode.EpcQrCodeConfig import net.codinux.banking.epcqrcode.EncodeToQrCodeConfig -import net.codinux.banking.epcqrcode.EpcQrCodeCreator +import net.codinux.banking.epcqrcode.EpcQrCodeGenerator import net.codinux.banking.epcqrcode.QrCodeGenerator import net.codinux.banking.epcqrcode.rest.dto.GenerateEpcQrCodeRequestDto import net.codinux.banking.epcqrcode.rest.dto.GenerateEpcQrCodeResponseDto @@ -22,7 +22,7 @@ class EpcQrCodeResource { } - protected val epcQrCodeCreator = EpcQrCodeCreator() + protected val epcQrCodeGenerator = EpcQrCodeGenerator() protected val qrCodeGenerator = QrCodeGenerator() @@ -31,7 +31,7 @@ class EpcQrCodeResource { @Produces(MediaType.APPLICATION_JSON) fun createEpcQrCode(requestDto: GenerateEpcQrCodeRequestDto): Response { try { - val qrCodeContent = epcQrCodeCreator.generateAsString(mapToEpcQrCodeConfig(requestDto)) + val qrCodeContent = epcQrCodeGenerator.generateAsString(mapToEpcQrCodeConfig(requestDto)) val qrCodeBytes = qrCodeGenerator.generateQrCode(qrCodeContent, map(requestDto)) return Response.ok(GenerateEpcQrCodeResponseDto(qrCodeBytes)) diff --git a/EpcQrCodeiOSApp/EpcQrCodeiOSApp/ContentView.swift b/EpcQrCodeiOSApp/EpcQrCodeiOSApp/ContentView.swift index 860dc35..126244f 100644 --- a/EpcQrCodeiOSApp/EpcQrCodeiOSApp/ContentView.swift +++ b/EpcQrCodeiOSApp/EpcQrCodeiOSApp/ContentView.swift @@ -81,10 +81,10 @@ struct ContentView: View { private func generateQRCode() { - let creator = EpcQrCodeCreator() + let generator = EpcQrCodeGenerator() let param = EpcQrCodeConfig(receiverName: receiver, iban: iban, bic: bic, amount: amount, reference: reference, noteToUser: nil, encoding: .utf8) - let qrCodeContent = creator.generateAsString(param: param) + let qrCodeContent = generator.generateAsString(param: param) self.generatedQrCode = generateQRCode(qrCodeContent) }