diff --git a/.editorconfig b/.editorconfig index 580b6ec..6b5ea13 100644 --- a/.editorconfig +++ b/.editorconfig @@ -23,3 +23,6 @@ ktlint_standard_filename = disabled ktlint_standard_package-name = disabled ktlint_standard_enum-entry-name-case = disabled ktlint_standard_function-naming = disabled + +[shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/**] +ktlint_standard_backing-property-naming = disabled diff --git a/android/build.gradle.kts b/android/build.gradle.kts index b741c24..f1ef6bd 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -52,30 +52,20 @@ android { } dependencies { - api(project(":shared")) + implementation(project(":shared")) implementation(libs.core.ktx) implementation(libs.androidx.fragment.ktx) implementation(libs.appcompat) implementation(libs.material) + implementation(libs.activity.compose) implementation(libs.kotlinx.coroutines.android) - implementation(libs.kotlinx.datetime) - implementation(libs.kotlinx.serialization.json) - implementation(libs.lifecycle.runtime.ktx) implementation(libs.lifecycle.viewmodel.compose) - implementation(libs.activity.compose) - implementation(platform(libs.compose.bom)) - implementation(libs.ui) - implementation(libs.ui.graphics) - implementation(libs.ui.tooling.preview) - implementation(libs.material3) - implementation(libs.compose.webview) implementation(libs.voyager.navigator) implementation(libs.voyager.screenModel) - implementation(libs.voyager.transitions) - implementation(libs.androidx.browser) - testImplementation(libs.junit) - androidTestImplementation(libs.ext.junit) - androidTestImplementation(libs.espresso.core) + implementation(libs.ui.graphics) + implementation(libs.material3) + implementation(platform(libs.compose.bom)) + implementation(libs.ui) debugImplementation(libs.androidx.ui.tooling) } diff --git a/android/src/main/java/com/komoju/android/sdk/KomojuAndroidSDK.kt b/android/src/main/java/com/komoju/android/sdk/KomojuAndroidSDK.kt new file mode 100644 index 0000000..c0785d3 --- /dev/null +++ b/android/src/main/java/com/komoju/android/sdk/KomojuAndroidSDK.kt @@ -0,0 +1,209 @@ +package com.komoju.android.sdk + +import android.os.Parcelable +import androidx.activity.result.contract.ActivityResultContract +import androidx.compose.ui.graphics.toArgb +import com.komoju.android.sdk.annotations.ExperimentalKomojuPaymentApi +import com.komoju.android.sdk.types.Currency +import com.komoju.android.sdk.types.Language +import com.komoju.mobile.sdk.KomojuMobileSDKConfiguration +import com.komoju.mobile.sdk.KomojuMobileSDKPaymentResult +import com.komoju.mobile.sdk.canProcessPayment +import com.komoju.mobile.sdk.ui.theme.ConfigurableTheme as CoreConfigurableTheme +import com.komoju.mobile.sdk.ui.theme.DefaultConfigurableTheme +import com.komoju.mobile.sdk.ui.theme.toColor +import kotlin.contracts.ExperimentalContracts +import kotlin.contracts.contract +import kotlinx.parcelize.Parcelize + +/** + * Singleton object providing the main SDK functionalities for Komoju Android integration. + */ +object KomojuAndroidSDK { + + /** + * An [ActivityResultContract] for starting a payment flow and returning a result asynchronously. + */ + val activityResultContract: ActivityResultContract + get() = KomojuStartPaymentForResultContract() + + /** + * Configuration class to hold parameters required for payment processing. + * + * @param language The language setting for the payment UI. + * @param currency The currency to be used for the transaction. + * @param publishableKey The public API key for the Komoju integration. + * @param isDebugMode A flag to indicate whether the SDK is in debug mode. + * @param sessionId A unique session ID for the payment transaction. + * @param redirectURL The URL to redirect the user to after payment completion. + * @param appScheme The app scheme for deep linking. + * @param configurableTheme The custom theme for the UI elements of the payment flow. + * @param inlinedProcessing A flag to indicate if inlined processing is enabled. + */ + @Parcelize + data class Configuration( + val language: Language, // Language setting for the payment UI. + val currency: Currency, // Currency used in the transaction. + val publishableKey: String?, // Public API key for Komoju integration. + val isDebugMode: Boolean, // Debug mode flag for logging and testing. + val sessionId: String?, // Unique session ID for payment transaction. + val redirectURL: String, // URL to redirect after payment completion. + val appScheme: String, // App schema for deep links. + val configurableTheme: ConfigurableTheme, // Custom theme for UI elements. + val inlinedProcessing: Boolean, // Flag to enable inlined processing. + ) : Parcelable { + + /** + * Builder class for creating a [Configuration] instance. + * Offers a flexible way to set optional parameters. + */ + class Builder(private val publishableKey: String, private val sessionId: String) { + private var language: Language = Language.JAPANESE // Default language is Japanese. + private var currency: Currency = Currency.JPY // Default currency is Japanese Yen. + private var isDebugMode: Boolean = false // Debug mode is off by default. + private var configurableTheme: ConfigurableTheme = + ConfigurableTheme.default // Custom theme for UI elements. + private var inlinedProcessing: Boolean = false // Inlined processing is off by default. + + /** Sets the language for the payment. */ + fun setLanguage(language: Language) = apply { + this.language = language + } + + /** Sets the currency for the transaction. */ + fun setCurrency(currency: Currency) = apply { + this.currency = currency + } + + /** Enables or disables debug mode. */ + fun setDebugMode(isDebugMode: Boolean) = apply { + this.isDebugMode = isDebugMode + } + + /** Sets the custom theme for the payment UI. */ + fun setConfigurableTheme(configurableTheme: ConfigurableTheme) = apply { + this.configurableTheme = configurableTheme + } + + /** + * WARNING: Experimental API [Try this only if you are sure] Disabled by Default. + * + * This API enables or disables inlined processing. + * If this is enabled, the SDK will attempt to process payments with fewer UI screens. + * + * Example: + * - For PayPay, the SDK will close as soon as the payment is verified. + * - For Credit Card payments, if second-step verification isn't required, the SDK will skip the WebView and handle the callback directly. + * + * @param inlinedProcessing Boolean flag to enable inlined processing. + */ + @ExperimentalKomojuPaymentApi + fun setInlinedProcessing(inlinedProcessing: Boolean) = apply { + this.inlinedProcessing = inlinedProcessing + } + + /** + * Builds the [Configuration] instance with the provided settings. + * + * @return The configured [Configuration] object. + */ + fun build(): Configuration = Configuration( + language = language, + currency = currency, + publishableKey = publishableKey, + sessionId = sessionId, + isDebugMode = isDebugMode, + configurableTheme = configurableTheme, + inlinedProcessing = inlinedProcessing, + appScheme = "", + redirectURL = "", + ) + } + } + + /** + * Class to define configurable theme options for the payment UI. + * + * @param primaryColorInt The primary color of the UI as an integer. + * @param primaryContentColorInt The color for primary content in the UI. + * @param loaderColorInt The color of the loading indicator. + * @param primaryShapeCornerRadiusInDp The corner radius (in dp) for primary UI elements. + */ + @Parcelize + data class ConfigurableTheme( + val primaryColorInt: Int, + val primaryContentColorInt: Int, + val loaderColorInt: Int, + val primaryShapeCornerRadiusInDp: Int, + ) : Parcelable { + companion object { + // Default theme used by the SDK. + val default: ConfigurableTheme = com.komoju.mobile.sdk.ui.theme.ConfigurableTheme.default.toAndroidSDKConfigurableTheme() + } + } + + /** + * A result of the payment, indicating whether the payment was successful or not. + * + * @param isSuccessFul Boolean flag indicating the payment result. + */ + @Parcelize + data class PaymentResult(val isSuccessFul: Boolean) : Parcelable +} + +internal fun KomojuAndroidSDK.ConfigurableTheme.toKomojuConfigurableTheme(): CoreConfigurableTheme = DefaultConfigurableTheme( + primaryColor = primaryColorInt.toLong(), + primaryContentColor = primaryContentColorInt.toLong(), + loaderColor = loaderColorInt.toLong(), + primaryShapeCornerRadiusInDp = this.primaryShapeCornerRadiusInDp, +) + +internal fun CoreConfigurableTheme.toAndroidSDKConfigurableTheme(): KomojuAndroidSDK.ConfigurableTheme = KomojuAndroidSDK.ConfigurableTheme( + primaryColorInt = primaryColor.toColor().toArgb(), + primaryContentColorInt = primaryContentColor.toColor().toArgb(), + loaderColorInt = loaderColor.toColor().toArgb(), + primaryShapeCornerRadiusInDp = primaryShapeCornerRadiusInDp, +) + +/** + * Extension function to check if the current configuration is valid for processing a payment. + * A configuration is valid if it is non-null and contains both a valid publishable key and session ID. + * + * @return True if the configuration is valid for payment processing, false otherwise. + */ +@OptIn(ExperimentalContracts::class) +fun KomojuAndroidSDK.Configuration?.canProcessPayment(): Boolean { + contract { + returns(true) implies (this@canProcessPayment != null) + } + return this?.toMobileConfiguration().canProcessPayment() +} + +internal fun KomojuMobileSDKConfiguration.toAndroidConfiguration(): KomojuAndroidSDK.Configuration = KomojuAndroidSDK.Configuration( + language = Language.parse(this.language), + currency = Currency.parse(this.currency), + publishableKey = this.publishableKey, + isDebugMode = this.isDebugMode, + sessionId = this.sessionId, + redirectURL = this.redirectURL, + configurableTheme = this.configurableTheme.toAndroidSDKConfigurableTheme(), + inlinedProcessing = this.inlinedProcessing, + appScheme = this.appScheme, +) + +internal fun KomojuAndroidSDK.Configuration.toMobileConfiguration(): KomojuMobileSDKConfiguration = KomojuMobileSDKConfiguration( + language = this.language.languageCode, + currency = this.currency.currencyCode, + publishableKey = this.publishableKey, + isDebugMode = this.isDebugMode, + sessionId = this.sessionId, + redirectURL = this.redirectURL, + configurableTheme = this.configurableTheme.toKomojuConfigurableTheme(), + inlinedProcessing = this.inlinedProcessing, + appScheme = this.appScheme, +) + +internal fun KomojuMobileSDKPaymentResult.toParcelable(): KomojuAndroidSDK.PaymentResult = KomojuAndroidSDK.PaymentResult(this.isSuccessFul) + +internal fun KomojuAndroidSDK.PaymentResult.toPaymentResult(): KomojuMobileSDKPaymentResult = + KomojuMobileSDKPaymentResult(this.isSuccessFul) diff --git a/android/src/main/java/com/komoju/android/sdk/KomojuPaymentActivity.kt b/android/src/main/java/com/komoju/android/sdk/KomojuPaymentActivity.kt index b116936..d0ad7a6 100644 --- a/android/src/main/java/com/komoju/android/sdk/KomojuPaymentActivity.kt +++ b/android/src/main/java/com/komoju/android/sdk/KomojuPaymentActivity.kt @@ -14,7 +14,6 @@ import androidx.compose.animation.slideInVertically import androidx.compose.animation.slideOutVertically import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.navigationBarsPadding @@ -30,13 +29,10 @@ import androidx.core.content.IntentCompat import androidx.core.util.Consumer import androidx.lifecycle.compose.collectAsStateWithLifecycle import androidx.lifecycle.lifecycleScope -import cafe.adriel.voyager.navigator.Navigator -import cafe.adriel.voyager.transitions.SlideTransition -import com.komoju.android.sdk.navigation.PaymentResultScreenModel -import com.komoju.android.sdk.navigation.paymentResultScreenModel -import com.komoju.android.sdk.ui.screens.RouterEffect -import com.komoju.android.sdk.ui.screens.payment.KomojuPaymentScreen -import com.komoju.android.sdk.ui.theme.KomojuMobileSdkTheme +import com.komoju.mobile.sdk.navigation.PaymentResultScreenModel +import com.komoju.mobile.sdk.navigation.paymentResultScreenModel +import com.komoju.mobile.sdk.ui.screens.KomojuPaymentEntryPoint +import com.komoju.mobile.sdk.ui.screens.RouterEffect import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.delay import kotlinx.coroutines.flow.callbackFlow @@ -55,7 +51,7 @@ internal class KomojuPaymentActivity : ComponentActivity() { /* name = */ KomojuStartPaymentForResultContract.CONFIGURATION_KEY, /* clazz = */ - KomojuSDK.Configuration::class.java, + KomojuAndroidSDK.Configuration::class.java, ) ?: error("komoju sdk configuration is null"), ) }, @@ -87,21 +83,10 @@ internal class KomojuPaymentActivity : ComponentActivity() { .navigationBarsPadding(), contentAlignment = Alignment.BottomCenter, ) { - KomojuMobileSdkTheme(viewModel.configuration) { - Box( - modifier = Modifier - .fillMaxWidth() - .fillMaxHeight(.9f), - ) { - Navigator( - KomojuPaymentScreen(viewModel.configuration), - ) { navigator -> - commonScreenModel = navigator.paymentResultScreenModel() - SlideTransition(navigator) - RouterEffect(viewModel.router.collectAsStateWithLifecycle(), viewModel::onRouteConsumed) - NewIntentEffect(LocalContext.current, viewModel::onNewDeeplink) - } - } + KomojuPaymentEntryPoint(viewModel.configuration) { navigator -> + RouterEffect(viewModel.router.collectAsStateWithLifecycle(), viewModel::onRouteConsumed) + commonScreenModel = navigator.paymentResultScreenModel() + NewIntentEffect(LocalContext.current, viewModel::onNewDeeplink) } } } @@ -128,7 +113,7 @@ internal class KomojuPaymentActivity : ComponentActivity() { setResult( RESULT_OK, Intent().apply { - putExtra(KomojuStartPaymentForResultContract.RESULT_KEY, commonScreenModel?.result) + putExtra(KomojuStartPaymentForResultContract.RESULT_KEY, commonScreenModel?.result?.toParcelable()) }, ) lifecycleScope.launch { diff --git a/android/src/main/java/com/komoju/android/sdk/KomojuPaymentViewModel.kt b/android/src/main/java/com/komoju/android/sdk/KomojuPaymentViewModel.kt index 04ce1c9..b9e37f5 100644 --- a/android/src/main/java/com/komoju/android/sdk/KomojuPaymentViewModel.kt +++ b/android/src/main/java/com/komoju/android/sdk/KomojuPaymentViewModel.kt @@ -2,13 +2,14 @@ package com.komoju.android.sdk import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider -import com.komoju.android.sdk.ui.screens.KomojuPaymentRoute -import com.komoju.android.sdk.ui.screens.Router -import com.komoju.android.sdk.utils.DeeplinkEntity +import com.komoju.mobile.sdk.KomojuMobileSDKConfiguration +import com.komoju.mobile.sdk.ui.screens.KomojuPaymentRoute +import com.komoju.mobile.sdk.ui.screens.Router +import com.komoju.mobile.sdk.utils.DeeplinkEntity import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow -internal class KomojuPaymentViewModel(internal val configuration: KomojuSDK.Configuration) : ViewModel() { +internal class KomojuPaymentViewModel(internal val configuration: KomojuMobileSDKConfiguration) : ViewModel() { private val _isVisible = MutableStateFlow(false) val isVisible = _isVisible.asStateFlow() @@ -35,6 +36,7 @@ internal class KomojuPaymentViewModel(internal val configuration: KomojuSDK.Conf amount = deeplinkEntity.amount, currency = deeplinkEntity.currency, ) + DeeplinkEntity.Verify.BySessionId -> KomojuPaymentRoute.ProcessPayment.ProcessType.Session }, ), @@ -42,9 +44,10 @@ internal class KomojuPaymentViewModel(internal val configuration: KomojuSDK.Conf } } -internal class KomojuPaymentViewModelFactory(private val configuration: KomojuSDK.Configuration) : ViewModelProvider.NewInstanceFactory() { +internal class KomojuPaymentViewModelFactory(private val configuration: KomojuAndroidSDK.Configuration) : + ViewModelProvider.NewInstanceFactory() { override fun create(modelClass: Class): T { @Suppress("UNCHECKED_CAST") - return KomojuPaymentViewModel(configuration) as T + return KomojuPaymentViewModel(configuration.toMobileConfiguration()) as T } } diff --git a/android/src/main/java/com/komoju/android/sdk/KomojuSDK.kt b/android/src/main/java/com/komoju/android/sdk/KomojuSDK.kt deleted file mode 100644 index c1d2e8b..0000000 --- a/android/src/main/java/com/komoju/android/sdk/KomojuSDK.kt +++ /dev/null @@ -1,179 +0,0 @@ -package com.komoju.android.sdk - -import android.content.Context -import android.content.Intent -import android.os.Build -import android.os.Parcelable -import androidx.activity.result.contract.ActivityResultContract -import com.komoju.android.sdk.types.Currency -import com.komoju.android.sdk.types.Language -import com.komoju.android.sdk.ui.theme.ConfigurableTheme -import com.komoju.android.sdk.utils.empty -import kotlin.contracts.ExperimentalContracts -import kotlin.contracts.contract -import kotlinx.parcelize.Parcelize - -/** - * Main entry point for Komoju SDK integration. - * Provides configuration setup and payment processing contract. - */ -object KomojuSDK { - - /** - * Configuration class to hold parameters required for payment processing. - * Implements [Parcelable] to allow passing data between activities. - */ - @Parcelize - data class Configuration( - internal val language: Language, // Language setting for the payment UI. - internal val currency: Currency, // Currency used in the transaction. - internal val publishableKey: String?, // Public API key for Komoju integration. - internal val isDebugMode: Boolean, // Debug mode flag for logging and testing. - internal val sessionId: String?, // Unique session ID for payment transaction. - internal val redirectURL: String = String.empty, // URL to redirect after payment completion. - internal val configurableTheme: ConfigurableTheme, // Custom theme for UI elements. - internal val inlinedProcessing: Boolean, // Flag to enable inlined processing. - ) : Parcelable { - - /** - * Builder class for creating a [Configuration] instance. - * Offers a flexible way to set optional parameters. - */ - class Builder(private val publishableKey: String, private val sessionId: String) { - private var language: Language = Language.ENGLISH // Default language is English. - private var currency: Currency = Currency.JPY // Default currency is Japanese Yen. - private var isDebugMode: Boolean = false // Debug mode is off by default. - private var configurableTheme: ConfigurableTheme = ConfigurableTheme.default // Custom theme for UI elements. - private var inlinedProcessing: Boolean = false // Inlined processing is off by default. - - /** Sets the language for the payment. */ - fun setLanguage(language: Language) = apply { - this.language = language - } - - /** Sets the currency for the transaction. */ - fun setCurrency(currency: Currency) = apply { - this.currency = currency - } - - /** Enables or disables debug mode. */ - fun setDebugMode(isDebugMode: Boolean) = apply { - this.isDebugMode = isDebugMode - } - - /** Sets the custom theme for the payment UI. */ - fun setConfigurableTheme(configurableTheme: ConfigurableTheme) = apply { - this.configurableTheme = configurableTheme - } - - /** - * WARNING: Experimental API [Try this only if you are sure] Disabled by Default. - * - * This API enables or disables inlined processing. - * If this is enabled then The SDK will try to do processing with minimum amount of screens. - * - * For e.g. - * * If PayPay Payment id captured, it will close the SDK ASAP it verifies the payment. - * * When you will try to pay with Credit Card and Second step verification is not required, SDK will never show the WebView and will handle the callback itself. - * - */ - @ExperimentalKomojuPaymentApi - fun setInlinedProcessing(inlinedProcessing: Boolean) = apply { - this.inlinedProcessing = inlinedProcessing - } - - /** - * Builds the [Configuration] instance with the provided settings. - */ - fun build(): Configuration = Configuration( - language = language, - currency = currency, - publishableKey = publishableKey, - sessionId = sessionId, - isDebugMode = isDebugMode, - configurableTheme = configurableTheme, - inlinedProcessing = inlinedProcessing, - ) - } - } - - /** - * Data class to hold the result of a payment transaction. - * @param isSuccessFul Whether the payment was successful or not. - */ - @Parcelize - data class PaymentResult(val isSuccessFul: Boolean) : Parcelable - - /** - * Property that provides the contract to start the payment process - * and receive the result (success or failure). - */ - @JvmStatic - val KomojuPaymentResultContract: ActivityResultContract get() = KomojuStartPaymentForResultContract() -} - -/** - * Extension function to check if the current configuration is valid for processing a payment. - * @return True if the configuration is non-null and contains both publishableKey and sessionId. - */ -@OptIn(ExperimentalContracts::class) -fun KomojuSDK.Configuration?.canProcessPayment(): Boolean { - contract { - returns(true) implies (this@canProcessPayment != null) - } - return this?.publishableKey != null && this.sessionId != null -} - -/** - * Internal contract that handles starting the payment activity and returning the result. - */ -internal class KomojuStartPaymentForResultContract : ActivityResultContract() { - - companion object { - const val CONFIGURATION_KEY: String = "KomojuSDK.Configuration" // Key for passing configuration data via Intent. - const val RESULT_KEY: String = "KomojuSDK.PaymentResult" // Key for passing result data via Intent. - } - - /** - * Creates an [Intent] to start the payment activity using the provided configuration. - * Performs pre-checks before starting the activity. - * @param context Context in which the payment activity will be started. - * @param input Configuration used for payment setup. - * @return The [Intent] with necessary data to start the payment activity. - */ - override fun createIntent(context: Context, input: KomojuSDK.Configuration): Intent { - context.preChecks() // Ensure app scheme is correctly set in resources. - val intent = Intent(context, KomojuPaymentActivity::class.java) - intent.putExtra( - CONFIGURATION_KEY, - input.copy( - redirectURL = "${context.resources.getString(R.string.komoju_consumer_app_scheme)}://", - ), - ) - return intent - } - - /** - * Performs pre-checks to ensure that the app scheme is correctly set in strings.xml. - * Throws an error if the scheme is not properly configured. - */ - private fun Context.preChecks() { - if (resources.getString(R.string.komoju_consumer_app_scheme) == "this-should-not-be-the-case") { - error("Please set komoju_consumer_app_scheme in strings.xml with your app scheme") - } - } - - /** - * Parses the result returned by the payment activity. - * This is a placeholder for actual result parsing logic. - * @param resultCode Result code from the activity. - * @param intent The returned [Intent] containing the result data. - * @return [KomojuSDK.PaymentResult] indicating whether the payment was successful or not. - */ - override fun parseResult(resultCode: Int, intent: Intent?): KomojuSDK.PaymentResult = when { - Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU -> intent?.getParcelableExtra(RESULT_KEY, KomojuSDK.PaymentResult::class.java) - else -> - @Suppress("DEPRECATION") - intent?.getParcelableExtra(RESULT_KEY) - } ?: KomojuSDK.PaymentResult(isSuccessFul = false) -} diff --git a/android/src/main/java/com/komoju/android/sdk/KomojuStartPaymentForResultContract.kt b/android/src/main/java/com/komoju/android/sdk/KomojuStartPaymentForResultContract.kt new file mode 100644 index 0000000..0fb7f9f --- /dev/null +++ b/android/src/main/java/com/komoju/android/sdk/KomojuStartPaymentForResultContract.kt @@ -0,0 +1,66 @@ +package com.komoju.android.sdk + +import android.content.Context +import android.content.Intent +import android.os.Build +import androidx.activity.result.contract.ActivityResultContract +import com.komoju.mobile.sdk.KomojuMobileSDKPaymentResult + +/** + * Internal contract that handles starting the payment activity and returning the result. + */ +internal class KomojuStartPaymentForResultContract : + ActivityResultContract() { + + companion object { + const val CONFIGURATION_KEY: String = "KomojuSDK.Configuration" // Key for passing configuration data via Intent. + const val RESULT_KEY: String = "KomojuSDK.PaymentResult" // Key for passing result data via Intent. + } + + /** + * Creates an [Intent] to start the payment activity using the provided configuration. + * Performs pre-checks before starting the activity. + * @param context Context in which the payment activity will be started. + * @param input Configuration used for payment setup. + * @return The [Intent] with necessary data to start the payment activity. + */ + override fun createIntent(context: Context, input: KomojuAndroidSDK.Configuration): Intent { + context.preChecks() // Ensure app scheme is correctly set in resources. + val intent = Intent(context, KomojuPaymentActivity::class.java) + intent.putExtra( + CONFIGURATION_KEY, + input.copy( + redirectURL = "${context.resources.getString(R.string.komoju_consumer_app_scheme)}://", + appScheme = context.resources.getString(R.string.komoju_consumer_app_scheme), + ), + ) + return intent + } + + /** + * Performs pre-checks to ensure that the app scheme is correctly set in strings.xml. + * Throws an error if the scheme is not properly configured. + */ + private fun Context.preChecks() { + if (resources.getString(R.string.komoju_consumer_app_scheme) == "this-should-not-be-the-case") { + error("Please set komoju_consumer_app_scheme in strings.xml with your app scheme") + } + } + + /** + * Parses the result returned by the payment activity. + * This is a placeholder for actual result parsing logic. + * @param resultCode Result code from the activity. + * @param intent The returned [Intent] containing the result data. + * @return [KomojuMobileSDKPaymentResult] indicating whether the payment was successful or not. + */ + override fun parseResult(resultCode: Int, intent: Intent?): KomojuAndroidSDK.PaymentResult = when { + Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU -> intent?.getParcelableExtra( + RESULT_KEY, + KomojuAndroidSDK.PaymentResult::class.java, + ) + else -> + @Suppress("DEPRECATION") + intent?.getParcelableExtra(RESULT_KEY) + } ?: KomojuAndroidSDK.PaymentResult(isSuccessFul = false) +} diff --git a/android/src/main/java/com/komoju/android/sdk/ExperimentalKomojuPaymentApi.kt b/android/src/main/java/com/komoju/android/sdk/annotations/ExperimentalKomojuPaymentApi.kt similarity index 96% rename from android/src/main/java/com/komoju/android/sdk/ExperimentalKomojuPaymentApi.kt rename to android/src/main/java/com/komoju/android/sdk/annotations/ExperimentalKomojuPaymentApi.kt index 3566258..dbb7e6a 100644 --- a/android/src/main/java/com/komoju/android/sdk/ExperimentalKomojuPaymentApi.kt +++ b/android/src/main/java/com/komoju/android/sdk/annotations/ExperimentalKomojuPaymentApi.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk +package com.komoju.android.sdk.annotations /** * Annotation used to mark APIs in the Komoju SDK as experimental. diff --git a/android/src/main/java/com/komoju/android/sdk/types/Currency.kt b/android/src/main/java/com/komoju/android/sdk/types/Currency.kt index 2381b3d..967b712 100644 --- a/android/src/main/java/com/komoju/android/sdk/types/Currency.kt +++ b/android/src/main/java/com/komoju/android/sdk/types/Currency.kt @@ -1,7 +1,5 @@ package com.komoju.android.sdk.types -import java.util.Locale - /** * Enum class representing supported currencies with corresponding ISO 4217 currency codes. * Each currency is associated with a specific locale. @@ -19,18 +17,6 @@ enum class Currency(val currencyCode: String) { USD(currencyCode = "USD"), ; - /** - * Converts the current currency to its corresponding locale. - * - * @return [Locale] for the currency. - * - JPY returns [Locale.JAPAN] - * - USD returns [Locale.US] - */ - fun toLocale(): Locale = when (this) { - JPY -> Locale.JAPAN - USD -> Locale.US - } - companion object { /** * Parses the given language code and returns the corresponding [Currency] enum constant. diff --git a/android/src/main/java/com/komoju/android/sdk/types/Language.kt b/android/src/main/java/com/komoju/android/sdk/types/Language.kt index 3c7528e..e63f6f6 100644 --- a/android/src/main/java/com/komoju/android/sdk/types/Language.kt +++ b/android/src/main/java/com/komoju/android/sdk/types/Language.kt @@ -1,6 +1,6 @@ package com.komoju.android.sdk.types -import java.util.Locale +import androidx.compose.ui.text.intl.Locale /** * Enum class representing supported languages with their respective language codes. @@ -19,17 +19,7 @@ enum class Language(val languageCode: String) { JAPANESE(languageCode = "ja"), ; - /** - * Converts the current language to its corresponding locale. - * - * @return [Locale] for the language. - * - ENGLISH returns [Locale.ENGLISH] - * - JAPANESE returns [Locale.JAPANESE] - */ - internal fun toLocale(): Locale = when (this) { - ENGLISH -> Locale.ENGLISH - JAPANESE -> Locale.JAPANESE - } + override fun toString(): String = languageCode companion object { /** @@ -40,9 +30,11 @@ enum class Language(val languageCode: String) { * - Returns [ENGLISH] for all other cases. */ val default - get() = when (Locale.getDefault().language) { - Locale.JAPANESE.language -> JAPANESE + get() = when (Locale.current.language) { + "ja" -> JAPANESE else -> ENGLISH } + + fun parse(languageCode: String?): Language = entries.find { it.languageCode == languageCode } ?: default } } diff --git a/android/src/main/java/com/komoju/android/sdk/ui/composables/ThemedCircularProgressIndicator.kt b/android/src/main/java/com/komoju/android/sdk/ui/composables/ThemedCircularProgressIndicator.kt deleted file mode 100644 index fa9f26f..0000000 --- a/android/src/main/java/com/komoju/android/sdk/ui/composables/ThemedCircularProgressIndicator.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.komoju.android.sdk.ui.composables - -import androidx.compose.material3.CircularProgressIndicator -import androidx.compose.runtime.Composable -import androidx.compose.ui.graphics.Color -import com.komoju.android.sdk.ui.theme.LocalConfigurableTheme - -@Composable -internal fun ThemedCircularProgressIndicator() { - val configuration = LocalConfigurableTheme.current - CircularProgressIndicator(color = Color(configuration.loaderColor)) -} diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/awating/KonbiniAwaitingPaymentScreenModel.kt b/android/src/main/java/com/komoju/android/sdk/ui/screens/awating/KonbiniAwaitingPaymentScreenModel.kt deleted file mode 100644 index ed76f3b..0000000 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/awating/KonbiniAwaitingPaymentScreenModel.kt +++ /dev/null @@ -1,23 +0,0 @@ -package com.komoju.android.sdk.ui.screens.awating - -import com.komoju.android.sdk.navigation.RouterStateScreenModel -import com.komoju.android.sdk.ui.screens.KomojuPaymentRoute -import com.komoju.android.sdk.ui.screens.Router -import com.komoju.mobile.sdk.entities.Payment - -internal class KonbiniAwaitingPaymentScreenModel(payment: Payment? = null) : - RouterStateScreenModel( - KonbiniAwaitingPaymentUiState(payment), - ) { - - fun onPrimaryButtonClicked() { - when (val payment = state.value.payment) { - is Payment.Konbini -> mutableRouter.value = Router.Push(KomojuPaymentRoute.WebView(payment.instructionURL, canComeBack = true)) - else -> Unit - } - } - - fun onSecondaryButtonClicked() { - mutableRouter.value = Router.Pop - } -} diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/CompatTextField.kt b/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/CompatTextField.kt deleted file mode 100644 index d1f156f..0000000 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/CompatTextField.kt +++ /dev/null @@ -1,104 +0,0 @@ -package com.komoju.android.sdk.ui.screens.payment.composables - -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.foundation.text.KeyboardOptions -import androidx.compose.material3.OutlinedTextField -import androidx.compose.material3.OutlinedTextFieldDefaults -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.text.input.ImeAction -import androidx.compose.ui.text.input.KeyboardCapitalization -import androidx.compose.ui.text.input.KeyboardType -import androidx.compose.ui.text.intl.Locale -import androidx.compose.ui.text.intl.LocaleList -import androidx.compose.ui.unit.dp -import com.komoju.android.sdk.ui.theme.Gray200 -import com.komoju.android.sdk.ui.theme.LocalConfigurableTheme -import com.komoju.android.sdk.ui.theme.Red600 - -@Composable -internal fun CompatTextField( - modifier: Modifier = Modifier, - value: String, - title: String, - placeholder: String, - onValueChange: (String) -> Unit, - error: String? = null, - keyboardType: KeyboardType = KeyboardType.Unspecified, - capitalization: KeyboardCapitalization = KeyboardCapitalization.Unspecified, - keyBoardLocale: Locale = Locale.current, - imeActions: ImeAction = ImeAction.Unspecified, - singleLine: Boolean = false, -) { - val configurableTheme = LocalConfigurableTheme.current - OutlinedTextField( - modifier = modifier, - value = value, - onValueChange = onValueChange, - shape = RoundedCornerShape(8.dp), - label = { - Text(text = title) - }, - placeholder = { - Text(text = placeholder) - }, - isError = error != null, - singleLine = singleLine, - supportingText = { - if (error != null) { - Text(text = error, color = Red600) - } - }, - keyboardOptions = KeyboardOptions( - keyboardType = keyboardType, - capitalization = capitalization, - hintLocales = LocaleList(keyBoardLocale), - imeAction = imeActions, - ), - colors = OutlinedTextFieldDefaults.colors() - .copy( - focusedLabelColor = Color(configurableTheme.primaryButtonColor), - focusedIndicatorColor = Color(configurableTheme.primaryButtonColor), - unfocusedIndicatorColor = Gray200, - ), - ) -// Column { -// Text( -// modifier = Modifier -// .fillMaxWidth() -// .padding(horizontal = 16.dp), -// text = LocalI18nTexts.current[titleKey], -// ) -// Box( -// modifier = Modifier -// .fillMaxWidth() -// .padding(horizontal = 16.dp, vertical = 8.dp) -// .border(1.dp, if (error != null) Red600 else Gray200, shape = RoundedCornerShape(8.dp)) -// .padding(16.dp), -// ) { -// BasicTextField( -// modifier = Modifier.fillMaxWidth(), -// value = value, -// onValueChange = onValueChange, -// textStyle = TextStyle(fontSize = 16.sp, color = Color.Black), -// singleLine = true, -// keyboardOptions = KeyboardOptions(keyboardType = keyboardType, capitalization = capitalization), -// ) -// if (value.isEmpty()) { -// Text( -// text = LocalI18nTexts.current[placeholderKey], -// style = TextStyle(fontSize = 16.sp, color = Gray500), -// ) -// } -// } -// Text( -// modifier = Modifier -// .fillMaxWidth() -// .padding(horizontal = 16.dp), -// text = LocalI18nTexts.current[error.orEmpty()], -// style = TextStyle(fontSize = 16.sp, color = Red600), -// ) -// } -} diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/CreditCardSchemeIcons.kt b/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/CreditCardSchemeIcons.kt deleted file mode 100644 index 7819ac6..0000000 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/CreditCardSchemeIcons.kt +++ /dev/null @@ -1,50 +0,0 @@ -package com.komoju.android.sdk.ui.screens.payment.composables - -import androidx.compose.animation.AnimatedVisibility -import androidx.compose.foundation.Image -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.width -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.dp -import com.komoju.android.sdk.R -import com.komoju.android.sdk.utils.CardScheme - -@Composable -internal fun CreditCardSchemeIcons(cardScheme: CardScheme) { - Row { - AnimatedVisibility(visible = cardScheme == CardScheme.UNKNOWN) { - Row { - Image(painter = painterResource(id = R.drawable.komoju_ic_visa), contentDescription = "visa_icon") - Spacer(Modifier.width(8.dp)) - Image(painter = painterResource(id = R.drawable.komoju_ic_master), contentDescription = "mastercard_icon") - Spacer(Modifier.width(8.dp)) - Image(painter = painterResource(id = R.drawable.komoju_ic_amex), contentDescription = "amex_icon") - } - } - AnimatedVisibility(visible = cardScheme == CardScheme.VISA) { - Image(painter = painterResource(id = R.drawable.komoju_ic_visa), contentDescription = "visa_icon") - } - AnimatedVisibility(visible = cardScheme == CardScheme.MASTERCARD) { - Image(painter = painterResource(id = R.drawable.komoju_ic_master), contentDescription = "mastercard_icon") - } - AnimatedVisibility(visible = cardScheme == CardScheme.AMEX) { - Image(painter = painterResource(id = R.drawable.komoju_ic_amex), contentDescription = "amex_icon") - } - AnimatedVisibility(visible = cardScheme == CardScheme.DINERS_CLUB) { - Image(painter = painterResource(id = R.drawable.komoju_ic_diners), contentDescription = "diners_icon") - } - AnimatedVisibility(visible = cardScheme == CardScheme.JCB) { - Image(painter = painterResource(id = R.drawable.komoju_ic_jcb), contentDescription = "jcb_icon") - } - } -} - -@Composable -@Preview -private fun CreditCardSchemeIconsPreview() { - CreditCardSchemeIcons(CardScheme.UNKNOWN) -} diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/webview/WebChromeClient.kt b/android/src/main/java/com/komoju/android/sdk/ui/screens/webview/WebChromeClient.kt deleted file mode 100644 index b3206b6..0000000 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/webview/WebChromeClient.kt +++ /dev/null @@ -1,8 +0,0 @@ -package com.komoju.android.sdk.ui.screens.webview - -import android.webkit.ConsoleMessage -import com.kevinnzou.web.AccompanistWebChromeClient - -internal class WebChromeClient : AccompanistWebChromeClient() { - override fun onConsoleMessage(consoleMessage: ConsoleMessage): Boolean = true -} diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/webview/WebViewClient.kt b/android/src/main/java/com/komoju/android/sdk/ui/screens/webview/WebViewClient.kt deleted file mode 100644 index e41a27a..0000000 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/webview/WebViewClient.kt +++ /dev/null @@ -1,52 +0,0 @@ -package com.komoju.android.sdk.ui.screens.webview - -import android.content.Context -import android.content.Intent -import android.net.Uri -import android.webkit.WebResourceRequest -import android.webkit.WebView -import androidx.core.app.ActivityOptionsCompat -import androidx.core.content.ContextCompat.startActivity -import androidx.core.net.toUri -import com.kevinnzou.web.AccompanistWebViewClient -import com.komoju.android.sdk.KomojuPaymentActivity -import com.komoju.android.sdk.R - -internal class WebViewClient : AccompanistWebViewClient() { - - @Deprecated("Deprecated in Java") - override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean = view.checkAndOpen(url) - override fun shouldOverrideUrlLoading(view: WebView, request: WebResourceRequest): Boolean = view.checkAndOpen(request.url.toString()) - - private fun WebView.checkAndOpen(url: String): Boolean { - try { - val uri = url.toUri() - val handled = uri.handle(context) - if (handled.not()) { - error("Unsupported scheme for deeplink, load in webView Instead.") - } else { - return handled - } - } catch (_: Exception) { - loadUrl(url) - return false - } - } -} - -private fun Uri.handle(context: Context): Boolean = openKomojuSDKIfAvailable(context) - -private fun Uri.openKomojuSDKIfAvailable(context: Context): Boolean { - if (scheme == context.resources.getString(R.string.komoju_consumer_app_scheme)) { - startActivity( - context, - Intent(context, KomojuPaymentActivity::class.java).apply { - data = this@openKomojuSDKIfAvailable - }, - ActivityOptionsCompat.makeBasic().toBundle(), - ) - return true - } else { - return false - } -} diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/webview/WebViewScreenModel.kt b/android/src/main/java/com/komoju/android/sdk/ui/screens/webview/WebViewScreenModel.kt deleted file mode 100644 index 4e62610..0000000 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/webview/WebViewScreenModel.kt +++ /dev/null @@ -1,10 +0,0 @@ -package com.komoju.android.sdk.ui.screens.webview - -import com.komoju.android.sdk.navigation.RouterStateScreenModel - -internal class WebViewScreenModel : RouterStateScreenModel(Unit) { - - fun onBackPressed() { - mutableRouter.pop() - } -} diff --git a/android/src/main/java/com/komoju/android/sdk/ui/theme/ConfigurableTheme.kt b/android/src/main/java/com/komoju/android/sdk/ui/theme/ConfigurableTheme.kt deleted file mode 100644 index 864953d..0000000 --- a/android/src/main/java/com/komoju/android/sdk/ui/theme/ConfigurableTheme.kt +++ /dev/null @@ -1,70 +0,0 @@ -package com.komoju.android.sdk.ui.theme - -import android.graphics.Color -import android.os.Parcelable -import androidx.annotation.ColorInt -import kotlinx.parcelize.Parcelize - -/** - * Interface representing a configurable theme with customizable UI properties. - * This interface extends [Parcelable], allowing themes to be passed between Android components. - */ -interface ConfigurableTheme : Parcelable { - - /** - * Color value for the primary button background. - * - * @return An integer representing a color value annotated with [ColorInt]. - */ - @get:ColorInt - val primaryButtonColor: Int - - /** - * Color value for the content (e.g., text or icon) inside the primary button. - * - * @return An integer representing a color value annotated with [ColorInt]. - */ - @get:ColorInt - val primaryButtonContentColor: Int - - /** - * Corner radius for the primary button in density-independent pixels (DP). - * - * @return An integer representing the corner radius in DP annotated with [ColorInt]. - */ - @get:ColorInt - val primaryButtonCornerRadiusInDP: Int - - /** - * Color value for the loader/spinner. - * - * @return An integer representing a color value annotated with [ColorInt]. - */ - @get:ColorInt - val loaderColor: Int - - companion object { - /** - * Provides a default implementation of the [ConfigurableTheme]. - */ - val default = DefaultConfigurableTheme() - } -} - -/** - * Data class representing the default implementation of [ConfigurableTheme]. - * This class uses default values for UI elements such as buttons and loaders. - * It is annotated with [Parcelize] to allow it to be passed between Android components. - * - * @param primaryButtonColor The background color of the primary button. - * @param primaryButtonContentColor The color of the content inside the primary button. - * @param primaryButtonCornerRadiusInDP The corner radius of the primary button in DP. - * @param loaderColor The color of the loader/spinner. - */ -@Parcelize -data class DefaultConfigurableTheme( - override val primaryButtonColor: Int = Color.parseColor("#FF297FE7"), // Default blue color for primary button. - override val primaryButtonContentColor: Int = Color.WHITE, // Default white color for primary button content. - override val primaryButtonCornerRadiusInDP: Int = 8, // Default corner radius of 8 DP for primary button. - override val loaderColor: Int = Color.parseColor("#FF3CC239"), // Default green color for loader. -) : ConfigurableTheme diff --git a/android/src/main/java/com/komoju/android/sdk/ui/theme/Theme.kt b/android/src/main/java/com/komoju/android/sdk/ui/theme/Theme.kt deleted file mode 100644 index e204735..0000000 --- a/android/src/main/java/com/komoju/android/sdk/ui/theme/Theme.kt +++ /dev/null @@ -1,45 +0,0 @@ -package com.komoju.android.sdk.ui.theme - -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Surface -import androidx.compose.material3.lightColorScheme -import androidx.compose.runtime.Composable -import androidx.compose.runtime.CompositionLocalProvider -import androidx.compose.runtime.compositionLocalOf -import androidx.compose.ui.graphics.Color -import com.komoju.android.sdk.KomojuSDK - -internal val KomojuLightGreen = Color(0xFF3CC239) -internal val KomojuDarkGreen = Color(0xFF172E44) -internal val Gray50 = Color(0xFFF6F7F9) -internal val Gray200 = Color(0xFFD7DCE0) -internal val Gray500 = Color(0xFF6D7D88) -internal val Gray700 = Color(0xFF45535E) -internal val Red600 = Color(0xFFF04438) - -internal val LocalConfigurableTheme = compositionLocalOf { - error("Use KomojuMobileSdkTheme to provide ConfigurableTheme") -} - -private val LightColorScheme = lightColorScheme( - primary = KomojuLightGreen, - secondary = KomojuDarkGreen, - tertiary = KomojuLightGreen, - background = Color.White, - surfaceContainer = Color.White, -) - -@Composable -internal fun KomojuMobileSdkTheme(configuration: KomojuSDK.Configuration = EmptyConfiguration, content: @Composable () -> Unit) { - CompositionLocalProvider(LocalConfigurableTheme provides configuration.configurableTheme) { - Surface(color = Color.White) { - MaterialTheme( - colorScheme = LightColorScheme, - content = content, - typography = interTypography(), - ) - } - } -} - -private val EmptyConfiguration = KomojuSDK.Configuration.Builder("", "").build() diff --git a/android/src/main/java/com/komoju/android/sdk/ui/theme/Typography.kt b/android/src/main/java/com/komoju/android/sdk/ui/theme/Typography.kt deleted file mode 100644 index 582825c..0000000 --- a/android/src/main/java/com/komoju/android/sdk/ui/theme/Typography.kt +++ /dev/null @@ -1,39 +0,0 @@ -package com.komoju.android.sdk.ui.theme - -import androidx.compose.material3.Typography -import androidx.compose.runtime.Composable -import androidx.compose.ui.text.font.Font -import androidx.compose.ui.text.font.FontFamily -import androidx.compose.ui.text.font.FontWeight -import com.komoju.android.sdk.R - -@Composable -private fun interFontFamily() = FontFamily( - Font(R.font.komoju_font_inter_light, weight = FontWeight.Light), - Font(R.font.komoju_font_inter_regular, weight = FontWeight.Normal), - Font(R.font.komoju_font_inter_medium, weight = FontWeight.Medium), - Font(R.font.komoju_font_inter_semibold, weight = FontWeight.SemiBold), - Font(R.font.komoju_font_inter_bold, weight = FontWeight.Bold), -) - -@Composable -internal fun interTypography() = Typography().run { - val fontFamily = interFontFamily() - copy( - displayLarge = displayLarge.copy(fontFamily = fontFamily), - displayMedium = displayMedium.copy(fontFamily = fontFamily), - displaySmall = displaySmall.copy(fontFamily = fontFamily), - headlineLarge = headlineLarge.copy(fontFamily = fontFamily), - headlineMedium = headlineMedium.copy(fontFamily = fontFamily), - headlineSmall = headlineSmall.copy(fontFamily = fontFamily), - titleLarge = titleLarge.copy(fontFamily = fontFamily), - titleMedium = titleMedium.copy(fontFamily = fontFamily), - titleSmall = titleSmall.copy(fontFamily = fontFamily), - bodyLarge = bodyLarge.copy(fontFamily = fontFamily), - bodyMedium = bodyMedium.copy(fontFamily = fontFamily), - bodySmall = bodySmall.copy(fontFamily = fontFamily), - labelLarge = labelLarge.copy(fontFamily = fontFamily), - labelMedium = labelMedium.copy(fontFamily = fontFamily), - labelSmall = labelSmall.copy(fontFamily = fontFamily), - ) -} diff --git a/android/src/main/java/com/komoju/android/sdk/utils/AmountUtils.kt b/android/src/main/java/com/komoju/android/sdk/utils/AmountUtils.kt deleted file mode 100644 index 1d542bb..0000000 --- a/android/src/main/java/com/komoju/android/sdk/utils/AmountUtils.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.komoju.android.sdk.utils - -import android.icu.text.NumberFormat -import android.icu.util.Currency as PlatformCurrency -import com.komoju.android.sdk.types.Currency - -internal object AmountUtils { - fun formatToDecimal(currency: Currency, amount: String): String { - if (amount.isBlank()) return "" - val locale = currency.toLocale() - return NumberFormat.getCurrencyInstance(locale).apply { - this.maximumFractionDigits = 0 - this.minimumFractionDigits = 0 - this.currency = PlatformCurrency.getInstance(locale) - }.format(amount.toDouble()) - } -} diff --git a/android/src/main/java/com/komoju/android/sdk/utils/PreviewScreen.kt b/android/src/main/java/com/komoju/android/sdk/utils/PreviewScreen.kt deleted file mode 100644 index 3777cd2..0000000 --- a/android/src/main/java/com/komoju/android/sdk/utils/PreviewScreen.kt +++ /dev/null @@ -1,14 +0,0 @@ -package com.komoju.android.sdk.utils - -import androidx.compose.runtime.Composable -import cafe.adriel.voyager.core.screen.Screen - -/** - * An Empty Screen to Support Android Studio Previews - */ -internal object PreviewScreen : Screen { - private fun readResolve(): Any = PreviewScreen - - @Composable - override fun Content() = Unit -} diff --git a/android/src/main/java/com/komoju/android/sdk/utils/StringExt.kt b/android/src/main/java/com/komoju/android/sdk/utils/StringExt.kt deleted file mode 100644 index b431528..0000000 --- a/android/src/main/java/com/komoju/android/sdk/utils/StringExt.kt +++ /dev/null @@ -1,11 +0,0 @@ -package com.komoju.android.sdk.utils - -private val EMAIL_REGEX = "^[A-Za-z0-9+_.-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}$".toRegex() - -internal inline val String.Companion.empty get() = "" - -internal inline val String.isValidEmail: Boolean get() = matches(EMAIL_REGEX) - -internal inline val String.isKatakanaOnly: Boolean get() = all { it.isKatakana } - -internal inline val Char.isKatakana get() = Character.UnicodeBlock.of(this) == Character.UnicodeBlock.KATAKANA diff --git a/android/src/main/res/drawable/komoju_ic_alipay.xml b/android/src/main/res/drawable/komoju_ic_alipay.xml deleted file mode 100644 index 9d20633..0000000 --- a/android/src/main/res/drawable/komoju_ic_alipay.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/android/src/main/res/drawable/komoju_ic_amex.xml b/android/src/main/res/drawable/komoju_ic_amex.xml deleted file mode 100644 index 0bbbfcc..0000000 --- a/android/src/main/res/drawable/komoju_ic_amex.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_app_opens_info.xml b/android/src/main/res/drawable/komoju_ic_app_opens_info.xml deleted file mode 100644 index 95b5851..0000000 --- a/android/src/main/res/drawable/komoju_ic_app_opens_info.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_au_pay.xml b/android/src/main/res/drawable/komoju_ic_au_pay.xml deleted file mode 100644 index 3ee368f..0000000 --- a/android/src/main/res/drawable/komoju_ic_au_pay.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/android/src/main/res/drawable/komoju_ic_bank_transfer.xml b/android/src/main/res/drawable/komoju_ic_bank_transfer.xml deleted file mode 100644 index 39ef205..0000000 --- a/android/src/main/res/drawable/komoju_ic_bank_transfer.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/android/src/main/res/drawable/komoju_ic_bitcash.xml b/android/src/main/res/drawable/komoju_ic_bitcash.xml deleted file mode 100644 index ac13afd..0000000 --- a/android/src/main/res/drawable/komoju_ic_bitcash.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_credit_card.xml b/android/src/main/res/drawable/komoju_ic_credit_card.xml deleted file mode 100644 index e031440..0000000 --- a/android/src/main/res/drawable/komoju_ic_credit_card.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - diff --git a/android/src/main/res/drawable/komoju_ic_cvv.xml b/android/src/main/res/drawable/komoju_ic_cvv.xml deleted file mode 100644 index 5882e99..0000000 --- a/android/src/main/res/drawable/komoju_ic_cvv.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_daily_yamazaki.xml b/android/src/main/res/drawable/komoju_ic_daily_yamazaki.xml deleted file mode 100644 index f3835e0..0000000 --- a/android/src/main/res/drawable/komoju_ic_daily_yamazaki.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_diners.xml b/android/src/main/res/drawable/komoju_ic_diners.xml deleted file mode 100644 index 5f9edaa..0000000 --- a/android/src/main/res/drawable/komoju_ic_diners.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_family_mart.xml b/android/src/main/res/drawable/komoju_ic_family_mart.xml deleted file mode 100644 index 69cb4d5..0000000 --- a/android/src/main/res/drawable/komoju_ic_family_mart.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_jcb.xml b/android/src/main/res/drawable/komoju_ic_jcb.xml deleted file mode 100644 index 7c68f03..0000000 --- a/android/src/main/res/drawable/komoju_ic_jcb.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_konbini.xml b/android/src/main/res/drawable/komoju_ic_konbini.xml deleted file mode 100644 index a48aa8f..0000000 --- a/android/src/main/res/drawable/komoju_ic_konbini.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_lawson.xml b/android/src/main/res/drawable/komoju_ic_lawson.xml deleted file mode 100644 index bf59d13..0000000 --- a/android/src/main/res/drawable/komoju_ic_lawson.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_linepay.xml b/android/src/main/res/drawable/komoju_ic_linepay.xml deleted file mode 100644 index 4526151..0000000 --- a/android/src/main/res/drawable/komoju_ic_linepay.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - \ No newline at end of file diff --git a/android/src/main/res/drawable/komoju_ic_master.xml b/android/src/main/res/drawable/komoju_ic_master.xml deleted file mode 100644 index 0108c5e..0000000 --- a/android/src/main/res/drawable/komoju_ic_master.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_merpay.xml b/android/src/main/res/drawable/komoju_ic_merpay.xml deleted file mode 100644 index 708c343..0000000 --- a/android/src/main/res/drawable/komoju_ic_merpay.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_ministop.xml b/android/src/main/res/drawable/komoju_ic_ministop.xml deleted file mode 100644 index 2862eeb..0000000 --- a/android/src/main/res/drawable/komoju_ic_ministop.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_net_cash.xml b/android/src/main/res/drawable/komoju_ic_net_cash.xml deleted file mode 100644 index bcab96a..0000000 --- a/android/src/main/res/drawable/komoju_ic_net_cash.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_paidy.xml b/android/src/main/res/drawable/komoju_ic_paidy.xml deleted file mode 100644 index 98be004..0000000 --- a/android/src/main/res/drawable/komoju_ic_paidy.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_pay_easy.xml b/android/src/main/res/drawable/komoju_ic_pay_easy.xml deleted file mode 100644 index d3a4a03..0000000 --- a/android/src/main/res/drawable/komoju_ic_pay_easy.xml +++ /dev/null @@ -1,137 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_payment_status_completed.xml b/android/src/main/res/drawable/komoju_ic_payment_status_completed.xml deleted file mode 100644 index f320a46..0000000 --- a/android/src/main/res/drawable/komoju_ic_payment_status_completed.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/android/src/main/res/drawable/komoju_ic_payment_status_failed.xml b/android/src/main/res/drawable/komoju_ic_payment_status_failed.xml deleted file mode 100644 index c888d57..0000000 --- a/android/src/main/res/drawable/komoju_ic_payment_status_failed.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/android/src/main/res/drawable/komoju_ic_payment_status_konbini_pending.xml b/android/src/main/res/drawable/komoju_ic_payment_status_konbini_pending.xml deleted file mode 100644 index a842789..0000000 --- a/android/src/main/res/drawable/komoju_ic_payment_status_konbini_pending.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_payment_status_prenidng.xml b/android/src/main/res/drawable/komoju_ic_payment_status_prenidng.xml deleted file mode 100644 index 30a955a..0000000 --- a/android/src/main/res/drawable/komoju_ic_payment_status_prenidng.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_paypay.xml b/android/src/main/res/drawable/komoju_ic_paypay.xml deleted file mode 100644 index 748f4d6..0000000 --- a/android/src/main/res/drawable/komoju_ic_paypay.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/android/src/main/res/drawable/komoju_ic_rakuten_pay.xml b/android/src/main/res/drawable/komoju_ic_rakuten_pay.xml deleted file mode 100644 index 979e8e5..0000000 --- a/android/src/main/res/drawable/komoju_ic_rakuten_pay.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/android/src/main/res/drawable/komoju_ic_seico_mart.xml b/android/src/main/res/drawable/komoju_ic_seico_mart.xml deleted file mode 100644 index 4e63e2b..0000000 --- a/android/src/main/res/drawable/komoju_ic_seico_mart.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_seven_eleven.xml b/android/src/main/res/drawable/komoju_ic_seven_eleven.xml deleted file mode 100644 index dd4de8d..0000000 --- a/android/src/main/res/drawable/komoju_ic_seven_eleven.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_visa.xml b/android/src/main/res/drawable/komoju_ic_visa.xml deleted file mode 100644 index 08ac4de..0000000 --- a/android/src/main/res/drawable/komoju_ic_visa.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - diff --git a/android/src/main/res/drawable/komoju_ic_web_money.xml b/android/src/main/res/drawable/komoju_ic_web_money.xml deleted file mode 100644 index 911b9c0..0000000 --- a/android/src/main/res/drawable/komoju_ic_web_money.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/android/src/main/res/drawable/komoju_img_payment_footer.xml b/android/src/main/res/drawable/komoju_img_payment_footer.xml deleted file mode 100644 index 2a4c309..0000000 --- a/android/src/main/res/drawable/komoju_img_payment_footer.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/android/src/main/res/font/komoju_font_inter_bold.ttf b/android/src/main/res/font/komoju_font_inter_bold.ttf deleted file mode 100644 index cd13f60..0000000 Binary files a/android/src/main/res/font/komoju_font_inter_bold.ttf and /dev/null differ diff --git a/android/src/main/res/font/komoju_font_inter_light.ttf b/android/src/main/res/font/komoju_font_inter_light.ttf deleted file mode 100644 index acae361..0000000 Binary files a/android/src/main/res/font/komoju_font_inter_light.ttf and /dev/null differ diff --git a/android/src/main/res/font/komoju_font_inter_medium.ttf b/android/src/main/res/font/komoju_font_inter_medium.ttf deleted file mode 100644 index 71d9017..0000000 Binary files a/android/src/main/res/font/komoju_font_inter_medium.ttf and /dev/null differ diff --git a/android/src/main/res/font/komoju_font_inter_regular.ttf b/android/src/main/res/font/komoju_font_inter_regular.ttf deleted file mode 100644 index ce097c8..0000000 Binary files a/android/src/main/res/font/komoju_font_inter_regular.ttf and /dev/null differ diff --git a/android/src/main/res/font/komoju_font_inter_semibold.ttf b/android/src/main/res/font/komoju_font_inter_semibold.ttf deleted file mode 100644 index 053185e..0000000 Binary files a/android/src/main/res/font/komoju_font_inter_semibold.ttf and /dev/null differ diff --git a/android/src/main/res/values-ja/strings.xml b/android/src/main/res/values-ja/strings.xml deleted file mode 100644 index c78f8ea..0000000 --- a/android/src/main/res/values-ja/strings.xml +++ /dev/null @@ -1,120 +0,0 @@ - - - 入力したカード所有者名は空欄にできません - 入力したカード所有者名は無効です - 入力したカード番号は無効です - 入力した有効期限は無効です - 入力した CVV は無効です - 支払いは成功しました - 支払いは失敗しました - 支払いを待機しています - 支払いは正常に処理されました。 - 支払いは失敗しました。 - 続行するには、お近くの %1$s に行って支払いを行う必要があります。 - 支払いは処理を待機しています。 - エラー - 領収書番号 - 確認コード - 完了 - お支払い方法を更新 - 手順を表示 - 了解 - ご質問がありますか? お問い合わせください - 後で行います - お支払い処理がキャンセルされたことがわかりました。これが間違いだった場合は、もう一度試して購入を完了してください。 - お支払いの処理を試みましたが、問題が発生しました。続行するには、以下のお支払い方法を更新してください。 - カードへの請求を試みましたが、問題が発生しました。続行するには、以下のお支払い方法を更新してください - ストアに戻る - お支払いオプション - %1$s を支払う - カード所有者名 - TARO YAMADA - カード番号 - MM/YY - CVV - 今後のお支払いのためにこのカードを保存する - デイリーヤマザキ - ファミリーマート - ローソン - ミニストップ - セイコーマート - セブンイレブン - レシートのフルネーム - 名前(カードに記載)領収書) - メール - メールアドレスを入力してください - NET CASH 情報 - NET CASH ID - Alipay での支払い - AU Pay での支払い - Mer Pay での支払い - Paypay での支払い - Rakuten Pay での支払い - Line Pay での支払い - 支払いを完了するには、Alipay にリダイレクトされます - 支払いを完了するには、AU Pay にリダイレクトされます - 支払いを完了するには、Mer Pay にリダイレクトされます - 支払いを完了するには、Paypay にリダイレクトされます - 支払いを完了するには、Rakuten にリダイレクトされますお支払い - お支払いを完了するには、Line Pay にリダイレクトされます - Alipay に進みます - AuPay に進みます - MerPay に進みます - PayPay に進みます - Rakuten に進みます - LinePay に進みます - Paidy に進みます - 注: Web ウィンドウが開きます。購入後、元のウィンドウに戻ります。 - 氏名 - お名前を入力してください - 電話番号 - 電話番号を入力してください - - - 姓(フリガナ) - 名(フリガナ) - WebMoney情報 - プリペイド番号 - お支払い完了 - ご注文ありがとうございます - BitCash情報 - ひらがなID - 銀行振込 - BitCash - カード - コンビニ - NetCash - au Pay - AliPay - メルペイ - PayPay - 楽天ペイ - Line Pay - 不明 - その他 - Paidy - PayEasy - WebMoney - 合計支払額 - 入力した名前は空欄にできません - 入力したメールアドレスは無効です - コンビニのブランドを選択してください - 入力した電話番号は空欄にできません - 入力した電話番号は無効です - 入力したネットキャッシュIDは空欄にできません - 入力したネットキャッシュIDは無効です - 入力したビットキャッシュIDは空欄にできません - 入力したビットキャッシュIDは無効です - 入力したプリペイド番号は空欄にできません - 入力したプリペイド番号は無効です - 入力した姓は空欄にできません - 入力した名字は空欄にできません - 入力した名のフリガナは空 - 入力したファーストネームの読みはカナでなければなりません - 入力したラストネームの読みは空にできません - 入力したラストネームの読みはカナでなければなりません - はい - いいえ - 支払いをキャンセルしてもよろしいですか? - 支払いをキャンセルしますか? - \ No newline at end of file diff --git a/android/src/main/res/values/strings.xml b/android/src/main/res/values/strings.xml index 2bd2a0f..333e094 100644 --- a/android/src/main/res/values/strings.xml +++ b/android/src/main/res/values/strings.xml @@ -1,121 +1,4 @@ this-should-not-be-the-case - The entered cardholder name cannot be empty - The entered cardholder name is not valid - The entered card number is not valid - The entered expiry date is not valid - The entered CVV is not valid - Payment successful - Payment failed - Awaiting payment - Your payment has been processed successfully. - Your payment has failed. - You need to go to your local %1$s and make the payment to proceed. - Your payment is awaiting processing. - Error - Receipt Number - Confirmation Code - Done - Update Payment method - View instructions - Okay - Have a question? Contact us - I will do it later - We noticed that you’ve canceled the payment process. If this was a mistake, you can try again to complete your purchase. - We attempted to process your payment, but something went wrong. Please update your payment method below to continue. - We tried to charge your card but, something went wrong. Please update your payment method below to continue - Back to store - Payment Options - Pay %1$s - Cardholder name - Full name on card - Card Number - MM/YY - CVV - Save this card for future payments - Daily Yamazaki - Family Mart - Lawson - MiniStop - SeicoMart - 7-Eleven - Full name on receipt - Name (shown on receipt) - Email - Enter Your Email Address - NET CASH Information - NET CASH id - Payment via Alipay - Payment via AU Pay - Payment via Mer Pay - Payment via Paypay - Payment via Rakuten Pay - Payment via Line Pay - You will be redirected to Alipay to complete the payment - You will be redirected to AU Pay to complete the payment - You will be redirected to Mer Pay to complete the payment - You will be redirected to Paypay to complete the payment - You will be redirected to Rakuten to complete the payment - You will be redirected to Line Pay to complete the payment - Continue to Alipay - Continue to AuPay - Continue to MerPay - Continue to PayPay - Continue to Rakuten - Continue to LinePay - Continue to Paidy - Note, a web window will be opened. After purchase you will be redirected back. - Full Name - Enter your name - Phone Number - Enter your phone number - Last Name - First Name - Last Name (Phonetic) - First Name (Phonetic) - WebMoney Information - Prepaid number - Payment Success - Thank you for your order - BitCash Information - Hiragana id - Bank Transfer - BitCash - Credit card - Konbini - NetCash - au Pay - AliPay - Mer Pay - PayPay - Rakuten Pay - Line Pay - Unknown - Other - Paidy - PayEasy - WebMoney - Total Payment - The entered name cannot be empty - The entered email is not valid - Please select a konbini brand - The entered phone number cannot be empty - The entered phone number is not valid - The entered net cash id cannot be empty - The entered net cash id is not valid - The entered bit cash id cannot be empty - The entered bit cash id is not valid - The entered prepaid number cannot be empty - The entered prepaid number is not valid - The entered last name cannot be empty - The entered first name cannot be empty - The entered first name phonetic cannot be empty - The entered first name phonetic must be a kana - The entered last name phonetic cannot be empty - The entered last name phonetic must be a kana - Yes - No - Are you sure you want to cancel the payment? - Cancel Payment? \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index be9076a..bfcc503 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,4 +10,5 @@ plugins { alias(libs.plugins.kotlin.parcelize) apply false alias(libs.plugins.jetbrains.kotlin.jvm) apply false alias(libs.plugins.jetbrains.dokka) apply false + alias(libs.plugins.composeMultiplatform) apply false } diff --git a/example-android/build.gradle.kts b/example-android/build.gradle.kts index 0a03c2b..6e34cda 100644 --- a/example-android/build.gradle.kts +++ b/example-android/build.gradle.kts @@ -14,7 +14,7 @@ val localProperties = Properties().apply { android { namespace = "com.komoju.android" - compileSdk = 34 + compileSdk = 35 defaultConfig { minSdk = 24 diff --git a/example-android/src/main/java/com/komoju/android/ui/remote/RemoteApiService.kt b/example-android/src/main/java/com/komoju/android/remote/RemoteApiService.kt similarity index 78% rename from example-android/src/main/java/com/komoju/android/ui/remote/RemoteApiService.kt rename to example-android/src/main/java/com/komoju/android/remote/RemoteApiService.kt index 2c09531..e14557a 100644 --- a/example-android/src/main/java/com/komoju/android/ui/remote/RemoteApiService.kt +++ b/example-android/src/main/java/com/komoju/android/remote/RemoteApiService.kt @@ -1,14 +1,13 @@ -package com.komoju.android.ui.remote +package com.komoju.android.remote import com.komoju.android.BuildConfig -import com.komoju.android.ui.remote.dtos.CreateSessionRequest -import com.komoju.android.ui.remote.dtos.CreateSessionResponse -import com.komoju.android.ui.remote.dtos.PublishableKeyResponse +import com.komoju.android.remote.dtos.CreateSessionRequest +import com.komoju.android.remote.dtos.CreateSessionResponse +import com.komoju.android.remote.dtos.PublishableKeyResponse import java.util.concurrent.TimeUnit import okhttp3.OkHttpClient import retrofit2.Response import retrofit2.Retrofit -import retrofit2.converter.gson.GsonConverterFactory import retrofit2.http.Body import retrofit2.http.GET import retrofit2.http.Headers @@ -31,7 +30,7 @@ interface RemoteApiService { .readTimeout(100, TimeUnit.SECONDS) // Set the read timeout to 100 seconds because the glitch server is slow .build(), ) - .addConverterFactory(GsonConverterFactory.create()) + .addConverterFactory(retrofit2.converter.gson.GsonConverterFactory.create()) .baseUrl(BuildConfig.SERVER_URL) .build() .create(RemoteApiService::class.java) diff --git a/example-android/src/main/java/com/komoju/android/ui/remote/dtos/CreateSessionRequest.kt b/example-android/src/main/java/com/komoju/android/remote/dtos/CreateSessionRequest.kt similarity index 85% rename from example-android/src/main/java/com/komoju/android/ui/remote/dtos/CreateSessionRequest.kt rename to example-android/src/main/java/com/komoju/android/remote/dtos/CreateSessionRequest.kt index 12e0f3b..2f07cc2 100644 --- a/example-android/src/main/java/com/komoju/android/ui/remote/dtos/CreateSessionRequest.kt +++ b/example-android/src/main/java/com/komoju/android/remote/dtos/CreateSessionRequest.kt @@ -1,4 +1,4 @@ -package com.komoju.android.ui.remote.dtos +package com.komoju.android.remote.dtos import com.google.gson.annotations.SerializedName diff --git a/example-android/src/main/java/com/komoju/android/ui/remote/dtos/CreateSessionResponse.kt b/example-android/src/main/java/com/komoju/android/remote/dtos/CreateSessionResponse.kt similarity index 77% rename from example-android/src/main/java/com/komoju/android/ui/remote/dtos/CreateSessionResponse.kt rename to example-android/src/main/java/com/komoju/android/remote/dtos/CreateSessionResponse.kt index 6b7a983..4fba145 100644 --- a/example-android/src/main/java/com/komoju/android/ui/remote/dtos/CreateSessionResponse.kt +++ b/example-android/src/main/java/com/komoju/android/remote/dtos/CreateSessionResponse.kt @@ -1,4 +1,4 @@ -package com.komoju.android.ui.remote.dtos +package com.komoju.android.remote.dtos import com.google.gson.annotations.SerializedName diff --git a/example-android/src/main/java/com/komoju/android/ui/remote/dtos/PublishableKeyResponse.kt b/example-android/src/main/java/com/komoju/android/remote/dtos/PublishableKeyResponse.kt similarity index 79% rename from example-android/src/main/java/com/komoju/android/ui/remote/dtos/PublishableKeyResponse.kt rename to example-android/src/main/java/com/komoju/android/remote/dtos/PublishableKeyResponse.kt index 44535d5..94d91d4 100644 --- a/example-android/src/main/java/com/komoju/android/ui/remote/dtos/PublishableKeyResponse.kt +++ b/example-android/src/main/java/com/komoju/android/remote/dtos/PublishableKeyResponse.kt @@ -1,4 +1,4 @@ -package com.komoju.android.ui.remote.dtos +package com.komoju.android.remote.dtos import com.google.gson.annotations.SerializedName diff --git a/example-android/src/main/java/com/komoju/android/ui/screens/store/FakeItemDetailScreen.kt b/example-android/src/main/java/com/komoju/android/ui/screens/store/FakeItemDetailScreen.kt index b947bc6..c0b83e2 100644 --- a/example-android/src/main/java/com/komoju/android/ui/screens/store/FakeItemDetailScreen.kt +++ b/example-android/src/main/java/com/komoju/android/ui/screens/store/FakeItemDetailScreen.kt @@ -46,7 +46,7 @@ import cafe.adriel.voyager.core.screen.Screen import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.currentOrThrow import com.komoju.android.R -import com.komoju.android.sdk.KomojuSDK +import com.komoju.android.sdk.KomojuAndroidSDK import com.komoju.android.sdk.canProcessPayment import com.komoju.android.ui.theme.KomojuDarkGreen @@ -60,7 +60,7 @@ data class FakeItemDetailScreen(private val index: Int) : Screen { val uiState by screenModel.uiState.collectAsStateWithLifecycle() val item by remember { derivedStateOf { uiState.items[index] } } val komojuSDKConfiguration by screenModel.komojuSDKConfiguration.collectAsStateWithLifecycle() - val komojuPaymentLauncher = rememberLauncherForActivityResult(KomojuSDK.KomojuPaymentResultContract) { + val komojuPaymentLauncher = rememberLauncherForActivityResult(KomojuAndroidSDK.activityResultContract) { screenModel.onKomojuPaymentCompleted() navigator.push(if (it.isSuccessFul) FakeOrderSuccessScreen() else FakeOrderFailedScreen()) } diff --git a/example-android/src/main/java/com/komoju/android/ui/screens/store/FakeOrderFailedScreen.kt b/example-android/src/main/java/com/komoju/android/ui/screens/store/FakeOrderFailedScreen.kt index 1048642..e24349e 100644 --- a/example-android/src/main/java/com/komoju/android/ui/screens/store/FakeOrderFailedScreen.kt +++ b/example-android/src/main/java/com/komoju/android/ui/screens/store/FakeOrderFailedScreen.kt @@ -55,10 +55,10 @@ private fun FakeOrderFailedScreenContent() { contentDescription = null, ) - Text("Payment Failed", fontSize = 24.sp, fontWeight = FontWeight.Bold) + Text(stringResource(R.string.payment_failed), fontSize = 24.sp, fontWeight = FontWeight.Bold) Spacer(modifier = Modifier.padding(16.dp)) Text( - "Oops! Seems like there was an error placing your order because of a failed payment, please try again or report an issue. If any money is deducted then it will be refunded within 7 days", + stringResource(R.string.payment_failed_description), fontSize = 16.sp, textAlign = TextAlign.Center, ) diff --git a/example-android/src/main/java/com/komoju/android/ui/screens/store/FakeStoreScreen.kt b/example-android/src/main/java/com/komoju/android/ui/screens/store/FakeStoreScreen.kt index dc3619a..41b281e 100644 --- a/example-android/src/main/java/com/komoju/android/ui/screens/store/FakeStoreScreen.kt +++ b/example-android/src/main/java/com/komoju/android/ui/screens/store/FakeStoreScreen.kt @@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.grid.GridCells import androidx.compose.foundation.lazy.grid.LazyVerticalGrid -import androidx.compose.foundation.lazy.grid.items import androidx.compose.foundation.lazy.grid.itemsIndexed import androidx.compose.foundation.shape.CircleShape import androidx.compose.material.icons.Icons @@ -26,7 +25,6 @@ import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect -import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember @@ -46,6 +44,7 @@ import androidx.compose.ui.text.withStyle import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import androidx.lifecycle.compose.collectAsStateWithLifecycle import cafe.adriel.voyager.core.model.rememberNavigatorScreenModel import cafe.adriel.voyager.core.screen.Screen import cafe.adriel.voyager.navigator.LocalNavigator @@ -61,7 +60,7 @@ class FakeStoreScreen : Screen { override fun Content() { val navigator = LocalNavigator.currentOrThrow val screenModel = navigator.rememberNavigatorScreenModel { FakeStoreScreenModel() } - val uiState by screenModel.uiState.collectAsState() + val uiState by screenModel.uiState.collectAsStateWithLifecycle() val context = LocalContext.current LaunchedEffect(uiState.error) { uiState.error?.let { diff --git a/example-android/src/main/java/com/komoju/android/ui/screens/store/FakeStoreScreenModel.kt b/example-android/src/main/java/com/komoju/android/ui/screens/store/FakeStoreScreenModel.kt index c174f4f..eec1b58 100644 --- a/example-android/src/main/java/com/komoju/android/ui/screens/store/FakeStoreScreenModel.kt +++ b/example-android/src/main/java/com/komoju/android/ui/screens/store/FakeStoreScreenModel.kt @@ -3,12 +3,12 @@ package com.komoju.android.ui.screens.store import cafe.adriel.voyager.core.model.ScreenModel import cafe.adriel.voyager.core.model.screenModelScope import com.komoju.android.BuildConfig -import com.komoju.android.sdk.ExperimentalKomojuPaymentApi -import com.komoju.android.sdk.KomojuSDK +import com.komoju.android.remote.RemoteApiService +import com.komoju.android.remote.dtos.CreateSessionRequest +import com.komoju.android.sdk.KomojuAndroidSDK +import com.komoju.android.sdk.annotations.ExperimentalKomojuPaymentApi import com.komoju.android.sdk.types.Currency import com.komoju.android.sdk.types.Language -import com.komoju.android.ui.remote.RemoteApiService -import com.komoju.android.ui.remote.dtos.CreateSessionRequest import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.asStateFlow @@ -21,7 +21,7 @@ class FakeStoreScreenModel : ScreenModel { private val remoteApiService = RemoteApiService.create() private var publishableKey: String? = null - private val _komojuSDKConfiguration = MutableStateFlow(null) + private val _komojuSDKConfiguration = MutableStateFlow(null) val komojuSDKConfiguration = _komojuSDKConfiguration.asStateFlow() private val _uiState = MutableStateFlow(FakeStoreUiState()) val uiState = _uiState.onStart { @@ -65,7 +65,7 @@ class FakeStoreScreenModel : ScreenModel { fun onBuyClicked(item: Item) { screenModelScope.launch { createSession(item)?.let { sessionId -> - KomojuSDK.Configuration.Builder( + KomojuAndroidSDK.Configuration.Builder( requireNotNull(publishableKey), sessionId, ).setLanguage(language) diff --git a/example-android/src/main/java/com/komoju/android/ui/screens/store/KomojuPaymentSDKConfigurableTheme.kt b/example-android/src/main/java/com/komoju/android/ui/screens/store/KomojuPaymentSDKConfigurableTheme.kt index a55692e..f318e3a 100644 --- a/example-android/src/main/java/com/komoju/android/ui/screens/store/KomojuPaymentSDKConfigurableTheme.kt +++ b/example-android/src/main/java/com/komoju/android/ui/screens/store/KomojuPaymentSDKConfigurableTheme.kt @@ -1,11 +1,11 @@ package com.komoju.android.ui.screens.store import androidx.compose.ui.graphics.toArgb -import com.komoju.android.sdk.ui.theme.ConfigurableTheme +import com.komoju.android.sdk.KomojuAndroidSDK import com.komoju.android.ui.theme.KomojuDarkGreen -val komojuConfigurableTheme = ConfigurableTheme.default.copy( - primaryButtonColor = KomojuDarkGreen.toArgb(), - primaryButtonCornerRadiusInDP = 24, - loaderColor = KomojuDarkGreen.toArgb(), +val komojuConfigurableTheme = KomojuAndroidSDK.ConfigurableTheme.default.copy( + primaryColorInt = KomojuDarkGreen.toArgb(), + primaryShapeCornerRadiusInDp = 24, + loaderColorInt = KomojuDarkGreen.toArgb(), ) diff --git a/example-android/src/main/res/values-ja/strings.xml b/example-android/src/main/res/values-ja/strings.xml index 62c93bc..f07d5c2 100644 --- a/example-android/src/main/res/values-ja/strings.xml +++ b/example-android/src/main/res/values-ja/strings.xml @@ -25,5 +25,7 @@ 支払いを再試行する ご注文ありがとうございます。ご注文は確認されました。発送の詳細は、ご登録のメールアドレスにすぐに送信されます。 注文確定 + 支払いに失敗しました + 申し訳ありません!お支払いに失敗したため、ご注文の際にエラーが発生したようです。もう一度お試しいただくか、問題を報告してください。差し引かれた金額は 7 日以内に返金されます。 \ No newline at end of file diff --git a/example-android/src/main/res/values/strings.xml b/example-android/src/main/res/values/strings.xml index 1c0068a..cbb49a6 100644 --- a/example-android/src/main/res/values/strings.xml +++ b/example-android/src/main/res/values/strings.xml @@ -24,4 +24,6 @@ Retry Payment Thank you for your Order, it has been confirmed, Shipping Details will be shared on your registered email address soon Order Confirmed + Payment Failed + Oops! Seems like there was an error placing your order because of a failed payment, please try again or report an issue. If any money is deducted then it will be refunded within 7 days \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 5e788f3..bd8cf7b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ #Gradle -org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M" +org.gradle.jvmargs=-Xmx8192M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx8192M" org.gradle.caching=true org.gradle.configuration-cache=true #Kotlin diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index cd1fa78..af5602f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,11 +1,12 @@ [versions] agp = "8.7.2" browser = "1.8.0" +humanReadable = "1.10.0" kotlin = "2.0.21" leakcanaryAndroid = "2.14" nexus-publish = "2.0.0" android-minSdk = "24" -android-compileSdk = "34" +android-compileSdk = "35" coreKtx = "1.15.0" fragmentKtx = "1.8.5" junit = "4.13.2" @@ -21,18 +22,22 @@ ktor = "3.0.1" coroutines = "1.9.0" datetime = "0.6.1" uiTooling = "1.7.5" -composeWebView = "0.33.6" +composeWebView = "1.9.40-alpha04" konlinXJson = "1.7.3" +uriKmp = "0.0.18" voyager = "1.1.0-beta03" mavenPublish = "0.30.0" -nmcp = "0.0.7" dokka = "1.9.20" +compose-multiplatform = "1.7.0" +jetbrainsComposeLifecycle = "2.8.3" +androidx-ui-tooling = "1.7.5" [libraries] androidx-browser = { module = "androidx.browser:browser", version.ref = "browser" } +human-readable = { module = "nl.jacobras:Human-Readable", version.ref = "humanReadable" } kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" } leakcanary-android = { module = "com.squareup.leakcanary:leakcanary-android", version.ref = "leakcanaryAndroid" } -nexus-publish = { module = "io.github.gradle-nexus.publish-plugin:io.github.gradle-nexus.publish-plugin.gradle.plugin", version.ref = "nexus-publish" } +androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "androidx-ui-tooling" } core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } androidx-fragment-ktx = { group = "androidx.fragment", name = "fragment-ktx", version.ref = "fragmentKtx" } junit = { group = "junit", name = "junit", version.ref = "junit" } @@ -58,15 +63,18 @@ ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "kto ktor-client-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" } ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" } ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" } +ktor-client-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktor" } kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "coroutines" } kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "konlinXJson" } kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "datetime" } androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling", version.ref = "uiTooling" } -compose-webview = { group = "io.github.kevinnzou", name = "compose-webview", version.ref = "composeWebView" } +compose-webview-multiplatform = { group = "io.github.kevinnzou", name = "compose-webview-multiplatform", version.ref = "composeWebView" } +uri-kmp = { module = "com.eygraber:uri-kmp", version.ref = "uriKmp" } voyager-navigator = { module = "cafe.adriel.voyager:voyager-navigator", version.ref = "voyager" } voyager-screenModel = { module = "cafe.adriel.voyager:voyager-screenmodel", version.ref = "voyager" } voyager-transitions = { module = "cafe.adriel.voyager:voyager-transitions", version.ref = "voyager" } +jetbrains-compose-lifecycle = { module = "org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose", version.ref = "jetbrainsComposeLifecycle" } [plugins] androidLibrary = { id = "com.android.library", version.ref = "agp" } @@ -75,7 +83,8 @@ kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } androidApplication = { id = "com.android.application", version.ref = "agp" } kotlin-plugin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } -kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" } +kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" } maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublish" } jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } -jetbrains-dokka = { id = "org.jetbrains.dokka", version.ref = "dokka"} +jetbrains-dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } +composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "compose-multiplatform" } diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index 6d53e5d..cc5b6fc 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -1,12 +1,16 @@ + import com.vanniktech.maven.publish.SonatypeHost import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework plugins { alias(libs.plugins.kotlinMultiplatform) alias(libs.plugins.androidLibrary) alias(libs.plugins.kotlin.plugin.serialization) alias(libs.plugins.maven.publish) + alias(libs.plugins.compose.compiler) + alias(libs.plugins.composeMultiplatform) } kotlin { @@ -17,18 +21,46 @@ kotlin { jvmTarget.set(JvmTarget.JVM_17) } } - iosX64() - iosArm64() - iosSimulatorArm64() + val xcf = XCFramework() + listOf( + iosX64(), + iosArm64(), + iosSimulatorArm64(), + ).forEach { + it.binaries.framework { + xcf.add(this) + baseName = "komojuShared" + isStatic = true + } + } sourceSets { commonMain.dependencies { + implementation(compose.runtime) + implementation(compose.foundation) + implementation(compose.material3) + implementation(compose.ui) + implementation(compose.components.resources) + implementation(compose.components.uiToolingPreview) + implementation(libs.jetbrains.compose.lifecycle) + implementation(libs.ktor.client.core) implementation(libs.ktor.client.core) implementation(libs.ktor.client.content.negotiation) implementation(libs.ktor.serialization.kotlinx.json) + implementation(libs.ktor.client.logging) + implementation(libs.kotlinx.coroutines.core) implementation(libs.kotlinx.datetime) + + implementation(libs.voyager.navigator) + implementation(libs.voyager.screenModel) + implementation(libs.voyager.transitions) + + implementation(libs.compose.webview.multiplatform) + + implementation(libs.human.readable) + implementation(libs.uri.kmp) } commonTest.dependencies { implementation(libs.kotlin.test) @@ -36,6 +68,8 @@ kotlin { androidMain.dependencies { implementation(libs.ktor.client.okhttp) implementation(libs.kotlinx.coroutines.android) + implementation(libs.androidx.browser) + implementation(libs.androidx.compose.ui.tooling.preview) } iosMain.dependencies { implementation(libs.ktor.client.darwin) @@ -59,6 +93,17 @@ android { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } + resourcePrefix = "komoju_" +} + +dependencies { + debugImplementation(libs.androidx.ui.tooling) +} + +compose { + resources { + generateResClass = never + } } mavenPublishing { diff --git a/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/navigation/PlatformBackPress.android.kt b/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/navigation/PlatformBackPress.android.kt new file mode 100644 index 0000000..73d2798 --- /dev/null +++ b/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/navigation/PlatformBackPress.android.kt @@ -0,0 +1,33 @@ +package com.komoju.mobile.sdk.navigation + +import androidx.activity.OnBackPressedDispatcher +import androidx.activity.compose.LocalOnBackPressedDispatcherOwner +import androidx.compose.runtime.Composable +import androidx.compose.runtime.DisposableEffect +import androidx.compose.runtime.remember + +@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") +actual class PlatformBackPressDispatcher { + private var onBackPressedDispatcher: OnBackPressedDispatcher? = null + + @Composable + fun Create() { + onBackPressedDispatcher = LocalOnBackPressedDispatcherOwner.current?.onBackPressedDispatcher + DisposableEffect(Unit) { + onDispose { + onBackPressedDispatcher = null + } + } + } + + actual fun onBackPressed() { + onBackPressedDispatcher?.onBackPressed() + } +} + +@Composable +actual fun rememberPlatformBackPressDispatcher(): PlatformBackPressDispatcher = remember { + PlatformBackPressDispatcher() +}.apply { + Create() +} diff --git a/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/ui/composables/ExternalScreenLauncherResult.android.kt b/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/ui/composables/ExternalScreenLauncherResult.android.kt new file mode 100644 index 0000000..e4b0411 --- /dev/null +++ b/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/ui/composables/ExternalScreenLauncherResult.android.kt @@ -0,0 +1,10 @@ +package com.komoju.mobile.sdk.ui.composables + +import androidx.activity.result.ActivityResultLauncher + +@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") +actual class Launcher(private val activityLauncher: ActivityResultLauncher) { + actual fun launch(input: I) { + activityLauncher.launch(input) + } +} diff --git a/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/ui/composables/RememberLauncherForActivityResult.android.kt b/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/ui/composables/RememberLauncherForActivityResult.android.kt new file mode 100644 index 0000000..58bfa90 --- /dev/null +++ b/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/ui/composables/RememberLauncherForActivityResult.android.kt @@ -0,0 +1,9 @@ +package com.komoju.mobile.sdk.ui.composables + +import androidx.activity.compose.rememberLauncherForActivityResult +import androidx.compose.runtime.Composable +import com.komoju.mobile.sdk.utils.OffsiteCustomTabResultContract + +@Composable +actual fun launchCustomTab(onResult: (Int) -> Unit): Launcher = + Launcher(rememberLauncherForActivityResult(OffsiteCustomTabResultContract(), onResult = onResult)) diff --git a/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/ui/screens/KomojuPaymentEntryPoint.android.kt b/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/ui/screens/KomojuPaymentEntryPoint.android.kt new file mode 100644 index 0000000..cbbecc4 --- /dev/null +++ b/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/ui/screens/KomojuPaymentEntryPoint.android.kt @@ -0,0 +1,3 @@ +package com.komoju.mobile.sdk.ui.screens + +internal actual const val MAX_HEIGHT_FRACTION: Float = .9f diff --git a/android/src/main/java/com/komoju/android/sdk/utils/ModifierExt.kt b/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/utils/ModifierExt.android.kt similarity index 65% rename from android/src/main/java/com/komoju/android/sdk/utils/ModifierExt.kt rename to shared/src/androidMain/kotlin/com/komoju/mobile/sdk/utils/ModifierExt.android.kt index 4ea3b94..589cd11 100644 --- a/android/src/main/java/com/komoju/android/sdk/utils/ModifierExt.kt +++ b/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/utils/ModifierExt.android.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.utils +package com.komoju.mobile.sdk.utils import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier @@ -7,6 +7,6 @@ import androidx.compose.ui.semantics.semantics import androidx.compose.ui.semantics.testTagsAsResourceId @OptIn(ExperimentalComposeUiApi::class) -internal fun Modifier.testID(id: String) = this - .semantics { testTagsAsResourceId = true } - .testTag(id) +internal actual fun Modifier.testID(id: String) = semantics { + testTagsAsResourceId = true +}.testTag(id) diff --git a/android/src/main/java/com/komoju/android/sdk/utils/OffsiteCustomTabResultContract.kt b/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/utils/OffsiteCustomTabResultContract.kt similarity index 97% rename from android/src/main/java/com/komoju/android/sdk/utils/OffsiteCustomTabResultContract.kt rename to shared/src/androidMain/kotlin/com/komoju/mobile/sdk/utils/OffsiteCustomTabResultContract.kt index da09ff2..9dd13e8 100644 --- a/android/src/main/java/com/komoju/android/sdk/utils/OffsiteCustomTabResultContract.kt +++ b/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/utils/OffsiteCustomTabResultContract.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.utils +package com.komoju.mobile.sdk.utils import android.content.Context import android.content.Intent diff --git a/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/utils/Platform.android.kt b/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/utils/Platform.android.kt new file mode 100644 index 0000000..dd96d81 --- /dev/null +++ b/shared/src/androidMain/kotlin/com/komoju/mobile/sdk/utils/Platform.android.kt @@ -0,0 +1,3 @@ +package com.komoju.mobile.sdk.utils + +actual val currentPlatform: Platform = Platform.ANDROID diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/KomojuMobileSDKConfiguration.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/KomojuMobileSDKConfiguration.kt new file mode 100644 index 0000000..b9838bc --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/KomojuMobileSDKConfiguration.kt @@ -0,0 +1,29 @@ +package com.komoju.mobile.sdk + +import com.komoju.mobile.sdk.ui.theme.ConfigurableTheme +import kotlin.contracts.ExperimentalContracts +import kotlin.contracts.contract + +data class KomojuMobileSDKConfiguration( + val language: String, // Language setting for the payment UI. 'en' for English, 'ja' for Japanese + val currency: String, // Currency used in the transaction. USD for United States Dollar, JPY for Japanese Yen + val publishableKey: String?, // Public API key for Komoju integration. + val isDebugMode: Boolean, // Debug mode flag for logging and testing. + val sessionId: String?, // Unique session ID for payment transaction. + val redirectURL: String, // URL to redirect after payment completion. + val appScheme: String, // App schema for deep links. + val configurableTheme: ConfigurableTheme, // Custom theme for UI elements. + val inlinedProcessing: Boolean, // Flag to enable inlined processing. +) + +/** + * Extension function to check if the current configuration is valid for processing a payment. + * @return True if the configuration is non-null and contains both publishableKey and sessionId. + */ +@OptIn(ExperimentalContracts::class) +fun KomojuMobileSDKConfiguration?.canProcessPayment(): Boolean { + contract { + returns(true) implies (this@canProcessPayment != null) + } + return this?.publishableKey != null && this.sessionId != null +} diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/KomojuMobileSDKPaymentResult.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/KomojuMobileSDKPaymentResult.kt new file mode 100644 index 0000000..63cd489 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/KomojuMobileSDKPaymentResult.kt @@ -0,0 +1,3 @@ +package com.komoju.mobile.sdk + +data class KomojuMobileSDKPaymentResult(val isSuccessFul: Boolean) diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/PaymentMethod.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/PaymentMethod.kt index af8bd06..5f8997e 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/PaymentMethod.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/PaymentMethod.kt @@ -2,7 +2,7 @@ package com.komoju.mobile.sdk.entities import com.komoju.mobile.sdk.types.OffSitePaymentType -sealed interface PaymentMethod { +internal sealed interface PaymentMethod { val hashedGateway: String val exchangeRate: Double val currency: String diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/PaymentRequest.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/PaymentRequest.kt index 646ff3c..ac407a2 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/PaymentRequest.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/PaymentRequest.kt @@ -2,7 +2,7 @@ package com.komoju.mobile.sdk.entities import com.komoju.mobile.sdk.entities.PaymentMethod.Konbini.KonbiniBrand -sealed interface PaymentRequest { +internal sealed interface PaymentRequest { val paymentMethod: PaymentMethod data class Konbini(override val paymentMethod: PaymentMethod.Konbini, val konbiniBrand: KonbiniBrand, val email: String) : diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/SecureTokenRequest.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/SecureTokenRequest.kt index 8237135..b81d6e0 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/SecureTokenRequest.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/SecureTokenRequest.kt @@ -1,6 +1,6 @@ package com.komoju.mobile.sdk.entities -data class SecureTokenRequest( +internal data class SecureTokenRequest( val amount: String, val currency: String, val returnUrl: String, diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/SecureTokenResponse.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/SecureTokenResponse.kt index b27f290..9b50c2e 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/SecureTokenResponse.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/SecureTokenResponse.kt @@ -1,6 +1,6 @@ package com.komoju.mobile.sdk.entities -data class SecureTokenResponse(val id: String, val status: Status, val authURL: String) { +internal data class SecureTokenResponse(val id: String, val status: Status, val authURL: String) { enum class Status { OK, SKIPPED, diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/Session.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/Session.kt index 322f7cc..044778e 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/Session.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/entities/Session.kt @@ -1,3 +1,3 @@ package com.komoju.mobile.sdk.entities -data class Session(val paymentMethods: List) +internal data class Session(val paymentMethods: List) diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/EnglishStrings.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/EnglishStrings.kt new file mode 100644 index 0000000..bcca861 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/EnglishStrings.kt @@ -0,0 +1,129 @@ +package com.komoju.mobile.sdk.i18n + +object EnglishStrings : I18nStrings { + override fun get(key: I18nStringKey): String = when (key) { + I18nStringKey.cardholder_name_cannot_be_empty -> "The entered cardholder name cannot be empty" + I18nStringKey.the_entered_cardholder_name_is_not_valid -> "The entered cardholder name is not valid" + I18nStringKey.the_entered_card_number_is_not_valid -> "The entered card number is not valid" + I18nStringKey.the_entered_expiry_date_is_not_valid -> "The entered expiry date is not valid" + I18nStringKey.the_entered_cvv_is_not_valid -> "The entered CVV is not valid" + I18nStringKey.payment_successful -> "Payment successful" + I18nStringKey.payment_failed -> "Payment failed" + I18nStringKey.awaiting_payment -> "Awaiting payment" + I18nStringKey.your_payment_has_been_processed_successfully -> "Your payment has been processed successfully." + I18nStringKey.your_payment_has_failed -> "Your payment has failed." + I18nStringKey.awaiting_payment_instruction -> "You need to go to your local %s and make the payment to proceed." + I18nStringKey.your_payment_is_awaiting_processing -> "Your payment is awaiting processing." + I18nStringKey.error -> "Error" + I18nStringKey.receipt_number -> "Receipt Number" + I18nStringKey.confirmation_code -> "Confirmation Code" + I18nStringKey.done -> "Done" + I18nStringKey.update_payment_method -> "Update Payment method" + I18nStringKey.view_instructions -> "View instructions" + I18nStringKey.okay -> "Okay" + I18nStringKey.have_a_question_contact_us -> "Have a question? Contact us" + I18nStringKey.i_will_do_it_later -> "I will do it later" + I18nStringKey.error_user_cancel -> + "We noticed that you’ve canceled the payment process. " + + "If this was a mistake you can try again to complete your purchase." + I18nStringKey.error_other -> + "We attempted to process your payment but something went wrong. " + + "Please update your payment method below to continue." + I18nStringKey.credit_card_error -> + "We tried to charge your card but, something went wrong. " + + "Please update your payment method below to continue" + I18nStringKey.back_to_store -> "Back to store" + I18nStringKey.payment_options -> "Payment Options" + I18nStringKey.pay -> "Pay %s" + I18nStringKey.cardholder_name -> "Cardholder name" + I18nStringKey.full_name_on_card -> "Full name on card" + I18nStringKey.card_number -> "Card Number" + I18nStringKey.mm_yy -> "MM/YY" + I18nStringKey.cvv -> "CVV" + I18nStringKey.save_this_card_for_future_payments -> "Save this card for future payments" + I18nStringKey.daily_yamazaki -> "Daily Yamazaki" + I18nStringKey.family_mart -> "Family Mart" + I18nStringKey.lawson -> "Lawson" + I18nStringKey.mini_stop -> "MiniStop" + I18nStringKey.seico_mart -> "SeicoMart" + I18nStringKey.seven_eleven -> "7-Eleven" + I18nStringKey.full_name_on_receipt -> "Full name on receipt" + I18nStringKey.name_shown_on_receipt -> "Name (shown on receipt)" + I18nStringKey.email -> "Email" + I18nStringKey.enter_your_email_address -> "Enter Your Email Address" + I18nStringKey.net_cash_information -> "NET CASH Information" + I18nStringKey.net_cash_id -> "NET CASH id" + I18nStringKey.payment_via_alipay -> "Payment via Alipay" + I18nStringKey.payment_via_au_pay -> "Payment via AU Pay" + I18nStringKey.payment_via_mer_pay -> "Payment via Mer Pay" + I18nStringKey.payment_via_paypay -> "Payment via Paypay" + I18nStringKey.payment_via_rakuten_pay -> "Payment via Rakuten Pay" + I18nStringKey.payment_via_line_pay -> "Payment via Line Pay" + I18nStringKey.you_will_be_redirected_to_alipay -> "You will be redirected to Alipay to complete the payment" + I18nStringKey.you_will_be_redirected_to_au_pay -> "You will be redirected to AU Pay to complete the payment" + I18nStringKey.you_will_be_redirected_to_mer_pay -> "You will be redirected to Mer Pay to complete the payment" + I18nStringKey.you_will_be_redirected_to_paypay -> "You will be redirected to Paypay to complete the payment" + I18nStringKey.you_will_be_redirected_to_rakuten -> "You will be redirected to Rakuten to complete the payment" + I18nStringKey.you_will_be_redirected_to_line_pay -> "You will be redirected to Line Pay to complete the payment" + I18nStringKey.continue_to_alipay -> "Continue to Alipay" + I18nStringKey.continue_to_au_pay -> "Continue to AuPay" + I18nStringKey.continue_to_mer_pay -> "Continue to MerPay" + I18nStringKey.continue_to_paypay -> "Continue to PayPay" + I18nStringKey.continue_to_rakuten -> "Continue to Rakuten" + I18nStringKey.continue_to_line_pay -> "Continue to LinePay" + I18nStringKey.continue_to_paidy -> "Continue to Paidy" + I18nStringKey.webview_open_info -> "Note a web window will be opened.After purchase you will be redirected back." + I18nStringKey.full_name -> "Full Name" + I18nStringKey.enter_your_name -> "Enter your name" + I18nStringKey.phone_number -> "Phone Number" + I18nStringKey.enter_your_phone_number -> "Enter your phone number" + I18nStringKey.last_name -> "Last Name" + I18nStringKey.first_name -> "First Name" + I18nStringKey.last_name_phonetic -> "Last Name (Phonetic)" + I18nStringKey.first_name_phonetic -> "First Name (Phonetic)" + I18nStringKey.web_money_information -> "WebMoney Information" + I18nStringKey.prepaid_number -> "Prepaid number" + I18nStringKey.payment_success -> "Payment Success" + I18nStringKey.thank_you_for_your_order -> "Thank you for your order" + I18nStringKey.bit_cash_information -> "BitCash Information" + I18nStringKey.hiragana_id -> "Hiragana id" + I18nStringKey.bank_transfer -> "Bank Transfer" + I18nStringKey.bit_cash -> "BitCash" + I18nStringKey.credit_card -> "Credit card" + I18nStringKey.konbini -> "Konbini" + I18nStringKey.net_cash -> "NetCash" + I18nStringKey.au_pay -> "au Pay" + I18nStringKey.alipay -> "AliPay" + I18nStringKey.mer_pay -> "Mer Pay" + I18nStringKey.paypay -> "PayPay" + I18nStringKey.rakuten_pay -> "Rakuten Pay" + I18nStringKey.line_pay -> "Line Pay" + I18nStringKey.unknown -> "Unknown" + I18nStringKey.other -> "Other" + I18nStringKey.paidy -> "Paidy" + I18nStringKey.pay_easy -> "PayEasy" + I18nStringKey.web_money -> "WebMoney" + I18nStringKey.total_payment -> "Total Payment" + I18nStringKey.the_entered_name_cannot_be_empty -> "The entered name cannot be empty" + I18nStringKey.the_entered_email_is_not_valid -> "The entered email is not valid" + I18nStringKey.please_select_a_konbini_brand -> "Please select a konbini brand" + I18nStringKey.the_entered_phone_number_cannot_be_empty -> "The entered phone number cannot be empty" + I18nStringKey.the_entered_phone_number_is_not_valid -> "The entered phone number is not valid" + I18nStringKey.the_entered_net_cash_id_cannot_be_empty -> "The entered net cash id cannot be empty" + I18nStringKey.the_entered_net_cash_id_is_not_valid -> "The entered net cash id is not valid" + I18nStringKey.the_entered_bit_cash_id_cannot_be_empty -> "The entered bit cash id cannot be empty" + I18nStringKey.the_entered_bit_cash_id_is_not_valid -> "The entered bit cash id is not valid" + I18nStringKey.the_entered_prepaid_number_cannot_be_empty -> "The entered prepaid number cannot be empty" + I18nStringKey.the_entered_prepaid_number_is_not_valid -> "The entered prepaid number is not valid" + I18nStringKey.the_entered_last_name_cannot_be_empty -> "The entered last name cannot be empty" + I18nStringKey.the_entered_first_name_cannot_be_empty -> "The entered first name cannot be empty" + I18nStringKey.the_entered_first_name_phonetic_cannot_be_empty -> "The entered first name phonetic cannot be empty" + I18nStringKey.the_entered_first_name_phonetic_must_be_a_kana -> "The entered first name phonetic must be a kana" + I18nStringKey.the_entered_last_name_phonetic_cannot_be_empty -> "The entered last name phonetic cannot be empty" + I18nStringKey.the_entered_last_name_phonetic_must_be_a_kana -> "The entered last name phonetic must be a kana" + I18nStringKey.yes -> "Yes" + I18nStringKey.no -> "No" + I18nStringKey.are_you_sure_you_want_to_cancel_the_payment -> "Are you sure you want to cancel the payment?" + I18nStringKey.cancel_payment -> "Cancel Payment?" + } +} diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/I18nStringKey.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/I18nStringKey.kt new file mode 100644 index 0000000..28c77ce --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/I18nStringKey.kt @@ -0,0 +1,122 @@ +package com.komoju.mobile.sdk.i18n + +@Suppress("EnumEntryName") +enum class I18nStringKey { + cardholder_name_cannot_be_empty, + the_entered_cardholder_name_is_not_valid, + the_entered_card_number_is_not_valid, + the_entered_expiry_date_is_not_valid, + the_entered_cvv_is_not_valid, + payment_successful, + payment_failed, + awaiting_payment, + your_payment_has_been_processed_successfully, + your_payment_has_failed, + awaiting_payment_instruction, + your_payment_is_awaiting_processing, + error, + receipt_number, + confirmation_code, + done, + update_payment_method, + view_instructions, + okay, + have_a_question_contact_us, + i_will_do_it_later, + error_user_cancel, + error_other, + credit_card_error, + back_to_store, + payment_options, + pay, + cardholder_name, + full_name_on_card, + card_number, + mm_yy, + cvv, + save_this_card_for_future_payments, + daily_yamazaki, + family_mart, + lawson, + mini_stop, + seico_mart, + seven_eleven, + full_name_on_receipt, + name_shown_on_receipt, + email, + enter_your_email_address, + net_cash_information, + net_cash_id, + payment_via_alipay, + payment_via_au_pay, + payment_via_mer_pay, + payment_via_paypay, + payment_via_rakuten_pay, + payment_via_line_pay, + you_will_be_redirected_to_alipay, + you_will_be_redirected_to_au_pay, + you_will_be_redirected_to_mer_pay, + you_will_be_redirected_to_paypay, + you_will_be_redirected_to_rakuten, + you_will_be_redirected_to_line_pay, + continue_to_alipay, + continue_to_au_pay, + continue_to_mer_pay, + continue_to_paypay, + continue_to_rakuten, + continue_to_line_pay, + continue_to_paidy, + webview_open_info, + full_name, + enter_your_name, + phone_number, + enter_your_phone_number, + last_name, + first_name, + last_name_phonetic, + first_name_phonetic, + web_money_information, + prepaid_number, + payment_success, + thank_you_for_your_order, + bit_cash_information, + hiragana_id, + bank_transfer, + bit_cash, + credit_card, + konbini, + net_cash, + au_pay, + alipay, + mer_pay, + paypay, + rakuten_pay, + line_pay, + unknown, + other, + paidy, + pay_easy, + web_money, + total_payment, + the_entered_name_cannot_be_empty, + the_entered_email_is_not_valid, + please_select_a_konbini_brand, + the_entered_phone_number_cannot_be_empty, + the_entered_phone_number_is_not_valid, + the_entered_net_cash_id_cannot_be_empty, + the_entered_net_cash_id_is_not_valid, + the_entered_bit_cash_id_cannot_be_empty, + the_entered_bit_cash_id_is_not_valid, + the_entered_prepaid_number_cannot_be_empty, + the_entered_prepaid_number_is_not_valid, + the_entered_last_name_cannot_be_empty, + the_entered_first_name_cannot_be_empty, + the_entered_first_name_phonetic_cannot_be_empty, + the_entered_first_name_phonetic_must_be_a_kana, + the_entered_last_name_phonetic_cannot_be_empty, + the_entered_last_name_phonetic_must_be_a_kana, + yes, + no, + are_you_sure_you_want_to_cancel_the_payment, + cancel_payment, +} diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/I18nStringResource.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/I18nStringResource.kt new file mode 100644 index 0000000..01bb862 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/I18nStringResource.kt @@ -0,0 +1,23 @@ +package com.komoju.mobile.sdk.i18n + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember +import com.komoju.mobile.sdk.ui.theme.LocalKomojuLanguage + +@Composable +fun i18nStringResource(key: I18nStringKey, vararg args: Any): String { + val languageCode = LocalKomojuLanguage.current.code + val string = remember(key, languageCode) { + val strings = when (languageCode.lowercase()) { + "en", "eng", "english" -> EnglishStrings + else -> JapaneseStrings + } + when { + args.isEmpty() -> strings.get(key) + else -> strings.get(key).replaceWithArgs(args.map { it.toString() }) + } + } + return string +} + +internal fun String.replaceWithArgs(args: List) = replace("%s", args.first()) diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/I18nStrings.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/I18nStrings.kt new file mode 100644 index 0000000..7d6a553 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/I18nStrings.kt @@ -0,0 +1,5 @@ +package com.komoju.mobile.sdk.i18n + +interface I18nStrings { + fun get(key: I18nStringKey): String +} diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/JapaneseStrings.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/JapaneseStrings.kt new file mode 100644 index 0000000..f00127a --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/JapaneseStrings.kt @@ -0,0 +1,123 @@ +package com.komoju.mobile.sdk.i18n + +object JapaneseStrings : I18nStrings { + override fun get(key: I18nStringKey): String = when (key) { + I18nStringKey.cardholder_name_cannot_be_empty -> "入力したカード所有者名は空欄にできません" + I18nStringKey.the_entered_cardholder_name_is_not_valid -> "入力したカード所有者名は無効です" + I18nStringKey.the_entered_card_number_is_not_valid -> "入力したカード番号は無効です" + I18nStringKey.the_entered_expiry_date_is_not_valid -> "入力した有効期限は無効です" + I18nStringKey.the_entered_cvv_is_not_valid -> "入力した CVV は無効です" + I18nStringKey.payment_successful -> "支払いは成功しました" + I18nStringKey.payment_failed -> "支払いは失敗しました" + I18nStringKey.awaiting_payment -> "支払いを待機しています" + I18nStringKey.your_payment_has_been_processed_successfully -> "支払いは正常に処理されました。" + I18nStringKey.your_payment_has_failed -> "支払いは失敗しました。" + I18nStringKey.awaiting_payment_instruction -> "続行するには、お近くの %s に行って支払いを行う必要があります。" + I18nStringKey.your_payment_is_awaiting_processing -> "支払いは処理を待機しています。" + I18nStringKey.error -> "エラー" + I18nStringKey.receipt_number -> "領収書番号" + I18nStringKey.confirmation_code -> "確認コード" + I18nStringKey.done -> "完了" + I18nStringKey.update_payment_method -> "お支払い方法を更新" + I18nStringKey.view_instructions -> "手順を表示" + I18nStringKey.okay -> "了解" + I18nStringKey.have_a_question_contact_us -> "ご質問がありますか? お問い合わせください" + I18nStringKey.i_will_do_it_later -> "後で行います" + I18nStringKey.error_user_cancel -> "お支払い処理がキャンセルされたことがわかりました。これが間違いだった場合は、もう一度試して購入を完了してください。" + I18nStringKey.error_other -> "お支払いの処理を試みましたが、問題が発生しました。続行するには、以下のお支払い方法を更新してください。" + I18nStringKey.credit_card_error -> "カードへの請求を試みましたが、問題が発生しました。続行するには、以下のお支払い方法を更新してください" + I18nStringKey.back_to_store -> "ストアに戻る" + I18nStringKey.payment_options -> "お支払いオプション" + I18nStringKey.pay -> "%s を支払う" + I18nStringKey.cardholder_name -> "カード所有者名" + I18nStringKey.full_name_on_card -> "TARO YAMADA" + I18nStringKey.card_number -> "カード番号" + I18nStringKey.mm_yy -> "MM/YY" + I18nStringKey.cvv -> "CVV" + I18nStringKey.save_this_card_for_future_payments -> "今後のお支払いのためにこのカードを保存する" + I18nStringKey.daily_yamazaki -> "デイリーヤマザキ" + I18nStringKey.family_mart -> "ファミリーマート" + I18nStringKey.lawson -> "ローソン" + I18nStringKey.mini_stop -> "ミニストップ" + I18nStringKey.seico_mart -> "セイコーマート" + I18nStringKey.seven_eleven -> "セブンイレブン" + I18nStringKey.full_name_on_receipt -> "レシートのフルネーム" + I18nStringKey.name_shown_on_receipt -> "名前(カードに記載)領収書)" + I18nStringKey.email -> "メール" + I18nStringKey.enter_your_email_address -> "メールアドレスを入力してください" + I18nStringKey.net_cash_information -> "NET CASH 情報" + I18nStringKey.net_cash_id -> "NET CASH ID" + I18nStringKey.payment_via_alipay -> "Alipay での支払い" + I18nStringKey.payment_via_au_pay -> "AU Pay での支払い" + I18nStringKey.payment_via_mer_pay -> "Mer Pay での支払い" + I18nStringKey.payment_via_paypay -> "Paypay での支払い" + I18nStringKey.payment_via_rakuten_pay -> "Rakuten Pay での支払い" + I18nStringKey.payment_via_line_pay -> "Line Pay での支払い" + I18nStringKey.you_will_be_redirected_to_alipay -> "支払いを完了するには、Alipay にリダイレクトされます" + I18nStringKey.you_will_be_redirected_to_au_pay -> "支払いを完了するには、AU Pay にリダイレクトされます" + I18nStringKey.you_will_be_redirected_to_mer_pay -> "支払いを完了するには、Mer Pay にリダイレクトされます" + I18nStringKey.you_will_be_redirected_to_paypay -> "支払いを完了するには、Paypay にリダイレクトされます" + I18nStringKey.you_will_be_redirected_to_rakuten -> "支払いを完了するには、Rakuten にリダイレクトされますお支払い" + I18nStringKey.you_will_be_redirected_to_line_pay -> "お支払いを完了するには、Line Pay にリダイレクトされます" + I18nStringKey.continue_to_alipay -> "Alipay に進みます" + I18nStringKey.continue_to_au_pay -> "AuPay に進みます" + I18nStringKey.continue_to_mer_pay -> "MerPay に進みます" + I18nStringKey.continue_to_paypay -> "PayPay に進みます" + I18nStringKey.continue_to_rakuten -> "Rakuten に進みます" + I18nStringKey.continue_to_line_pay -> "LinePay に進みます" + I18nStringKey.continue_to_paidy -> "Paidy に進みます" + I18nStringKey.webview_open_info -> "注: Web ウィンドウが開きます。購入後、元のウィンドウに戻ります。" + I18nStringKey.full_name -> "氏名" + I18nStringKey.enter_your_name -> "お名前を入力してください" + I18nStringKey.phone_number -> "電話番号" + I18nStringKey.enter_your_phone_number -> "電話番号を入力してください" + I18nStringKey.last_name -> "姓" + I18nStringKey.first_name -> "名" + I18nStringKey.last_name_phonetic -> "姓(フリガナ)" + I18nStringKey.first_name_phonetic -> "名(フリガナ)" + I18nStringKey.web_money_information -> "WebMoney情報" + I18nStringKey.prepaid_number -> "プリペイド番号" + I18nStringKey.payment_success -> "お支払い完了" + I18nStringKey.thank_you_for_your_order -> "ご注文ありがとうございます" + I18nStringKey.bit_cash_information -> "BitCash情報" + I18nStringKey.hiragana_id -> "ひらがなID" + I18nStringKey.bank_transfer -> "銀行振込" + I18nStringKey.bit_cash -> "BitCash" + I18nStringKey.credit_card -> "カード" + I18nStringKey.konbini -> "コンビニ" + I18nStringKey.net_cash -> "NetCash" + I18nStringKey.au_pay -> "au Pay" + I18nStringKey.alipay -> "AliPay" + I18nStringKey.mer_pay -> "メルペイ" + I18nStringKey.paypay -> "PayPay" + I18nStringKey.rakuten_pay -> "楽天ペイ" + I18nStringKey.line_pay -> "Line Pay" + I18nStringKey.unknown -> "不明" + I18nStringKey.other -> "その他" + I18nStringKey.paidy -> "Paidy" + I18nStringKey.pay_easy -> "PayEasy" + I18nStringKey.web_money -> "WebMoney" + I18nStringKey.total_payment -> "合計支払額" + I18nStringKey.the_entered_name_cannot_be_empty -> "入力した名前は空欄にできません" + I18nStringKey.the_entered_email_is_not_valid -> "入力したメールアドレスは無効です" + I18nStringKey.please_select_a_konbini_brand -> "コンビニのブランドを選択してください" + I18nStringKey.the_entered_phone_number_cannot_be_empty -> "入力した電話番号は空欄にできません" + I18nStringKey.the_entered_phone_number_is_not_valid -> "入力した電話番号は無効です" + I18nStringKey.the_entered_net_cash_id_cannot_be_empty -> "入力したネットキャッシュIDは空欄にできません" + I18nStringKey.the_entered_net_cash_id_is_not_valid -> "入力したネットキャッシュIDは無効です" + I18nStringKey.the_entered_bit_cash_id_cannot_be_empty -> "入力したビットキャッシュIDは空欄にできません" + I18nStringKey.the_entered_bit_cash_id_is_not_valid -> "入力したビットキャッシュIDは無効です" + I18nStringKey.the_entered_prepaid_number_cannot_be_empty -> "入力したプリペイド番号は空欄にできません" + I18nStringKey.the_entered_prepaid_number_is_not_valid -> "入力したプリペイド番号は無効です" + I18nStringKey.the_entered_last_name_cannot_be_empty -> "入力した姓は空欄にできません" + I18nStringKey.the_entered_first_name_cannot_be_empty -> "入力した名字は空欄にできません" + I18nStringKey.the_entered_first_name_phonetic_cannot_be_empty -> "入力した名のフリガナは空" + I18nStringKey.the_entered_first_name_phonetic_must_be_a_kana -> "入力したファーストネームの読みはカナでなければなりません" + I18nStringKey.the_entered_last_name_phonetic_cannot_be_empty -> "入力したラストネームの読みは空にできません" + I18nStringKey.the_entered_last_name_phonetic_must_be_a_kana -> "入力したラストネームの読みはカナでなければなりません" + I18nStringKey.yes -> "はい" + I18nStringKey.no -> "いいえ" + I18nStringKey.are_you_sure_you_want_to_cancel_the_payment -> "支払いをキャンセルしてもよろしいですか?" + I18nStringKey.cancel_payment -> "支払いをキャンセルしますか?" + } +} diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/KomojuLanguage.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/KomojuLanguage.kt new file mode 100644 index 0000000..8fa9e2b --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/i18n/KomojuLanguage.kt @@ -0,0 +1,6 @@ +package com.komoju.mobile.sdk.i18n + +import androidx.compose.runtime.Stable + +@Stable +data class KomojuLanguage(val code: String) diff --git a/android/src/main/java/com/komoju/android/sdk/navigation/PaymentResultScreenModel.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/navigation/PaymentResultScreenModel.kt similarity index 51% rename from android/src/main/java/com/komoju/android/sdk/navigation/PaymentResultScreenModel.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/navigation/PaymentResultScreenModel.kt index 141924d..e7f2abf 100644 --- a/android/src/main/java/com/komoju/android/sdk/navigation/PaymentResultScreenModel.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/navigation/PaymentResultScreenModel.kt @@ -1,22 +1,22 @@ -package com.komoju.android.sdk.navigation +package com.komoju.mobile.sdk.navigation import androidx.compose.runtime.Composable import cafe.adriel.voyager.core.model.ScreenModel import cafe.adriel.voyager.core.model.rememberNavigatorScreenModel import cafe.adriel.voyager.navigator.Navigator -import com.komoju.android.sdk.KomojuSDK +import com.komoju.mobile.sdk.KomojuMobileSDKPaymentResult -internal class PaymentResultScreenModel : ScreenModel { - var result: KomojuSDK.PaymentResult? = null +class PaymentResultScreenModel internal constructor() : ScreenModel { + var result: KomojuMobileSDKPaymentResult? = null private set - fun setResult(result: KomojuSDK.PaymentResult) { + fun setResult(result: KomojuMobileSDKPaymentResult) { this.result = result } } @Composable -internal fun Navigator.paymentResultScreenModel() = rememberNavigatorScreenModel( +fun Navigator.paymentResultScreenModel() = rememberNavigatorScreenModel( tag = PaymentResultScreenModel::class.simpleName, factory = ::PaymentResultScreenModel, ) diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/navigation/PlatformBackPress.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/navigation/PlatformBackPress.kt new file mode 100644 index 0000000..955f14e --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/navigation/PlatformBackPress.kt @@ -0,0 +1,11 @@ +package com.komoju.mobile.sdk.navigation + +import androidx.compose.runtime.Composable + +@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") +internal expect class PlatformBackPressDispatcher private constructor() { + fun onBackPressed() +} + +@Composable +internal expect fun rememberPlatformBackPressDispatcher(): PlatformBackPressDispatcher diff --git a/android/src/main/java/com/komoju/android/sdk/navigation/RouterStateScreenModel.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/navigation/RouterStateScreenModel.kt similarity index 88% rename from android/src/main/java/com/komoju/android/sdk/navigation/RouterStateScreenModel.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/navigation/RouterStateScreenModel.kt index 2516610..b91a52f 100644 --- a/android/src/main/java/com/komoju/android/sdk/navigation/RouterStateScreenModel.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/navigation/RouterStateScreenModel.kt @@ -1,7 +1,7 @@ -package com.komoju.android.sdk.navigation +package com.komoju.mobile.sdk.navigation import cafe.adriel.voyager.core.model.ScreenModel -import com.komoju.android.sdk.ui.screens.Router +import com.komoju.mobile.sdk.ui.screens.Router import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.asStateFlow diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/NetworkClient.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/NetworkClient.kt index 70d1bd9..d773559 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/NetworkClient.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/NetworkClient.kt @@ -1,23 +1,34 @@ package com.komoju.mobile.sdk.remote +import com.komoju.mobile.sdk.KomojuMobileSDKConfiguration import io.ktor.client.HttpClient import io.ktor.client.plugins.contentnegotiation.ContentNegotiation import io.ktor.client.plugins.defaultRequest +import io.ktor.client.plugins.logging.DEFAULT +import io.ktor.client.plugins.logging.LogLevel +import io.ktor.client.plugins.logging.Logger +import io.ktor.client.plugins.logging.Logging import io.ktor.serialization.kotlinx.json.json import io.ktor.util.encodeBase64 import kotlinx.serialization.json.Json private const val BASE_URL = "https://komoju.com/api/" -internal fun createNetworkClient(publishableKey: String?) = HttpClient { +internal fun createNetworkClient(configuration: KomojuMobileSDKConfiguration) = HttpClient { defaultRequest { url(BASE_URL) - headers.append("Authorization", value = "Basic ${publishableKey?.encodeBase64()}") + headers.append("Authorization", value = "Basic ${configuration.publishableKey?.encodeBase64()}") headers.append("KOMOJU-VIA", "mobile_${PLATFORM.lowercase()}") headers.append("X-KOMOJU-API-VERSION", "2024-07-15") headers.append("Accept", "application/json") headers.append("Content-Type", "application/json") } + if (configuration.isDebugMode) { + install(Logging) { + logger = Logger.DEFAULT + level = LogLevel.ALL + } + } install(ContentNegotiation) { json( Json { diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/apis/KomojuRemoteApi.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/apis/KomojuRemoteApi.kt index 687436b..81771e6 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/apis/KomojuRemoteApi.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/apis/KomojuRemoteApi.kt @@ -1,18 +1,19 @@ package com.komoju.mobile.sdk.remote.apis +import com.komoju.mobile.sdk.KomojuMobileSDKConfiguration import com.komoju.mobile.sdk.remote.createNetworkClient -interface KomojuRemoteApi : AutoCloseable { +internal interface KomojuRemoteApi : AutoCloseable { val sessions: SessionApi val tokens: TokensApi companion object { - fun create(publishableKey: String?): KomojuRemoteApi = KomojuRemoteApiImpl(publishableKey) + fun create(configuration: KomojuMobileSDKConfiguration): KomojuRemoteApi = KomojuRemoteApiImpl(configuration) } } -internal class KomojuRemoteApiImpl(publishableKey: String?) : KomojuRemoteApi { - private val networkClient by lazy { createNetworkClient(publishableKey) } +internal class KomojuRemoteApiImpl(configuration: KomojuMobileSDKConfiguration) : KomojuRemoteApi { + private val networkClient by lazy { createNetworkClient(configuration) } override val sessions: SessionApi by lazy { SessionApiImpl(networkClient) } diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/apis/SessionApi.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/apis/SessionApi.kt index b97d632..6f68308 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/apis/SessionApi.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/apis/SessionApi.kt @@ -20,7 +20,7 @@ import io.ktor.http.ContentType import io.ktor.http.HttpStatusCode import io.ktor.http.contentType -interface SessionApi { +internal interface SessionApi { suspend fun show(id: String): Result suspend fun pay(id: String, paymentRequest: PaymentRequest): Result suspend fun pay(sessionID: String, token: String, amount: String, currency: String): Result diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/apis/TokensApi.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/apis/TokensApi.kt index 26b0ae9..3e1521c 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/apis/TokensApi.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/apis/TokensApi.kt @@ -14,7 +14,7 @@ import io.ktor.client.request.setBody import io.ktor.http.ContentType import io.ktor.http.contentType -interface TokensApi { +internal interface TokensApi { suspend fun generateSecureToken(request: SecureTokenRequest): Result suspend fun verifySecureToken(token: String): Result } diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/dtos/PayByTokenRequestDto.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/dtos/PayByTokenRequestDto.kt index 99b668e..a0cbe51 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/dtos/PayByTokenRequestDto.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/dtos/PayByTokenRequestDto.kt @@ -4,7 +4,7 @@ import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @Serializable -data class PayByTokenRequestDto( +internal data class PayByTokenRequestDto( @SerialName("amount") val amount: String? = null, @SerialName("currency") val currency: String? = null, @SerialName("payment_details") val paymentDetails: String? = null, diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/dtos/PaymentErrorResponseDto.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/dtos/PaymentErrorResponseDto.kt index 8a012bf..d898b89 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/dtos/PaymentErrorResponseDto.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/dtos/PaymentErrorResponseDto.kt @@ -4,7 +4,7 @@ import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @Serializable -data class PaymentErrorResponseDto(@SerialName("error") val error: Error? = null) { +internal data class PaymentErrorResponseDto(@SerialName("error") val error: Error? = null) { @Serializable data class Error(@SerialName("code") val code: String? = null, @SerialName("message") val message: String? = null) } diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/dtos/SecureTokenRequestDto.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/dtos/SecureTokenRequestDto.kt index 3db7420..b053ae0 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/dtos/SecureTokenRequestDto.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/dtos/SecureTokenRequestDto.kt @@ -5,7 +5,7 @@ import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @Serializable -data class SecureTokenRequestDto( +internal data class SecureTokenRequestDto( @SerialName("amount") val amount: String? = null, @SerialName("currency") val currency: String? = null, @SerialName("return_url") val returnUrl: String? = null, diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/dtos/SecureTokenVerificationResponseDto.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/dtos/SecureTokenVerificationResponseDto.kt index 579bf26..fb03809 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/dtos/SecureTokenVerificationResponseDto.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/remote/dtos/SecureTokenVerificationResponseDto.kt @@ -4,7 +4,7 @@ import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @Serializable -data class SecureTokenVerificationResponseDto( +internal data class SecureTokenVerificationResponseDto( @SerialName("secure_token") val secureToken: String? = null, @SerialName("verification_status") val verificationStatus: String? = null, ) diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/types/OffSitePaymentType.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/types/OffSitePaymentType.kt index 6f8f332..3f4065e 100644 --- a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/types/OffSitePaymentType.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/types/OffSitePaymentType.kt @@ -1,6 +1,6 @@ package com.komoju.mobile.sdk.types -enum class OffSitePaymentType(val id: String) { +internal enum class OffSitePaymentType(val id: String) { AU_PAY("aupay"), ALI_PAY("alipay"), MER_PAY("merpay"), diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/composables/ExternalScreenLauncherResult.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/composables/ExternalScreenLauncherResult.kt new file mode 100644 index 0000000..bfd6e2a --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/composables/ExternalScreenLauncherResult.kt @@ -0,0 +1,11 @@ +package com.komoju.mobile.sdk.ui.composables + +import androidx.compose.runtime.Composable + +@Composable +expect fun launchCustomTab(onResult: (Int) -> Unit): Launcher + +@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") +expect class Launcher { + fun launch(input: I) +} diff --git a/android/src/main/java/com/komoju/android/sdk/ui/composables/InlinedPaymentPrimaryButton.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/composables/InlinedPaymentPrimaryButton.kt similarity index 86% rename from android/src/main/java/com/komoju/android/sdk/ui/composables/InlinedPaymentPrimaryButton.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/composables/InlinedPaymentPrimaryButton.kt index c45200d..9076925 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/composables/InlinedPaymentPrimaryButton.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/composables/InlinedPaymentPrimaryButton.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.composables +package com.komoju.mobile.sdk.ui.composables import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxWidth @@ -24,16 +24,16 @@ import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import com.komoju.android.sdk.ui.theme.KomojuMobileSdkTheme -import com.komoju.android.sdk.ui.theme.LocalConfigurableTheme +import com.komoju.mobile.sdk.ui.theme.KomojuMobileSdkTheme +import com.komoju.mobile.sdk.ui.theme.LocalConfigurableTheme +import com.komoju.mobile.sdk.ui.theme.toColor import kotlin.time.Duration.Companion.seconds import kotlinx.coroutines.delay import kotlinx.coroutines.launch +import org.jetbrains.compose.ui.tooling.preview.Preview @Composable internal fun InlinedPaymentPrimaryButton( @@ -47,10 +47,10 @@ internal fun InlinedPaymentPrimaryButton( modifier = modifier, onClick = onClick, colors = ButtonDefaults.buttonColors( - containerColor = Color(configurableTheme.primaryButtonColor), - contentColor = Color(configurableTheme.primaryButtonContentColor), + containerColor = configurableTheme.primaryColor.toColor(), + contentColor = configurableTheme.primaryContentColor.toColor(), ), - shape = RoundedCornerShape(configurableTheme.primaryButtonCornerRadiusInDP.dp), + shape = RoundedCornerShape(configurableTheme.primaryShapeCornerRadiusInDp.dp), ) { Box( modifier = Modifier @@ -85,7 +85,7 @@ internal fun InlinedPaymentPrimaryButton( } } -internal enum class InlinedPaymentPrimaryButtonState { +enum class InlinedPaymentPrimaryButtonState { LOADING, IDLE, SUCCESS, @@ -93,12 +93,12 @@ internal enum class InlinedPaymentPrimaryButtonState { } @Composable -internal fun rememberInlinedPaymentPrimaryButtonState( +fun rememberInlinedPaymentPrimaryButtonState( default: InlinedPaymentPrimaryButtonState = InlinedPaymentPrimaryButtonState.IDLE, ): MutableState = rememberSaveable { mutableStateOf(default) } @Composable -@Preview(showBackground = true, showSystemUi = true) +@Preview private fun PaymentButtonPreview() { var state by rememberInlinedPaymentPrimaryButtonState() val coroutineScope = rememberCoroutineScope() diff --git a/android/src/main/java/com/komoju/android/sdk/ui/composables/InlinedWebView.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/composables/InlinedWebView.kt similarity index 51% rename from android/src/main/java/com/komoju/android/sdk/ui/composables/InlinedWebView.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/composables/InlinedWebView.kt index d95d442..4971a86 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/composables/InlinedWebView.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/composables/InlinedWebView.kt @@ -1,44 +1,49 @@ -package com.komoju.android.sdk.ui.composables +package com.komoju.mobile.sdk.ui.composables -import android.annotation.SuppressLint -import android.graphics.Color -import android.webkit.WebResourceRequest -import android.webkit.WebResourceResponse -import android.webkit.WebView import androidx.compose.foundation.Image import androidx.compose.foundation.clickable -import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.Icons import androidx.compose.material.icons.rounded.Close import androidx.compose.material3.Text -import androidx.compose.material3.ripple import androidx.compose.runtime.Composable -import androidx.compose.runtime.remember +import androidx.compose.runtime.DisposableEffect +import androidx.compose.runtime.LaunchedEffect import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import androidx.core.net.toUri -import com.kevinnzou.web.AccompanistWebViewClient -import com.kevinnzou.web.WebView -import com.kevinnzou.web.rememberWebViewState -import com.komoju.android.sdk.R +import com.eygraber.uri.Uri +import com.multiplatform.webview.request.RequestInterceptor +import com.multiplatform.webview.request.WebRequest +import com.multiplatform.webview.request.WebRequestInterceptResult +import com.multiplatform.webview.web.WebView +import com.multiplatform.webview.web.WebViewNavigator +import com.multiplatform.webview.web.rememberWebViewNavigator +import com.multiplatform.webview.web.rememberWebViewState +import kotlin.time.Duration.Companion.seconds +import kotlinx.coroutines.delay -@SuppressLint("SetJavaScriptEnabled") @Composable internal fun InlinedWebView( modifier: Modifier, url: String, + appScheme: String, onDone: (String) -> Unit, onChallengePresented: () -> Unit, onCloseButtonClicked: () -> Unit, ) { + LaunchedEffect(url) { + delay(5.seconds) // TODO: Workaround as of now, replace with actual challenge detection + onChallengePresented() + } val state = rememberWebViewState(url) Column(modifier = modifier) { Row( @@ -61,8 +66,6 @@ internal fun InlinedWebView( contentDescription = "Close Payment Sheet", modifier = Modifier .clickable( - indication = ripple(bounded = true, radius = 24.dp), - interactionSource = remember { MutableInteractionSource() }, onClick = { onCloseButtonClicked() }, @@ -71,47 +74,44 @@ internal fun InlinedWebView( ) } WebView( - modifier = Modifier.weight(1f), + modifier = Modifier.fillMaxSize(), state = state, - onCreated = { nativeWebView -> - nativeWebView.clipToOutline = true - nativeWebView.setBackgroundColor(Color.TRANSPARENT) - nativeWebView.settings.apply { - domStorageEnabled = true - javaScriptEnabled = true - } - }, captureBackPresses = false, - client = remember { InlinedWebViewClient(onDone, onChallengePresented) }, + navigator = rememberWebViewNavigator( + requestInterceptor = WebViewRequestInterceptor( + onDeeplinkCaptured = onDone, + appScheme = appScheme, + ), + ), ) + DisposableEffect(Unit) { + state.webSettings.apply { + isJavaScriptEnabled = true + androidWebSettings.apply { + backgroundColor = Color.Transparent + domStorageEnabled = true + } + } + onDispose { } + } } } -private class InlinedWebViewClient(private val onDeeplinkCaptured: (String) -> Unit, private val onChallengePresented: () -> Unit) : - AccompanistWebViewClient() { - @Deprecated("Deprecated in Java") - override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean = view.checkAndOpen(url) - override fun shouldOverrideUrlLoading(view: WebView, request: WebResourceRequest): Boolean = view.checkAndOpen(request.url.toString()) +private class WebViewRequestInterceptor(private val onDeeplinkCaptured: (String) -> Unit, private val appScheme: String) : + RequestInterceptor { + override fun onInterceptUrlRequest(request: WebRequest, navigator: WebViewNavigator): WebRequestInterceptResult = request.checkAndOpen() - private fun WebView.checkAndOpen(url: String): Boolean { + private fun WebRequest.checkAndOpen(): WebRequestInterceptResult { try { - val uri = url.toUri() - if (uri.scheme == resources.getString(R.string.komoju_consumer_app_scheme)) { + val uri = Uri.parse(url) + if (uri.scheme == appScheme) { onDeeplinkCaptured(url) - return true + return WebRequestInterceptResult.Reject } else { error("Unsupported scheme for deeplink, load in webView Instead.") } } catch (_: Exception) { - loadUrl(url) - return false - } - } - - override fun shouldInterceptRequest(view: WebView?, request: WebResourceRequest?): WebResourceResponse? { - if (request?.url.toString().contains("acs-challenge.testlab.3dsecure.cloud")) { - onChallengePresented() + return WebRequestInterceptResult.Allow } - return super.shouldInterceptRequest(view, request) } } diff --git a/android/src/main/java/com/komoju/android/sdk/ui/composables/PrimaryButton.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/composables/PrimaryButton.kt similarity index 73% rename from android/src/main/java/com/komoju/android/sdk/ui/composables/PrimaryButton.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/composables/PrimaryButton.kt index 9006016..0e33482 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/composables/PrimaryButton.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/composables/PrimaryButton.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.composables +package com.komoju.mobile.sdk.ui.composables import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxWidth @@ -11,13 +11,13 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import com.komoju.android.sdk.ui.theme.KomojuMobileSdkTheme -import com.komoju.android.sdk.ui.theme.LocalConfigurableTheme +import com.komoju.mobile.sdk.ui.theme.KomojuMobileSdkTheme +import com.komoju.mobile.sdk.ui.theme.LocalConfigurableTheme +import com.komoju.mobile.sdk.ui.theme.toColor +import org.jetbrains.compose.ui.tooling.preview.Preview @Composable internal fun PrimaryButton(text: String, modifier: Modifier = Modifier, onClick: () -> Unit) { @@ -26,10 +26,10 @@ internal fun PrimaryButton(text: String, modifier: Modifier = Modifier, onClick: modifier = modifier, onClick = onClick, colors = ButtonDefaults.buttonColors( - containerColor = Color(configurableTheme.primaryButtonColor), - contentColor = Color(configurableTheme.primaryButtonContentColor), + containerColor = configurableTheme.primaryColor.toColor(), + contentColor = configurableTheme.primaryContentColor.toColor(), ), - shape = RoundedCornerShape(configurableTheme.primaryButtonCornerRadiusInDP.dp), + shape = RoundedCornerShape(configurableTheme.primaryShapeCornerRadiusInDp.dp), ) { Box( modifier = Modifier @@ -43,7 +43,7 @@ internal fun PrimaryButton(text: String, modifier: Modifier = Modifier, onClick: } @Composable -@Preview(showBackground = true, showSystemUi = true) +@Preview private fun PaymentButtonPreview() { KomojuMobileSdkTheme { PrimaryButton( diff --git a/android/src/main/java/com/komoju/android/sdk/ui/composables/TextButton.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/composables/TextButton.kt similarity index 95% rename from android/src/main/java/com/komoju/android/sdk/ui/composables/TextButton.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/composables/TextButton.kt index e5ad509..77e1ced 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/composables/TextButton.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/composables/TextButton.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.composables +package com.komoju.mobile.sdk.ui.composables import androidx.compose.foundation.layout.padding import androidx.compose.foundation.shape.RoundedCornerShape diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/composables/ThemedCircularProgressIndicator.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/composables/ThemedCircularProgressIndicator.kt new file mode 100644 index 0000000..8c42760 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/composables/ThemedCircularProgressIndicator.kt @@ -0,0 +1,12 @@ +package com.komoju.mobile.sdk.ui.composables + +import androidx.compose.material3.CircularProgressIndicator +import androidx.compose.runtime.Composable +import com.komoju.mobile.sdk.ui.theme.LocalConfigurableTheme +import com.komoju.mobile.sdk.ui.theme.toColor + +@Composable +internal fun ThemedCircularProgressIndicator() { + val configuration = LocalConfigurableTheme.current + CircularProgressIndicator(color = configuration.loaderColor.toColor()) +} diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcAlipay.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcAlipay.kt new file mode 100644 index 0000000..eee329a --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcAlipay.kt @@ -0,0 +1,69 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.PathFillType +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.Alipay: ImageVector + get() { + if (_KomojuIcAlipay != null) { + return _KomojuIcAlipay!! + } + _KomojuIcAlipay = ImageVector.Builder( + name = "KomojuIcAlipay", + defaultWidth = 38.dp, + defaultHeight = 38.dp, + viewportWidth = 38f, + viewportHeight = 38f, + ).apply { + path( + fill = SolidColor(Color(0xFF1677FF)), + pathFillType = PathFillType.EvenOdd, + ) { + moveTo(30.862f, 23.864f) + curveTo(36.233f, 25.688f, 37.519f, 25.764f, 37.519f, 25.764f) + verticalLineTo(6.08f) + curveTo(37.519f, 2.736f, 34.796f, 0f, 31.543f, 0f) + horizontalLineTo(5.976f) + curveTo(2.723f, 0f, 0f, 2.736f, 0f, 6.08f) + verticalLineTo(31.92f) + curveTo(0f, 35.264f, 2.723f, 38f, 5.976f, 38f) + horizontalLineTo(31.468f) + curveTo(34.796f, 38f, 37.443f, 35.264f, 37.443f, 31.92f) + verticalLineTo(31.692f) + curveTo(37.443f, 31.692f, 27.685f, 27.588f, 22.768f, 25.156f) + curveTo(19.44f, 29.26f, 15.204f, 31.768f, 10.817f, 31.768f) + curveTo(3.328f, 31.768f, 0.756f, 25.156f, 4.312f, 20.748f) + curveTo(5.068f, 19.76f, 6.43f, 18.924f, 8.472f, 18.392f) + curveTo(11.649f, 17.632f, 16.717f, 18.924f, 21.483f, 20.444f) + curveTo(22.315f, 18.848f, 23.071f, 17.1f, 23.601f, 15.2f) + horizontalLineTo(8.926f) + verticalLineTo(13.68f) + horizontalLineTo(16.49f) + verticalLineTo(11.02f) + horizontalLineTo(7.337f) + verticalLineTo(9.5f) + horizontalLineTo(16.49f) + verticalLineTo(5.7f) + curveTo(16.49f, 5.7f, 16.49f, 5.016f, 17.171f, 5.016f) + horizontalLineTo(20.878f) + verticalLineTo(9.5f) + horizontalLineTo(29.955f) + verticalLineTo(11.02f) + horizontalLineTo(20.878f) + verticalLineTo(13.68f) + horizontalLineTo(28.291f) + curveTo(27.61f, 16.644f, 26.475f, 19.304f, 25.189f, 21.66f) + curveTo(27.383f, 22.572f, 29.35f, 23.332f, 30.862f, 23.864f) + close() + } + }.build() + + return _KomojuIcAlipay!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcAlipay: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcAmex.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcAmex.kt new file mode 100644 index 0000000..185618d --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcAmex.kt @@ -0,0 +1,157 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.PathFillType +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.group +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.Amex: ImageVector + get() { + if (_KomojuIcAmex != null) { + return _KomojuIcAmex!! + } + _KomojuIcAmex = ImageVector.Builder( + name = "KomojuIcAmex", + defaultWidth = 24.dp, + defaultHeight = 17.dp, + viewportWidth = 24f, + viewportHeight = 17f, + ).apply { + group { + path(fill = SolidColor(Color(0xFF016FD0))) { + moveTo(22f, 0.5f) + horizontalLineTo(2f) + curveToRelative(-1.105f, 0f, -2f, 0.895f, -2f, 2f) + verticalLineToRelative(12f) + curveToRelative(0f, 1.105f, 0.895f, 2f, 2f, 2f) + horizontalLineToRelative(20f) + curveToRelative(1.105f, 0f, 2f, -0.895f, 2f, -2f) + verticalLineToRelative(-12f) + curveToRelative(0f, -1.105f, -0.895f, -2f, -2f, -2f) + close() + } + path( + fill = SolidColor(Color(0xFFFFFFFE)), + pathFillType = PathFillType.EvenOdd, + ) { + moveTo(13.764f, 13.894f) + verticalLineTo(8.193f) + lineToRelative(10.148f, 0.009f) + verticalLineToRelative(1.574f) + lineToRelative(-1.173f, 1.254f) + lineToRelative(1.173f, 1.265f) + verticalLineToRelative(1.608f) + horizontalLineToRelative(-1.873f) + lineToRelative(-0.995f, -1.098f) + lineToRelative(-0.988f, 1.102f) + lineToRelative(-6.292f, -0.013f) + close() + } + path( + fill = SolidColor(Color(0xFF016FD0)), + pathFillType = PathFillType.EvenOdd, + ) { + moveTo(14.442f, 13.269f) + verticalLineTo(8.82f) + horizontalLineToRelative(3.772f) + verticalLineToRelative(1.025f) + horizontalLineToRelative(-2.551f) + verticalLineToRelative(0.695f) + horizontalLineToRelative(2.49f) + verticalLineToRelative(1.008f) + horizontalLineToRelative(-2.49f) + verticalLineToRelative(0.684f) + horizontalLineToRelative(2.551f) + verticalLineToRelative(1.037f) + horizontalLineToRelative(-3.772f) + close() + } + path( + fill = SolidColor(Color(0xFF016FD0)), + pathFillType = PathFillType.EvenOdd, + ) { + moveTo(18.195f, 13.269f) + lineToRelative(2.088f, -2.227f) + lineToRelative(-2.088f, -2.222f) + horizontalLineToRelative(1.616f) + lineToRelative(1.275f, 1.41f) + lineToRelative(1.279f, -1.41f) + horizontalLineToRelative(1.547f) + verticalLineToRelative(0.035f) + lineToRelative(-2.043f, 2.187f) + lineToRelative(2.043f, 2.164f) + verticalLineToRelative(0.063f) + horizontalLineTo(22.35f) + lineToRelative(-1.298f, -1.424f) + lineToRelative(-1.285f, 1.424f) + horizontalLineToRelative(-1.572f) + close() + } + path( + fill = SolidColor(Color(0xFFFFFFFE)), + pathFillType = PathFillType.EvenOdd, + ) { + moveTo(14.237f, 3.132f) + horizontalLineToRelative(2.446f) + lineToRelative(0.86f, 1.951f) + verticalLineTo(3.132f) + horizontalLineToRelative(3.019f) + lineToRelative(0.521f, 1.462f) + lineToRelative(0.523f, -1.462f) + horizontalLineToRelative(2.306f) + verticalLineToRelative(5.701f) + horizontalLineTo(11.725f) + lineToRelative(2.512f, -5.701f) + close() + } + path( + fill = SolidColor(Color(0xFF016FD0)), + pathFillType = PathFillType.EvenOdd, + ) { + moveTo(14.7f, 3.751f) + lineToRelative(-1.974f, 4.446f) + horizontalLineToRelative(1.354f) + lineToRelative(0.373f, -0.891f) + horizontalLineToRelative(2.018f) + lineToRelative(0.372f, 0.891f) + horizontalLineToRelative(1.387f) + lineToRelative(-1.965f, -4.446f) + horizontalLineTo(14.7f) + close() + moveToRelative(0.17f, 2.558f) + lineToRelative(0.592f, -1.415f) + lineToRelative(0.591f, 1.415f) + horizontalLineTo(14.87f) + close() + } + path( + fill = SolidColor(Color(0xFF016FD0)), + pathFillType = PathFillType.EvenOdd, + ) { + moveTo(18.212f, 8.196f) + verticalLineTo(3.751f) + lineToRelative(1.903f, 0.006f) + lineToRelative(0.979f, 2.733f) + lineToRelative(0.986f, -2.739f) + horizontalLineToRelative(1.832f) + verticalLineToRelative(4.445f) + lineToRelative(-1.179f, 0.01f) + verticalLineTo(5.153f) + lineTo(21.62f, 8.196f) + horizontalLineToRelative(-1.075f) + lineToRelative(-1.136f, -3.054f) + verticalLineToRelative(3.054f) + horizontalLineToRelative(-1.197f) + close() + } + } + }.build() + + return _KomojuIcAmex!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcAmex: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcAppOpensInfo.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcAppOpensInfo.kt new file mode 100644 index 0000000..412c676 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcAppOpensInfo.kt @@ -0,0 +1,70 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.StrokeCap +import androidx.compose.ui.graphics.StrokeJoin +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.AppOpensInfo: ImageVector + get() { + if (_KomojuIcAppOpensInfo != null) { + return _KomojuIcAppOpensInfo!! + } + _KomojuIcAppOpensInfo = ImageVector.Builder( + name = "KomojuIcAppOpensInfo", + defaultWidth = 32.dp, + defaultHeight = 33.dp, + viewportWidth = 32f, + viewportHeight = 33f, + ).apply { + path(fill = SolidColor(Color(0xFFFFFFFF))) { + moveTo(16f, 0.5f) + lineTo(16f, 0.5f) + arcTo(16f, 16f, 0f, isMoreThanHalf = false, isPositiveArc = true, 32f, 16.5f) + lineTo(32f, 16.5f) + arcTo(16f, 16f, 0f, isMoreThanHalf = false, isPositiveArc = true, 16f, 32.5f) + lineTo(16f, 32.5f) + arcTo(16f, 16f, 0f, isMoreThanHalf = false, isPositiveArc = true, 0f, 16.5f) + lineTo(0f, 16.5f) + arcTo(16f, 16f, 0f, isMoreThanHalf = false, isPositiveArc = true, 16f, 0.5f) + close() + } + path(fill = SolidColor(Color(0xFFFFFFFF))) { + moveTo(6f, 6.5f) + horizontalLineToRelative(20f) + verticalLineToRelative(20f) + horizontalLineToRelative(-20f) + close() + } + path( + fill = SolidColor(Color(0xFFFFB800)), + stroke = SolidColor(Color(0xFFFFB800)), + strokeLineWidth = 2f, + strokeLineCap = StrokeCap.Round, + strokeLineJoin = StrokeJoin.Round, + ) { + moveTo(16.833f, 8.167f) + lineTo(9.411f, 17.073f) + curveTo(9.121f, 17.422f, 8.975f, 17.596f, 8.973f, 17.744f) + curveTo(8.971f, 17.872f, 9.028f, 17.994f, 9.128f, 18.074f) + curveTo(9.242f, 18.167f, 9.469f, 18.167f, 9.923f, 18.167f) + horizontalLineTo(16f) + lineTo(15.167f, 24.833f) + lineTo(22.589f, 15.927f) + curveTo(22.879f, 15.578f, 23.025f, 15.404f, 23.027f, 15.256f) + curveTo(23.029f, 15.128f, 22.972f, 15.006f, 22.872f, 14.926f) + curveTo(22.758f, 14.833f, 22.531f, 14.833f, 22.077f, 14.833f) + horizontalLineTo(16f) + lineTo(16.833f, 8.167f) + close() + } + }.build() + + return _KomojuIcAppOpensInfo!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcAppOpensInfo: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcAuPay.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcAuPay.kt new file mode 100644 index 0000000..7533dca --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcAuPay.kt @@ -0,0 +1,104 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.PathFillType +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.AuPay: ImageVector + get() { + if (_KomojuIcAuPay != null) { + return _KomojuIcAuPay!! + } + _KomojuIcAuPay = ImageVector.Builder( + name = "KomojuIcAuPay", + defaultWidth = 84.dp, + defaultHeight = 16.dp, + viewportWidth = 84f, + viewportHeight = 16f, + ).apply { + path( + fill = SolidColor(Color(0xFFEB560C)), + pathFillType = PathFillType.EvenOdd, + ) { + moveTo(49.52f, 16f) + horizontalLineToRelative(-2.77f) + verticalLineTo(0f) + horizontalLineTo(53f) + arcToRelative(5.55f, 5.55f, 0f, isMoreThanHalf = false, isPositiveArc = true, 5.24f, 5.6f) + arcTo(5.58f, 5.58f, 0f, isMoreThanHalf = false, isPositiveArc = true, 53f, 11.23f) + horizontalLineToRelative(-3.47f) + verticalLineTo(16f) + close() + moveToRelative(22.16f, 0f) + horizontalLineTo(68.7f) + lineToRelative(-0.92f, -3.09f) + horizontalLineToRelative(-5.65f) + lineTo(61.05f, 16f) + horizontalLineToRelative(-2.98f) + lineToRelative(5.68f, -16f) + horizontalLineToRelative(2.23f) + lineToRelative(5.7f, 16f) + close() + moveToRelative(6.49f, 0f) + horizontalLineToRelative(-2.6f) + verticalLineToRelative(-4.66f) + lineTo(69.72f, 0f) + horizontalLineToRelative(3.34f) + lineToRelative(3.8f, 8.06f) + lineTo(80.65f, 0f) + horizontalLineTo(84f) + lineToRelative(-5.83f, 11.34f) + verticalLineTo(16f) + close() + moveToRelative(-11.3f, -5.64f) + lineTo(64.9f, 4.64f) + lineToRelative(-1.93f, 5.72f) + horizontalLineToRelative(3.9f) + close() + moveTo(52.6f, 8.64f) + curveToRelative(0.53f, 0f, 2.73f, -0.59f, 2.73f, -3.06f) + curveToRelative(0f, -2.48f, -2.23f, -2.92f, -2.73f, -2.92f) + horizontalLineToRelative(-3.13f) + verticalLineToRelative(5.98f) + horizontalLineToRelative(3.13f) + close() + moveTo(17.41f, 0.06f) + curveToRelative(-2.05f, 9.23f, -4.24f, 13.43f, -2.87f, 13.67f) + curveToRelative(1.37f, 0.24f, 3f, -1.6f, 3.78f, -2.96f) + curveToRelative(0.94f, -1.63f, 1.33f, -5.65f, 2.49f, -8.04f) + curveToRelative(0.96f, -2f, 3.4f, -2.88f, 5.04f, -2.67f) + curveToRelative(-1.96f, 8.88f, -4.14f, 13.5f, -2.54f, 13.78f) + curveToRelative(2.02f, 0.35f, 4.1f, -1.24f, 5.03f, -2.87f) + curveToRelative(1.57f, -2.73f, 0.82f, -3.66f, 2.7f, -8.19f) + arcToRelative(5.36f, 5.36f, 0f, isMoreThanHalf = false, isPositiveArc = true, 5.03f, -2.76f) + curveTo(35.87f, 1.22f, 33f, 12.04f, 33f, 12.04f) + reflectiveCurveToRelative(-0.4f, 1.44f, 0.34f, 1.72f) + curveToRelative(1.47f, 0.57f, 6.1f, -5.59f, 7.63f, -8.42f) + horizontalLineToRelative(2.34f) + curveToRelative(-3.85f, 5.98f, -7.29f, 10.95f, -11.43f, 10.46f) + curveToRelative(-3.06f, -0.37f, -2.9f, -2.73f, -2.9f, -2.73f) + reflectiveCurveToRelative(-2.14f, 3.05f, -6.11f, 2.88f) + curveToRelative(-3.81f, -0.17f, -4.08f, -2.84f, -4.08f, -2.84f) + reflectiveCurveToRelative(-2.48f, 3f, -5.4f, 2.69f) + curveToRelative(-3.23f, -0.33f, -2.97f, -2.84f, -2.97f, -2.84f) + reflectiveCurveToRelative(-2.36f, 3.51f, -6.7f, 2.99f) + curveToRelative(-1.09f, -0.14f, -4.76f, -0.83f, -3.44f, -5.83f) + curveToRelative(2.43f, -9.2f, 9.4f, -10.4f, 17.13f, -10.06f) + close() + moveTo(12.4f, 1.9f) + curveToRelative(-0.85f, 4f, -1.68f, 7.18f, -2.82f, 9.13f) + curveToRelative(-1.5f, 2.57f, -3.63f, 3.13f, -4.7f, 2.8f) + curveToRelative(-1.5f, -0.45f, -0.36f, -4f, 0.42f, -5.61f) + curveToRelative(0.93f, -1.8f, 2.4f, -5.42f, 7.1f, -6.32f) + close() + } + }.build() + + return _KomojuIcAuPay!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcAuPay: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcBankTransfer.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcBankTransfer.kt new file mode 100644 index 0000000..13fd3fb --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcBankTransfer.kt @@ -0,0 +1,84 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.PathFillType +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.BankTransfer: ImageVector + get() { + if (_KomojuIcBankTransfer != null) { + return _KomojuIcBankTransfer!! + } + _KomojuIcBankTransfer = ImageVector.Builder( + name = "KomojuIcBankTransfer", + defaultWidth = 47.dp, + defaultHeight = 49.dp, + viewportWidth = 47f, + viewportHeight = 49f, + ).apply { + path( + fill = SolidColor(Color(0xFF1D354F)), + pathFillType = PathFillType.EvenOdd, + ) { + moveTo(0f, 12.408f) + lineTo(23.5f, 0f) + lineTo(47f, 12.408f) + verticalLineToRelative(4.136f) + horizontalLineTo(28.577f) + verticalLineToRelative(5.64f) + horizontalLineToRelative(-9.776f) + verticalLineToRelative(-5.64f) + horizontalLineToRelative(-6.017f) + verticalLineToRelative(5.64f) + horizontalLineTo(3.008f) + verticalLineToRelative(-5.64f) + horizontalLineTo(0f) + verticalLineToRelative(-4.136f) + close() + moveTo(47f, 43.24f) + verticalLineToRelative(5.64f) + horizontalLineTo(0f) + verticalLineToRelative(-5.64f) + horizontalLineToRelative(3.008f) + verticalLineToRelative(-4.512f) + horizontalLineToRelative(1.883f) + verticalLineTo(22.184f) + horizontalLineToRelative(6.016f) + verticalLineToRelative(16.544f) + horizontalLineToRelative(1.877f) + verticalLineToRelative(4.512f) + horizontalLineToRelative(6.017f) + verticalLineToRelative(-4.512f) + horizontalLineToRelative(1.879f) + verticalLineTo(22.184f) + horizontalLineToRelative(6.016f) + verticalLineToRelative(16.544f) + horizontalLineToRelative(1.881f) + verticalLineToRelative(4.512f) + horizontalLineToRelative(6.017f) + verticalLineToRelative(-4.511f) + horizontalLineToRelative(9.776f) + verticalLineToRelative(4.511f) + horizontalLineTo(47f) + close() + moveTo(34.594f, 16.544f) + horizontalLineToRelative(9.776f) + verticalLineToRelative(5.64f) + horizontalLineToRelative(-1.881f) + verticalLineToRelative(16.544f) + horizontalLineToRelative(-6.016f) + verticalLineTo(22.184f) + horizontalLineToRelative(-1.879f) + verticalLineToRelative(-5.64f) + close() + } + }.build() + + return _KomojuIcBankTransfer!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcBankTransfer: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcBitcash.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcBitcash.kt new file mode 100644 index 0000000..135316e --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcBitcash.kt @@ -0,0 +1,89 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.PathFillType +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.Bitcash: ImageVector + get() { + if (_KomojuIcBitcash != null) { + return _KomojuIcBitcash!! + } + _KomojuIcBitcash = ImageVector.Builder( + name = "KomojuIcBitcash", + defaultWidth = 56.dp, + defaultHeight = 54.dp, + viewportWidth = 218f, + viewportHeight = 211f, + ).apply { + path( + fill = SolidColor(Color(0xFF00388B)), + pathFillType = PathFillType.EvenOdd, + ) { + moveTo(196f, 135.2f) + arcToRelative(67.2f, 67.2f, 0f, isMoreThanHalf = false, isPositiveArc = true, -64.3f, 66.9f) + horizontalLineToRelative(-2.5f) + lineToRelative(-3.9f, -0.1f) + lineToRelative(-6.3f, -0.5f) + arcTo(98.5f, 98.5f, 0f, isMoreThanHalf = false, isPositiveArc = true, 129.2f, 5f) + horizontalLineToRelative(2f) + arcToRelative(51.6f, 51.6f, 0f, isMoreThanHalf = false, isPositiveArc = true, 41.6f, 79f) + arcToRelative(67.6f, 67.6f, 0f, isMoreThanHalf = false, isPositiveArc = true, 23.2f, 51.2f) + close() + moveToRelative(-40.5f, -0.5f) + arcToRelative(26.7f, 26.7f, 0f, isMoreThanHalf = false, isPositiveArc = false, -25.1f, -26.5f) + horizontalLineToRelative(-1.5f) + arcToRelative(20.3f, 20.3f, 0f, isMoreThanHalf = false, isPositiveArc = true, -20.3f, -20.3f) + arcToRelative(20f, 20f, 0f, isMoreThanHalf = false, isPositiveArc = true, 3.7f, -11.5f) + arcToRelative(20f, 20f, 0f, isMoreThanHalf = false, isPositiveArc = true, 16.6f, -8.8f) + arcToRelative(11f, 11f, 0f, isMoreThanHalf = false, isPositiveArc = false, 11.1f, -11f) + arcToRelative(11f, 11f, 0f, isMoreThanHalf = false, isPositiveArc = false, -3.3f, -7.8f) + curveToRelative(-2f, -2.1f, -4.9f, -3.3f, -7.8f, -3.3f) + horizontalLineToRelative(-3f) + curveToRelative(-0.9f, 0.2f, -1.8f, 0.4f, -2.8f, 0.4f) + arcToRelative(57.6f, 57.6f, 0f, isMoreThanHalf = false, isPositiveArc = false, -42f, 90f) + curveToRelative(2.2f, 2.9f, 4.3f, 5.7f, 6.9f, 8.4f) + arcToRelative(58.6f, 58.6f, 0f, isMoreThanHalf = false, isPositiveArc = false, 37.9f, 17f) + lineToRelative(3f, 0.1f) + horizontalLineToRelative(1.5f) + curveToRelative(14f, -0.8f, 25.1f, -12.5f, 25.1f, -26.7f) + close() + } + path(fill = SolidColor(Color(0xFFABCD03))) { + moveTo(155.5f, 134.9f) + arcToRelative(26.7f, 26.7f, 0f, isMoreThanHalf = false, isPositiveArc = true, -25.1f, 26.5f) + horizontalLineToRelative(-4f) + arcToRelative(47f, 47f, 0f, isMoreThanHalf = false, isPositiveArc = true, -30.6f, -79.9f) + curveToRelative(7.9f, -7.9f, 18.8f, -13f, 30.6f, -13.7f) + horizontalLineToRelative(2.5f) + arcToRelative(20.3f, 20.3f, 0f, isMoreThanHalf = false, isPositiveArc = false, 0f, 40.6f) + horizontalLineToRelative(1.5f) + curveToRelative(14f, 0.6f, 25.1f, 12.3f, 25.1f, 26.5f) + close() + } + path(fill = SolidColor(Color(0xFFE62E8B))) { + moveTo(130.6f, 161.4f) + horizontalLineToRelative(-4.5f) + arcToRelative(57.7f, 57.7f, 0f, isMoreThanHalf = false, isPositiveArc = true, -54.9f, -57.8f) + arcToRelative(57.8f, 57.8f, 0f, isMoreThanHalf = false, isPositiveArc = true, 54.9f, -57.9f) + horizontalLineToRelative(3f) + curveToRelative(2.9f, 0f, 5.7f, 1.2f, 7.8f, 3.2f) + arcToRelative(11f, 11f, 0f, isMoreThanHalf = false, isPositiveArc = true, 3.2f, 7.9f) + arcToRelative(11f, 11f, 0f, isMoreThanHalf = false, isPositiveArc = true, -11f, 11f) + horizontalLineToRelative(-2.5f) + curveToRelative(-12f, 0.7f, -22.7f, 5.8f, -30.7f, 13.7f) + arcToRelative(47.3f, 47.3f, 0f, isMoreThanHalf = false, isPositiveArc = false, 0f, 66.2f) + curveToRelative(8f, 8f, 18.8f, 13.1f, 30.7f, 13.7f) + horizontalLineToRelative(2.5f) + close() + } + }.build() + + return _KomojuIcBitcash!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcBitcash: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcCreditCard.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcCreditCard.kt new file mode 100644 index 0000000..e3f677f --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcCreditCard.kt @@ -0,0 +1,72 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.StrokeCap +import androidx.compose.ui.graphics.StrokeJoin +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.CreditCard: ImageVector + get() { + if (_KomojuIcCreditCard != null) { + return _KomojuIcCreditCard!! + } + _KomojuIcCreditCard = ImageVector.Builder( + name = "KomojuIcCreditCard", + defaultWidth = 32.dp, + defaultHeight = 33.dp, + viewportWidth = 32f, + viewportHeight = 33f, + ).apply { + path(fill = SolidColor(Color(0xFF79C3F8))) { + moveTo(2.667f, 11.433f) + verticalLineToRelative(2.4f) + horizontalLineToRelative(26.666f) + verticalLineToRelative(-2.4f) + curveToRelative(0f, -1.493f, 0f, -2.24f, -0.29f, -2.81f) + curveToRelative(-0.256f, -0.502f, -0.664f, -0.91f, -1.166f, -1.166f) + curveToRelative(-0.57f, -0.29f, -1.317f, -0.29f, -2.81f, -0.29f) + horizontalLineTo(6.933f) + curveToRelative(-1.493f, 0f, -2.24f, 0f, -2.81f, 0.29f) + curveToRelative(-0.502f, 0.256f, -0.91f, 0.664f, -1.166f, 1.166f) + curveToRelative(-0.29f, 0.57f, -0.29f, 1.317f, -0.29f, 2.81f) + close() + } + path( + stroke = SolidColor(Color(0xFF0F1C29)), + strokeLineWidth = 1.5f, + strokeLineCap = StrokeCap.Round, + strokeLineJoin = StrokeJoin.Round, + ) { + moveTo(29.333f, 13.833f) + horizontalLineTo(2.667f) + moveToRelative(12f, 5.334f) + horizontalLineTo(8f) + moveToRelative(-5.333f, -7.734f) + verticalLineToRelative(10.134f) + curveToRelative(0f, 1.493f, 0f, 2.24f, 0.29f, 2.81f) + curveToRelative(0.256f, 0.502f, 0.664f, 0.91f, 1.166f, 1.166f) + curveToRelative(0.57f, 0.29f, 1.317f, 0.29f, 2.81f, 0.29f) + horizontalLineToRelative(18.134f) + curveToRelative(1.493f, 0f, 2.24f, 0f, 2.81f, -0.29f) + curveToRelative(0.502f, -0.256f, 0.91f, -0.664f, 1.166f, -1.166f) + curveToRelative(0.29f, -0.57f, 0.29f, -1.317f, 0.29f, -2.81f) + verticalLineTo(11.433f) + curveToRelative(0f, -1.493f, 0f, -2.24f, -0.29f, -2.81f) + curveToRelative(-0.256f, -0.502f, -0.664f, -0.91f, -1.166f, -1.166f) + curveToRelative(-0.57f, -0.29f, -1.317f, -0.29f, -2.81f, -0.29f) + horizontalLineTo(6.933f) + curveToRelative(-1.493f, 0f, -2.24f, 0f, -2.81f, 0.29f) + curveToRelative(-0.502f, 0.256f, -0.91f, 0.664f, -1.166f, 1.166f) + curveToRelative(-0.29f, 0.57f, -0.29f, 1.317f, -0.29f, 2.81f) + close() + } + }.build() + + return _KomojuIcCreditCard!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcCreditCard: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcCvv.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcCvv.kt new file mode 100644 index 0000000..ec9cab5 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcCvv.kt @@ -0,0 +1,125 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.PathFillType +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.group +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.Cvv: ImageVector + get() { + if (_KomojuIcCvv != null) { + return _KomojuIcCvv!! + } + _KomojuIcCvv = ImageVector.Builder( + name = "KomojuIcCvv", + defaultWidth = 25.dp, + defaultHeight = 17.dp, + viewportWidth = 25f, + viewportHeight = 17f, + ).apply { + group { + path( + fill = SolidColor(Color(0xFF565656)), + fillAlpha = 0.2f, + strokeAlpha = 0.2f, + pathFillType = PathFillType.EvenOdd, + ) { + moveTo(16.52f, 2.02f) + horizontalLineToRelative(-15f) + curveTo(0.82f, 2.02f, 0f, 2.83f, 0f, 3.55f) + verticalLineToRelative(11.43f) + curveToRelative(0f, 0.71f, 0.82f, 1.52f, 1.52f, 1.52f) + horizontalLineToRelative(19.05f) + curveToRelative(0.7f, 0f, 1.53f, -0.8f, 1.53f, -1.52f) + verticalLineTo(9.24f) + curveToRelative(-0.65f, 0.58f, -1.44f, 0.96f, -2.3f, 1.1f) + verticalLineToRelative(0.06f) + curveToRelative(0f, 0.5f, -0.26f, 0.77f, -0.75f, 0.77f) + horizontalLineTo(2.29f) + curveToRelative(-0.5f, 0f, -0.77f, -0.26f, -0.77f, -0.77f) + verticalLineTo(9.64f) + curveToRelative(0f, -0.5f, 0.28f, -0.76f, 0.77f, -0.76f) + horizontalLineToRelative(13.35f) + arcToRelative(4.56f, 4.56f, 0f, isMoreThanHalf = false, isPositiveArc = true, 0.88f, -6.86f) + close() + } + path( + fill = SolidColor(Color(0xFF565656)), + fillAlpha = 0.3f, + strokeAlpha = 0.3f, + pathFillType = PathFillType.EvenOdd, + ) { + moveTo(14.74f, 4.31f) + horizontalLineTo(0f) + verticalLineTo(6.6f) + horizontalLineToRelative(14.54f) + arcToRelative(4.6f, 4.6f, 0f, isMoreThanHalf = false, isPositiveArc = true, 0.2f, -2.29f) + close() + } + path( + fill = SolidColor(Color(0xFF565656)), + pathFillType = PathFillType.EvenOdd, + ) { + moveTo(19.05f, 11.17f) + arcToRelative(5.33f, 5.33f, 0f, isMoreThanHalf = true, isPositiveArc = true, 0f, -10.67f) + arcToRelative(5.33f, 5.33f, 0f, isMoreThanHalf = false, isPositiveArc = true, 0f, 10.67f) + close() + moveToRelative(-2.12f, -7.55f) + horizontalLineToRelative(-0.6f) + lineToRelative(-1.47f, 0.75f) + verticalLineToRelative(0.76f) + lineToRelative(1.16f, -0.6f) + verticalLineToRelative(3.51f) + horizontalLineToRelative(0.92f) + verticalLineTo(3.62f) + horizontalLineToRelative(-0.01f) + close() + moveToRelative(1.75f, 0.61f) + curveToRelative(0.44f, 0f, 0.74f, 0.25f, 0.74f, 0.6f) + curveToRelative(0f, 0.38f, -0.36f, 0.65f, -0.88f, 0.65f) + horizontalLineToRelative(-0.22f) + verticalLineToRelative(0.64f) + horizontalLineToRelative(0.27f) + curveToRelative(0.55f, 0f, 0.92f, 0.28f, 0.92f, 0.67f) + curveToRelative(0f, 0.38f, -0.36f, 0.64f, -0.88f, 0.64f) + curveToRelative(-0.38f, 0f, -0.76f, -0.12f, -1.16f, -0.35f) + verticalLineToRelative(0.76f) + curveToRelative(0.43f, 0.18f, 0.85f, 0.28f, 1.27f, 0.28f) + curveToRelative(1f, 0f, 1.69f, -0.51f, 1.69f, -1.25f) + curveToRelative(0f, -0.52f, -0.32f, -0.94f, -0.86f, -1.1f) + curveToRelative(0.46f, -0.16f, 0.76f, -0.56f, 0.76f, -1.02f) + curveToRelative(0f, -0.71f, -0.63f, -1.2f, -1.55f, -1.2f) + curveToRelative(-0.41f, 0f, -0.82f, 0.09f, -1.2f, 0.26f) + verticalLineToRelative(0.74f) + curveToRelative(0.37f, -0.2f, 0.74f, -0.32f, 1.1f, -0.32f) + close() + moveToRelative(3.3f, 1.66f) + curveToRelative(0.55f, 0f, 0.94f, 0.33f, 0.94f, 0.76f) + curveToRelative(0f, 0.45f, -0.39f, 0.76f, -0.95f, 0.76f) + curveToRelative(-0.33f, 0f, -0.68f, -0.1f, -1.04f, -0.33f) + verticalLineToRelative(0.79f) + curveToRelative(0.37f, 0.17f, 0.75f, 0.25f, 1.13f, 0.25f) + curveToRelative(0.2f, 0f, 0.38f, -0.03f, 0.55f, -0.08f) + curveToRelative(0.4f, -0.64f, 0.63f, -1.4f, 0.63f, -2.2f) + lineToRelative(-0.02f, -0.31f) + curveToRelative(-0.28f, -0.17f, -0.6f, -0.25f, -0.93f, -0.25f) + curveToRelative(-0.14f, 0f, -0.29f, 0.01f, -0.44f, 0.04f) + verticalLineToRelative(-1f) + horizontalLineToRelative(1.1f) + curveToRelative(-0.1f, -0.24f, -0.21f, -0.47f, -0.35f, -0.7f) + horizontalLineToRelative(-1.54f) + verticalLineToRelative(2.4f) + curveToRelative(0.3f, -0.07f, 0.6f, -0.13f, 0.91f, -0.13f) + close() + } + } + }.build() + + return _KomojuIcCvv!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcCvv: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcDailyYamazaki.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcDailyYamazaki.kt new file mode 100644 index 0000000..b0afb8d --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcDailyYamazaki.kt @@ -0,0 +1,664 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.group +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp +import kotlin.Suppress + +val KomojuIcon.DailyYamazaki: ImageVector + get() { + if (_KomojuIcDailyYamazaki != null) { + return _KomojuIcDailyYamazaki!! + } + _KomojuIcDailyYamazaki = ImageVector.Builder( + name = "KomojuIcDailyYamazaki", + defaultWidth = 32.dp, + defaultHeight = 32.dp, + viewportWidth = 32f, + viewportHeight = 32f, + ).apply { + path(fill = SolidColor(Color(0xFFFFE9EA))) { + moveTo(5.333f, 0f) + horizontalLineToRelative(21.334f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 32f, 5.333f) + verticalLineToRelative(21.334f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 26.667f, 32f) + horizontalLineTo(5.333f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 0f, 26.667f) + verticalLineTo(5.333f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 5.333f, 0f) + close() + } + group { + path(fill = SolidColor(Color(0xFFD71718))) { + moveTo(27.704f, 10.323f) + curveToRelative(0.526f, 0f, 0.953f, 0.429f, 0.953f, 0.955f) + verticalLineToRelative(9.445f) + curveToRelative(0f, 0.526f, -0.427f, 0.955f, -0.953f, 0.955f) + horizontalLineTo(4.299f) + curveToRelative(-0.526f, 0f, -0.955f, -0.43f, -0.955f, -0.955f) + verticalLineToRelative(-9.445f) + curveToRelative(0f, -0.526f, 0.429f, -0.955f, 0.955f, -0.955f) + horizontalLineToRelative(23.405f) + close() + } + path( + stroke = SolidColor(Color(0xFFFFFFFF)), + strokeLineWidth = 0.0736638f, + ) { + moveTo(27.704f, 10.323f) + curveToRelative(0.526f, 0f, 0.953f, 0.429f, 0.953f, 0.955f) + verticalLineToRelative(9.445f) + curveToRelative(0f, 0.526f, -0.427f, 0.955f, -0.953f, 0.955f) + horizontalLineTo(4.299f) + curveToRelative(-0.526f, 0f, -0.955f, -0.43f, -0.955f, -0.955f) + verticalLineToRelative(-9.445f) + curveToRelative(0f, -0.526f, 0.429f, -0.955f, 0.955f, -0.955f) + horizontalLineToRelative(23.405f) + close() + } + path(fill = SolidColor(Color(0xFFD71718))) { + moveTo(27.704f, 10.323f) + curveToRelative(0.526f, 0f, 0.953f, 0.429f, 0.953f, 0.955f) + verticalLineToRelative(9.445f) + curveToRelative(0f, 0.526f, -0.427f, 0.955f, -0.953f, 0.955f) + horizontalLineTo(4.299f) + curveToRelative(-0.526f, 0f, -0.955f, -0.43f, -0.955f, -0.955f) + verticalLineToRelative(-9.445f) + curveToRelative(0f, -0.526f, 0.429f, -0.955f, 0.955f, -0.955f) + horizontalLineToRelative(23.405f) + close() + } + path(fill = SolidColor(Color(0xFFFFFFFF))) { + moveTo(8.654f, 18.47f) + curveToRelative(1.495f, 0f, 2.708f, -1.306f, 2.708f, -2.916f) + curveToRelative(0f, -1.61f, -1.213f, -2.917f, -2.708f, -2.917f) + reflectiveCurveToRelative(-2.706f, 1.306f, -2.706f, 2.917f) + curveToRelative(0f, 1.61f, 1.211f, 2.916f, 2.706f, 2.916f) + close() + } + path(fill = SolidColor(Color(0xFF430307))) { + moveTo(27.522f, 14.173f) + curveToRelative(-0.05f, -0.088f, -0.147f, -0.138f, -0.268f, -0.138f) + horizontalLineToRelative(-1.913f) + curveToRelative(-0.168f, 0f, -0.355f, 0.092f, -0.47f, 0.221f) + curveToRelative(-0.081f, -0.132f, -0.229f, -0.221f, -0.387f, -0.221f) + horizontalLineToRelative(-1.533f) + lineToRelative(0.225f, -1.282f) + curveToRelative(0.018f, -0.109f, -0.012f, -0.218f, -0.078f, -0.299f) + curveToRelative(-0.067f, -0.08f, -0.171f, -0.127f, -0.281f, -0.127f) + horizontalLineToRelative(-1.898f) + curveToRelative(-0.126f, 0f, -0.244f, 0.056f, -0.331f, 0.146f) + curveToRelative(-0.148f, -0.098f, -0.328f, -0.148f, -0.535f, -0.152f) + verticalLineToRelative(-0.003f) + horizontalLineToRelative(-0.741f) + verticalLineToRelative(0.005f) + curveToRelative(-0.276f, 0.005f, -0.531f, 0.091f, -0.758f, 0.255f) + curveToRelative(-0.239f, 0.172f, -0.386f, 0.384f, -0.437f, 0.629f) + curveToRelative(-0.053f, 0.253f, 0.014f, 0.483f, 0.193f, 0.668f) + curveToRelative(0.065f, 0.065f, 0.138f, 0.119f, 0.22f, 0.16f) + horizontalLineToRelative(-0.103f) + verticalLineToRelative(-0.002f) + horizontalLineToRelative(-0.71f) + verticalLineToRelative(0.002f) + horizontalLineToRelative(-0.836f) + verticalLineToRelative(-0.002f) + horizontalLineToRelative(-1.607f) + curveToRelative(-0.124f, -0.028f, -0.262f, -0.043f, -0.416f, -0.043f) + curveToRelative(-0.569f, 0f, -1.068f, 0.212f, -1.485f, 0.63f) + curveToRelative(-0.048f, 0.046f, -0.093f, 0.094f, -0.134f, 0.141f) + curveToRelative(-0.009f, -0.044f, -0.038f, -0.2f, -0.058f, -0.275f) + curveToRelative(-0.037f, -0.154f, -0.068f, -0.245f, -0.094f, -0.325f) + lineToRelative(-0.025f, -0.081f) + lineToRelative(-0.001f, -0.004f) + lineToRelative(-0.002f, -0.002f) + curveToRelative(-0.236f, -0.644f, -0.582f, -1.029f, -0.861f, -1.294f) + curveToRelative(-0.321f, -0.293f, -0.836f, -0.618f, -1.195f, -0.76f) + curveToRelative(-0.324f, -0.127f, -0.525f, -0.186f, -0.843f, -0.24f) + curveToRelative(-0.909f, -0.2f, -2.22f, -0.074f, -2.22f, -0.074f) + lineToRelative(0.007f, 0.006f) + curveToRelative(-0.167f, 0.012f, -0.331f, 0.031f, -0.478f, 0.063f) + curveToRelative(-0.852f, 0.18f, -1.316f, 0.491f, -1.376f, 0.535f) + lineToRelative(0.006f, -0.004f) + lineToRelative(-0.015f, 0.009f) + lineToRelative(0.008f, -0.005f) + curveToRelative(-0.086f, 0.048f, -0.816f, 0.493f, -1.179f, 1.394f) + curveToRelative(-0.295f, 0.728f, -0.229f, 1.202f, -0.191f, 1.485f) + curveToRelative(0.07f, 0.499f, 0.222f, 0.913f, 0.466f, 1.267f) + curveToRelative(0.169f, 0.247f, 0.38f, 0.446f, 0.491f, 0.545f) + curveToRelative(-0.176f, 0.415f, -0.583f, 1.379f, -0.606f, 1.537f) + curveToRelative(-0.05f, 0.336f, 0f, 0.559f, 0.186f, 0.826f) + curveToRelative(0.223f, 0.323f, 0.647f, 0.6f, 1.257f, 0.821f) + curveToRelative(0.242f, 0.088f, 0.549f, 0.138f, 0.88f, 0.157f) + lineToRelative(-0.004f, 0.001f) + reflectiveCurveToRelative(0.672f, 0.07f, 1.46f, -0.008f) + curveToRelative(0.486f, -0.034f, 0.957f, -0.121f, 1.296f, -0.243f) + curveToRelative(0.86f, -0.311f, 1.321f, -0.675f, 1.669f, -1.023f) + lineToRelative(0.026f, 0.105f) + lineToRelative(0.016f, 0.056f) + lineToRelative(-0.104f, 0.583f) + curveToRelative(-0.013f, 0.068f, 0.005f, 0.135f, 0.046f, 0.186f) + curveToRelative(0.042f, 0.049f, 0.104f, 0.078f, 0.172f, 0.078f) + horizontalLineToRelative(0.236f) + lineToRelative(0.022f, -0.002f) + lineToRelative(0.017f, 0.002f) + horizontalLineToRelative(0.237f) + curveToRelative(0.026f, 0f, 0.054f, -0.006f, 0.078f, -0.014f) + curveToRelative(0.024f, 0.008f, 0.05f, 0.013f, 0.078f, 0.013f) + horizontalLineTo(12.9f) + lineToRelative(0.004f, -0.001f) + lineToRelative(0.012f, 0.001f) + horizontalLineToRelative(0.257f) + curveToRelative(0.049f, 0f, 0.098f, -0.014f, 0.139f, -0.039f) + curveToRelative(0.037f, 0.025f, 0.082f, 0.039f, 0.131f, 0.039f) + horizontalLineTo(13.7f) + lineToRelative(0.008f, -0.001f) + lineToRelative(0.008f, 0.001f) + horizontalLineToRelative(0.258f) + lineToRelative(0.023f, -0.002f) + lineToRelative(0.008f, 0.001f) + horizontalLineToRelative(0.235f) + lineToRelative(0.023f, -0.002f) + lineToRelative(0.017f, 0.002f) + horizontalLineToRelative(0.235f) + lineToRelative(0.019f, -0.002f) + lineToRelative(0.018f, 0.002f) + horizontalLineToRelative(0.17f) + curveToRelative(0.018f, 0f, 0.035f, -0.003f, 0.054f, -0.007f) + curveToRelative(0.015f, 0.004f, 0.033f, 0.007f, 0.052f, 0.007f) + horizontalLineToRelative(0.169f) + lineToRelative(0.018f, -0.002f) + lineToRelative(0.018f, 0.002f) + horizontalLineToRelative(0.237f) + lineToRelative(0.02f, -0.002f) + lineToRelative(0.019f, 0.002f) + horizontalLineToRelative(0.235f) + lineToRelative(0.005f, -0.001f) + lineToRelative(0.028f, 0.002f) + horizontalLineToRelative(0.258f) + lineToRelative(0.007f, -0.001f) + lineToRelative(0.006f, 0.001f) + horizontalLineToRelative(0.263f) + curveToRelative(0.048f, 0f, 0.094f, -0.014f, 0.138f, -0.039f) + curveToRelative(0.036f, 0.025f, 0.083f, 0.039f, 0.129f, 0.039f) + horizontalLineToRelative(0.26f) + lineToRelative(0.008f, -0.001f) + lineToRelative(0.007f, 0.001f) + horizontalLineToRelative(0.258f) + lineToRelative(0.014f, -0.001f) + lineToRelative(0.02f, 0.001f) + horizontalLineToRelative(1.167f) + lineToRelative(0.012f, -0.001f) + lineToRelative(0.008f, 0.001f) + horizontalLineToRelative(0.259f) + lineToRelative(0.007f, -0.001f) + lineToRelative(0.01f, 0.001f) + horizontalLineToRelative(0.259f) + curveToRelative(0.047f, 0f, 0.094f, -0.014f, 0.138f, -0.039f) + curveToRelative(0.037f, 0.025f, 0.081f, 0.039f, 0.129f, 0.039f) + horizontalLineToRelative(0.259f) + lineToRelative(0.008f, -0.001f) + lineToRelative(0.007f, 0.001f) + horizontalLineToRelative(0.261f) + lineToRelative(0.007f, -0.001f) + lineToRelative(0.018f, 0.001f) + horizontalLineToRelative(0.236f) + lineToRelative(0.023f, -0.001f) + lineToRelative(0.016f, 0.001f) + horizontalLineToRelative(0.237f) + curveToRelative(0.033f, 0f, 0.068f, -0.009f, 0.099f, -0.022f) + curveToRelative(0.03f, 0.013f, 0.065f, 0.022f, 0.099f, 0.022f) + horizontalLineToRelative(0.782f) + lineToRelative(0.021f, -0.001f) + lineToRelative(0.019f, 0.001f) + horizontalLineToRelative(0.237f) + curveToRelative(0.122f, 0f, 0.232f, -0.092f, 0.253f, -0.214f) + lineToRelative(0.252f, -1.424f) + curveToRelative(0.011f, -0.066f, -0.007f, -0.135f, -0.049f, -0.185f) + curveToRelative(-0.042f, -0.051f, -0.104f, -0.078f, -0.171f, -0.078f) + horizontalLineToRelative(-0.235f) + lineToRelative(-0.021f, 0.001f) + lineToRelative(-0.018f, -0.001f) + horizontalLineToRelative(-0.235f) + curveToRelative(-0.015f, 0f, -0.026f, 0.001f, -0.039f, 0.003f) + horizontalLineToRelative(-0.544f) + curveToRelative(-0.026f, 0f, -0.055f, 0.005f, -0.082f, 0.014f) + curveToRelative(-0.024f, -0.009f, -0.053f, -0.016f, -0.082f, -0.016f) + horizontalLineToRelative(-0.237f) + lineToRelative(-0.019f, 0.002f) + lineToRelative(-0.019f, -0.002f) + horizontalLineToRelative(-0.235f) + curveToRelative(-0.074f, 0f, -0.144f, 0.035f, -0.192f, 0.089f) + curveToRelative(-0.046f, -0.055f, -0.113f, -0.09f, -0.187f, -0.09f) + horizontalLineToRelative(-0.627f) + curveToRelative(-0.072f, 0f, -0.148f, 0.034f, -0.201f, 0.086f) + curveToRelative(-0.002f, -0.002f, -0.003f, -0.006f, -0.006f, -0.008f) + curveToRelative(-0.04f, -0.05f, -0.104f, -0.077f, -0.17f, -0.077f) + horizontalLineToRelative(-1.166f) + curveToRelative(-0.075f, 0f, -0.147f, 0.037f, -0.196f, 0.093f) + curveToRelative(-0.046f, -0.055f, -0.115f, -0.093f, -0.191f, -0.093f) + horizontalLineToRelative(-0.627f) + curveToRelative(-0.076f, 0f, -0.152f, 0.036f, -0.207f, 0.093f) + lineToRelative(-0.008f, -0.015f) + curveToRelative(-0.043f, -0.05f, -0.107f, -0.078f, -0.172f, -0.078f) + horizontalLineToRelative(-0.674f) + curveToRelative(-0.033f, 0f, -0.064f, 0.008f, -0.096f, 0.02f) + curveToRelative(-0.014f, -0.006f, -0.027f, -0.01f, -0.042f, -0.013f) + verticalLineToRelative(-0.021f) + curveToRelative(0.131f, -0.016f, 0.251f, -0.048f, 0.359f, -0.088f) + curveToRelative(0.039f, 0.011f, 0.086f, 0.018f, 0.131f, 0.018f) + horizontalLineToRelative(1.864f) + curveToRelative(0.022f, 0f, 0.04f, -0.002f, 0.059f, -0.004f) + horizontalLineToRelative(0.234f) + curveToRelative(0.018f, 0.002f, 0.036f, 0.004f, 0.056f, 0.004f) + horizontalLineToRelative(1.899f) + curveToRelative(0.019f, 0f, 0.038f, -0.002f, 0.056f, -0.004f) + horizontalLineToRelative(0.233f) + curveToRelative(0.016f, 0.002f, 0.031f, 0.004f, 0.048f, 0.004f) + horizontalLineToRelative(1.898f) + curveToRelative(0.216f, 0f, 0.414f, -0.167f, 0.451f, -0.379f) + lineToRelative(0.297f, -1.703f) + lineToRelative(0.304f, 1.176f) + curveToRelative(0.029f, 0.106f, 0f, 0.292f, -0.055f, 0.385f) + lineToRelative(-1.269f, 2.069f) + curveToRelative(-0.061f, 0.103f, -0.069f, 0.214f, -0.02f, 0.301f) + curveToRelative(0.05f, 0.088f, 0.15f, 0.137f, 0.27f, 0.137f) + horizontalLineToRelative(1.866f) + curveToRelative(0.196f, 0f, 0.423f, -0.126f, 0.526f, -0.294f) + lineToRelative(3.273f, -5.309f) + curveToRelative(0.062f, -0.105f, 0.07f, -0.215f, 0.022f, -0.302f) + close() + moveToRelative(-17.427f, 2.305f) + curveToRelative(-0.221f, 0.472f, -0.498f, 0.836f, -0.827f, 1.081f) + curveToRelative(-0.201f, 0.153f, -0.407f, 0.268f, -0.576f, 0.329f) + lineTo(8.68f, 17.892f) + curveToRelative(-0.011f, -0.005f, -0.021f, -0.011f, -0.027f, -0.016f) + lineToRelative(-0.008f, -0.005f) + lineToRelative(-0.008f, -0.006f) + lineToRelative(-0.008f, -0.004f) + curveToRelative(-0.057f, -0.03f, -0.094f, -0.068f, -0.121f, -0.121f) + curveToRelative(-0.014f, -0.023f, -0.022f, -0.054f, -0.026f, -0.093f) + curveToRelative(-0.006f, -0.039f, -0.006f, -0.08f, 0f, -0.129f) + verticalLineToRelative(-0.01f) + lineToRelative(0.001f, -0.016f) + lineToRelative(0.002f, -0.009f) + lineToRelative(0.001f, -0.007f) + lineToRelative(0.001f, -0.004f) + curveToRelative(0.021f, -0.119f, 0.067f, -0.234f, 0.102f, -0.31f) + curveToRelative(0.031f, -0.063f, 0.12f, -0.254f, 0.149f, -0.323f) + lineToRelative(0.163f, -0.381f) + curveToRelative(0.109f, -0.259f, 0.212f, -0.503f, 0.272f, -0.654f) + lineToRelative(0.078f, -0.196f) + curveToRelative(0.103f, -0.25f, 0.228f, -0.561f, 0.271f, -0.72f) + lineToRelative(-0.001f, 0.007f) + curveToRelative(0.011f, -0.03f, 0.017f, -0.062f, 0.017f, -0.097f) + verticalLineToRelative(0.014f) + curveToRelative(0.004f, -0.018f, 0.004f, -0.034f, 0f, -0.049f) + curveToRelative(0f, -0.016f, -0.004f, -0.031f, -0.008f, -0.047f) + curveToRelative(-0.019f, -0.076f, -0.065f, -0.147f, -0.134f, -0.206f) + lineToRelative(0.002f, 0.001f) + lineToRelative(-0.002f, -0.001f) + lineToRelative(-0.008f, -0.009f) + lineToRelative(0.005f, 0.005f) + curveToRelative(-0.005f, -0.005f, -0.007f, -0.008f, -0.014f, -0.013f) + horizontalLineTo(9.38f) + curveToRelative(-0.113f, -0.098f, -0.241f, -0.173f, -0.37f, -0.23f) + horizontalLineToRelative(0.016f) + curveToRelative(-0.451f, -0.204f, -0.958f, -0.283f, -1.315f, -0.313f) + curveToRelative(0.1f, -0.056f, 0.221f, -0.105f, 0.369f, -0.147f) + curveToRelative(0.569f, -0.12f, 0.903f, -0.03f, 0.903f, -0.03f) + lineTo(8.942f, 13.76f) + curveToRelative(0.12f, 0.031f, 0.246f, 0.071f, 0.301f, 0.096f) + curveToRelative(0.208f, 0.094f, 0.303f, 0.145f, 0.439f, 0.268f) + curveToRelative(0.07f, 0.064f, 0.139f, 0.137f, 0.202f, 0.218f) + curveToRelative(0.069f, 0.09f, 0.122f, 0.178f, 0.182f, 0.289f) + curveToRelative(0.034f, 0.07f, 0.06f, 0.136f, 0.088f, 0.213f) + curveToRelative(0.049f, 0.138f, 0.083f, 0.301f, 0.105f, 0.495f) + curveToRelative(0.043f, 0.404f, -0.018f, 0.83f, -0.164f, 1.139f) + close() + moveToRelative(3.364f, 1.697f) + horizontalLineToRelative(-0.176f) + curveToRelative(-0.024f, 0f, -0.045f, 0.003f, -0.066f, 0.009f) + curveToRelative(-0.016f, -0.004f, -0.033f, -0.006f, -0.054f, -0.006f) + horizontalLineToRelative(-0.236f) + lineToRelative(-0.016f, 0.002f) + curveToRelative(-0.007f, -0.002f, -0.015f, -0.002f, -0.023f, -0.002f) + horizontalLineToRelative(-0.236f) + curveToRelative(-0.04f, 0f, -0.08f, 0.01f, -0.12f, 0.027f) + curveToRelative(0.131f, -0.209f, 0.251f, -0.441f, 0.355f, -0.674f) + curveToRelative(0.251f, 0.377f, 0.621f, 0.589f, 1.102f, 0.631f) + verticalLineToRelative(0.027f) + curveToRelative(-0.025f, -0.009f, -0.053f, -0.014f, -0.08f, -0.014f) + horizontalLineToRelative(-0.45f) + close() + moveToRelative(4.655f, 1.186f) + horizontalLineToRelative(-0.019f) + lineToRelative(0.038f, -0.05f) + lineToRelative(-0.019f, 0.05f) + close() + moveToRelative(-0.863f, -0.472f) + lineToRelative(-0.133f, 0.18f) + lineToRelative(-0.01f, -0.186f) + curveToRelative(0.016f, 0.005f, 0.032f, 0.006f, 0.049f, 0.006f) + horizontalLineToRelative(0.094f) + close() + } + path(fill = SolidColor(Color(0xFFF5E829))) { + moveTo(15.243f, 16.468f) + curveToRelative(-0.113f, 0.121f, -0.244f, 0.18f, -0.396f, 0.18f) + curveToRelative(-0.153f, 0f, -0.262f, -0.058f, -0.325f, -0.174f) + curveToRelative(-0.064f, -0.116f, -0.083f, -0.252f, -0.055f, -0.41f) + curveToRelative(0.029f, -0.158f, 0.094f, -0.294f, 0.202f, -0.409f) + curveToRelative(0.106f, -0.114f, 0.233f, -0.17f, 0.381f, -0.17f) + curveToRelative(0.151f, 0f, 0.263f, 0.06f, 0.333f, 0.18f) + curveToRelative(0.059f, 0.107f, 0.074f, 0.241f, 0.047f, 0.399f) + curveToRelative(-0.027f, 0.158f, -0.091f, 0.292f, -0.187f, 0.404f) + close() + moveToRelative(2.329f, -2.029f) + curveToRelative(0.026f, -0.147f, -0.075f, -0.266f, -0.221f, -0.266f) + horizontalLineToRelative(-1.18f) + curveToRelative(-0.147f, 0f, -0.291f, 0.119f, -0.315f, 0.266f) + lineToRelative(-0.028f, 0.151f) + curveToRelative(-0.16f, -0.308f, -0.481f, -0.462f, -0.969f, -0.462f) + curveToRelative(-0.533f, 0f, -0.997f, 0.196f, -1.39f, 0.589f) + curveToRelative(-0.368f, 0.367f, -0.601f, 0.826f, -0.696f, 1.372f) + curveToRelative(-0.097f, 0.546f, -0.021f, 1f, 0.224f, 1.362f) + curveToRelative(0.258f, 0.389f, 0.649f, 0.582f, 1.177f, 0.582f) + curveToRelative(0.509f, 0f, 0.932f, -0.342f, 0.932f, -0.342f) + curveToRelative(0.02f, -0.017f, 0.207f, -0.142f, 0.207f, -0.142f) + reflectiveCurveToRelative(-0.028f, 0.143f, -0.035f, 0.188f) + curveToRelative(-0.02f, 0.12f, 0.084f, 0.218f, 0.231f, 0.218f) + horizontalLineToRelative(1.178f) + curveToRelative(0.148f, 0f, 0.289f, -0.12f, 0.316f, -0.266f) + lineToRelative(0.569f, -3.25f) + close() + moveToRelative(2.53f, -1.205f) + curveToRelative(-0.043f, 0.212f, -0.173f, 0.392f, -0.385f, 0.544f) + curveToRelative(-0.214f, 0.15f, -0.448f, 0.227f, -0.703f, 0.227f) + curveToRelative(-0.256f, 0f, -0.458f, -0.076f, -0.606f, -0.227f) + curveToRelative(-0.15f, -0.152f, -0.202f, -0.332f, -0.157f, -0.544f) + curveToRelative(0.046f, -0.21f, 0.171f, -0.392f, 0.383f, -0.546f) + curveToRelative(0.211f, -0.152f, 0.447f, -0.23f, 0.709f, -0.23f) + curveToRelative(0.255f, 0f, 0.455f, 0.078f, 0.603f, 0.23f) + curveToRelative(0.149f, 0.154f, 0.201f, 0.336f, 0.156f, 0.546f) + close() + moveToRelative(-0.852f, 4.455f) + curveToRelative(-0.026f, 0.147f, -0.167f, 0.266f, -0.316f, 0.266f) + horizontalLineToRelative(-1.211f) + curveToRelative(-0.149f, 0f, -0.249f, -0.12f, -0.224f, -0.266f) + lineToRelative(0.568f, -3.25f) + curveToRelative(0.027f, -0.147f, 0.169f, -0.266f, 0.317f, -0.266f) + horizontalLineToRelative(1.212f) + curveToRelative(0.148f, 0f, 0.247f, 0.119f, 0.223f, 0.266f) + lineToRelative(-0.569f, 3.25f) + close() + moveToRelative(7.315f, -3.516f) + curveToRelative(0.149f, 0f, 0.206f, 0.104f, 0.13f, 0.23f) + lineToRelative(-3.272f, 5.307f) + curveToRelative(-0.078f, 0.126f, -0.262f, 0.229f, -0.411f, 0.229f) + horizontalLineToRelative(-1.177f) + curveToRelative(-0.147f, 0f, -0.207f, -0.103f, -0.132f, -0.23f) + lineToRelative(1.268f, -2.068f) + curveToRelative(0.075f, -0.127f, 0.108f, -0.347f, 0.071f, -0.491f) + lineToRelative(-0.703f, -2.716f) + curveToRelative(-0.037f, -0.144f, 0.054f, -0.261f, 0.202f, -0.261f) + horizontalLineToRelative(1.254f) + curveToRelative(0.148f, 0f, 0.291f, 0.119f, 0.317f, 0.266f) + lineToRelative(0.183f, 0.946f) + lineToRelative(0.638f, -0.981f) + curveToRelative(0.076f, -0.127f, 0.261f, -0.231f, 0.408f, -0.231f) + horizontalLineToRelative(1.224f) + close() + moveToRelative(-5.08f, 3.515f) + curveToRelative(-0.026f, 0.146f, -0.167f, 0.265f, -0.317f, 0.265f) + horizontalLineToRelative(-1.21f) + curveToRelative(-0.15f, 0f, -0.25f, -0.119f, -0.225f, -0.265f) + lineToRelative(0.87f, -4.958f) + curveToRelative(0.024f, -0.145f, 0.166f, -0.265f, 0.316f, -0.265f) + horizontalLineToRelative(1.21f) + curveToRelative(0.148f, 0f, 0.249f, 0.12f, 0.222f, 0.265f) + lineToRelative(-0.866f, 4.958f) + close() + moveTo(12.42f, 14.8f) + reflectiveCurveToRelative(-0.038f, -0.196f, -0.06f, -0.281f) + curveToRelative(-0.049f, -0.202f, -0.082f, -0.287f, -0.117f, -0.398f) + curveToRelative(-0.209f, -0.574f, -0.513f, -0.942f, -0.825f, -1.24f) + curveToRelative(-0.322f, -0.293f, -0.823f, -0.603f, -1.153f, -0.733f) + curveToRelative(-0.315f, -0.125f, -0.504f, -0.181f, -0.838f, -0.237f) + curveToRelative(-0.303f, -0.052f, -1.253f, -0.144f, -1.93f, 0f) + curveToRelative(-0.88f, 0.183f, -1.331f, 0.516f, -1.331f, 0.516f) + reflectiveCurveToRelative(-0.762f, 0.425f, -1.126f, 1.328f) + curveToRelative(-0.271f, 0.672f, -0.223f, 1.103f, -0.18f, 1.416f) + curveToRelative(0.043f, 0.313f, 0.144f, 0.775f, 0.442f, 1.205f) + curveToRelative(0.231f, 0.336f, 0.545f, 0.585f, 0.545f, 0.585f) + reflectiveCurveToRelative(-0.612f, 1.431f, -0.638f, 1.598f) + curveToRelative(-0.043f, 0.292f, -0.006f, 0.483f, 0.163f, 0.726f) + curveToRelative(0.25f, 0.363f, 0.746f, 0.609f, 1.191f, 0.771f) + curveToRelative(0.722f, 0.261f, 2.092f, 0.18f, 2.851f, -0.093f) + curveToRelative(1.138f, -0.411f, 1.552f, -0.914f, 1.961f, -1.356f) + curveToRelative(0.536f, -0.579f, 0.993f, -1.709f, 1.069f, -2.328f) + curveToRelative(0.031f, -0.255f, 0.047f, -0.541f, 0.047f, -0.743f) + curveToRelative(-0.001f, -0.3f, -0.036f, -0.507f, -0.071f, -0.736f) + close() + moveToRelative(-2.2f, 1.737f) + curveToRelative(-0.188f, 0.397f, -0.466f, 0.831f, -0.869f, 1.133f) + curveToRelative(-0.205f, 0.152f, -0.422f, 0.279f, -0.614f, 0.348f) + curveToRelative(-0.031f, 0.009f, -0.121f, 0.036f, -0.17f, 0.046f) + curveToRelative(-0.274f, 0.054f, -0.579f, 0.002f, -0.685f, -0.076f) + lineToRelative(-0.007f, -0.007f) + curveToRelative(-0.084f, -0.046f, -0.139f, -0.106f, -0.173f, -0.174f) + curveToRelative(-0.024f, -0.04f, -0.039f, -0.084f, -0.044f, -0.143f) + curveToRelative(-0.008f, -0.051f, -0.007f, -0.103f, -0.001f, -0.157f) + lineToRelative(0.001f, -0.032f) + lineToRelative(0.006f, -0.028f) + curveToRelative(0.024f, -0.13f, 0.073f, -0.253f, 0.115f, -0.344f) + curveToRelative(0.029f, -0.061f, 0.117f, -0.252f, 0.146f, -0.318f) + curveToRelative(0.157f, -0.377f, 0.344f, -0.808f, 0.432f, -1.033f) + curveToRelative(0.084f, -0.213f, 0.293f, -0.702f, 0.345f, -0.901f) + horizontalLineToRelative(0.002f) + curveToRelative(0.006f, -0.017f, 0.01f, -0.036f, 0.01f, -0.055f) + curveToRelative(0.002f, -0.009f, 0.002f, -0.014f, 0f, -0.018f) + curveToRelative(0f, -0.008f, -0.001f, -0.017f, -0.005f, -0.024f) + curveToRelative(-0.012f, -0.053f, -0.046f, -0.104f, -0.097f, -0.147f) + lineToRelative(-0.008f, -0.008f) + curveToRelative(-0.382f, -0.324f, -0.929f, -0.391f, -1.239f, -0.389f) + lineToRelative(-0.198f, 0.01f) + lineToRelative(0.004f, 0.002f) + curveToRelative(-0.213f, 0.027f, -0.267f, 0.195f, -0.267f, 0.195f) + lineToRelative(-0.307f, 0.75f) + reflectiveCurveToRelative(-0.07f, -0.084f, -0.122f, -0.21f) + curveToRelative(-0.013f, -0.032f, -0.024f, -0.07f, -0.034f, -0.111f) + curveToRelative(-0.015f, -0.067f, -0.021f, -0.093f, -0.027f, -0.154f) + curveToRelative(-0.008f, -0.04f, -0.014f, -0.138f, -0.009f, -0.189f) + curveToRelative(0.024f, -0.227f, 0.296f, -0.871f, 1.697f, -0.947f) + curveToRelative(0.12f, -0.006f, 0.287f, -0.001f, 0.36f, -0.002f) + curveToRelative(0f, 0f, 0.201f, 0.011f, 0.357f, 0.04f) + curveToRelative(0.155f, 0.026f, 0.387f, 0.094f, 0.481f, 0.138f) + curveToRelative(0.21f, 0.095f, 0.319f, 0.155f, 0.471f, 0.29f) + curveToRelative(0.076f, 0.068f, 0.15f, 0.147f, 0.22f, 0.236f) + curveToRelative(0.075f, 0.096f, 0.131f, 0.186f, 0.198f, 0.313f) + curveToRelative(0.034f, 0.071f, 0.062f, 0.141f, 0.093f, 0.228f) + curveToRelative(0.047f, 0.13f, 0.088f, 0.298f, 0.113f, 0.526f) + curveToRelative(0.036f, 0.341f, 0.012f, 0.814f, -0.175f, 1.212f) + close() + moveToRelative(10.766f, 3.401f) + curveToRelative(0.057f, 0f, 0.11f, -0.046f, 0.12f, -0.101f) + lineToRelative(0.252f, -1.423f) + curveToRelative(0.008f, -0.057f, -0.029f, -0.103f, -0.084f, -0.103f) + horizontalLineToRelative(-0.236f) + curveToRelative(-0.057f, 0f, -0.11f, 0.046f, -0.12f, 0.103f) + lineToRelative(-0.251f, 1.423f) + curveToRelative(-0.011f, 0.056f, 0.028f, 0.101f, 0.084f, 0.101f) + horizontalLineToRelative(0.235f) + close() + moveToRelative(-8.098f, -1.623f) + horizontalLineToRelative(-0.235f) + curveToRelative(-0.056f, 0f, -0.127f, 0.042f, -0.158f, 0.094f) + lineToRelative(-0.185f, 0.312f) + lineToRelative(-0.075f, -0.312f) + curveToRelative(-0.014f, -0.052f, -0.068f, -0.094f, -0.126f, -0.094f) + horizontalLineToRelative(-0.236f) + curveToRelative(-0.056f, 0f, -0.09f, 0.042f, -0.078f, 0.094f) + lineToRelative(0.182f, 0.731f) + lineToRelative(0.021f, 0.084f) + lineToRelative(-0.108f, 0.612f) + curveToRelative(-0.011f, 0.056f, 0.028f, 0.102f, 0.084f, 0.102f) + horizontalLineToRelative(0.236f) + curveToRelative(0.057f, 0f, 0.109f, -0.046f, 0.119f, -0.102f) + lineToRelative(0.109f, -0.61f) + lineToRelative(0.051f, -0.086f) + lineToRelative(0.445f, -0.731f) + curveToRelative(0.031f, -0.052f, 0.012f, -0.094f, -0.046f, -0.094f) + close() + moveToRelative(2.669f, -0.003f) + horizontalLineToRelative(-0.399f) + curveToRelative(-0.055f, 0f, -0.117f, 0.044f, -0.138f, 0.1f) + lineToRelative(-0.215f, 0.575f) + lineToRelative(-0.01f, -0.575f) + curveToRelative(-0.001f, -0.056f, -0.049f, -0.1f, -0.103f, -0.1f) + horizontalLineToRelative(-0.399f) + curveToRelative(-0.056f, 0f, -0.111f, 0.047f, -0.121f, 0.102f) + lineToRelative(-0.249f, 1.422f) + curveToRelative(-0.011f, 0.055f, 0.027f, 0.101f, 0.083f, 0.101f) + horizontalLineToRelative(0.236f) + curveToRelative(0.055f, 0f, 0.11f, -0.046f, 0.119f, -0.101f) + lineToRelative(0.099f, -0.562f) + lineToRelative(0.011f, 0.563f) + curveToRelative(0.001f, 0.016f, 0.005f, 0.03f, 0.013f, 0.045f) + curveToRelative(0.003f, 0.032f, 0.029f, 0.055f, 0.07f, 0.055f) + horizontalLineToRelative(0.169f) + curveToRelative(0.041f, 0f, 0.075f, -0.023f, 0.091f, -0.055f) + curveToRelative(0.01f, -0.015f, 0.02f, -0.029f, 0.026f, -0.045f) + lineToRelative(0.209f, -0.559f) + lineToRelative(-0.098f, 0.557f) + curveToRelative(-0.011f, 0.056f, 0.027f, 0.101f, 0.084f, 0.101f) + horizontalLineToRelative(0.235f) + curveToRelative(0.055f, 0f, 0.11f, -0.046f, 0.12f, -0.101f) + lineToRelative(0.251f, -1.421f) + curveToRelative(0.01f, -0.055f, -0.029f, -0.102f, -0.084f, -0.102f) + close() + moveToRelative(4.995f, 1.531f) + lineTo(20.389f, 19.1f) + lineToRelative(0.38f, -0.69f) + curveToRelative(0.028f, -0.052f, 0.006f, -0.095f, -0.05f, -0.095f) + horizontalLineToRelative(-0.264f) + curveToRelative(-0.054f, 0f, -0.123f, 0.043f, -0.152f, 0.096f) + lineToRelative(-0.241f, 0.459f) + lineTo(20f, 18.992f) + lineToRelative(0.021f, -0.122f) + lineToRelative(0.079f, -0.456f) + curveToRelative(0.009f, -0.055f, -0.027f, -0.101f, -0.083f, -0.101f) + horizontalLineTo(19.78f) + curveToRelative(-0.055f, 0f, -0.108f, 0.046f, -0.12f, 0.101f) + lineToRelative(-0.249f, 1.422f) + curveToRelative(-0.011f, 0.056f, 0.026f, 0.102f, 0.083f, 0.102f) + horizontalLineToRelative(0.236f) + curveToRelative(0.056f, 0f, 0.11f, -0.046f, 0.119f, -0.102f) + lineToRelative(0.08f, -0.455f) + lineToRelative(0.032f, -0.18f) + lineToRelative(0.035f, 0.18f) + lineToRelative(0.09f, 0.461f) + curveToRelative(0.008f, 0.052f, 0.061f, 0.095f, 0.118f, 0.095f) + horizontalLineToRelative(0.268f) + curveToRelative(0.055f, 0.001f, 0.093f, -0.041f, 0.08f, -0.094f) + close() + moveToRelative(-2.345f, -1.429f) + curveToRelative(0.011f, -0.055f, -0.027f, -0.102f, -0.081f, -0.102f) + horizontalLineToRelative(-0.893f) + curveToRelative(-0.055f, 0f, -0.108f, 0.047f, -0.118f, 0.102f) + lineToRelative(-0.042f, 0.236f) + curveToRelative(-0.01f, 0.056f, 0.028f, 0.101f, 0.084f, 0.101f) + horizontalLineToRelative(0.37f) + lineToRelative(-0.589f, 0.785f) + curveToRelative(-0.015f, 0.019f, -0.028f, 0.042f, -0.033f, 0.065f) + lineToRelative(-0.042f, 0.236f) + curveToRelative(-0.009f, 0.056f, 0.029f, 0.101f, 0.084f, 0.101f) + horizontalLineToRelative(0.89f) + curveToRelative(0.057f, 0f, 0.111f, -0.046f, 0.118f, -0.101f) + lineToRelative(0.041f, -0.236f) + curveToRelative(0.011f, -0.055f, -0.025f, -0.102f, -0.08f, -0.102f) + horizontalLineToRelative(-0.374f) + lineToRelative(0.591f, -0.788f) + curveToRelative(0.009f, -0.007f, 0.011f, -0.012f, 0.016f, -0.023f) + lineToRelative(0.008f, -0.011f) + curveToRelative(0.005f, -0.009f, 0.007f, -0.017f, 0.008f, -0.028f) + lineToRelative(0.042f, -0.235f) + close() + moveToRelative(-4.406f, 1.424f) + lineToRelative(-0.062f, -1.427f) + curveToRelative(-0.003f, -0.054f, -0.05f, -0.099f, -0.105f, -0.099f) + horizontalLineToRelative(-0.352f) + curveToRelative(-0.056f, 0f, -0.12f, 0.045f, -0.142f, 0.099f) + lineToRelative(-0.56f, 1.427f) + curveToRelative(-0.022f, 0.054f, 0.005f, 0.099f, 0.06f, 0.099f) + horizontalLineToRelative(0.26f) + curveToRelative(0.055f, 0f, 0.119f, -0.045f, 0.139f, -0.099f) + lineToRelative(0.04f, -0.104f) + horizontalLineToRelative(0.257f) + lineToRelative(0.003f, 0.104f) + curveToRelative(0.001f, 0.054f, 0.046f, 0.099f, 0.104f, 0.099f) + horizontalLineToRelative(0.258f) + curveToRelative(0.057f, 0f, 0.102f, -0.045f, 0.1f, -0.099f) + close() + moveToRelative(-0.53f, -0.46f) + horizontalLineToRelative(-0.092f) + lineToRelative(0.171f, -0.446f) + lineToRelative(0.012f, 0.446f) + horizontalLineToRelative(-0.091f) + close() + moveToRelative(3.467f, 0.46f) + lineToRelative(-0.061f, -1.427f) + curveToRelative(-0.002f, -0.054f, -0.051f, -0.099f, -0.107f, -0.099f) + horizontalLineToRelative(-0.35f) + curveToRelative(-0.056f, 0f, -0.119f, 0.045f, -0.141f, 0.099f) + lineToRelative(-0.562f, 1.427f) + curveToRelative(-0.022f, 0.054f, 0.006f, 0.099f, 0.062f, 0.099f) + horizontalLineToRelative(0.258f) + curveToRelative(0.057f, 0f, 0.119f, -0.045f, 0.139f, -0.099f) + lineToRelative(0.04f, -0.104f) + horizontalLineToRelative(0.258f) + lineToRelative(0.001f, 0.104f) + curveToRelative(0.003f, 0.054f, 0.049f, 0.099f, 0.105f, 0.099f) + horizontalLineToRelative(0.259f) + curveToRelative(0.056f, 0f, 0.101f, -0.045f, 0.099f, -0.099f) + close() + moveToRelative(-0.53f, -0.46f) + horizontalLineToRelative(-0.093f) + lineToRelative(0.172f, -0.446f) + lineToRelative(0.013f, 0.446f) + horizontalLineToRelative(-0.092f) + close() + moveToRelative(3.085f, 0.46f) + lineToRelative(-0.062f, -1.427f) + curveToRelative(-0.002f, -0.054f, -0.049f, -0.099f, -0.106f, -0.099f) + horizontalLineToRelative(-0.351f) + curveToRelative(-0.055f, 0f, -0.119f, 0.045f, -0.141f, 0.099f) + lineToRelative(-0.561f, 1.427f) + curveToRelative(-0.023f, 0.054f, 0.006f, 0.099f, 0.06f, 0.099f) + horizontalLineToRelative(0.259f) + curveToRelative(0.056f, 0f, 0.119f, -0.045f, 0.14f, -0.099f) + lineToRelative(0.039f, -0.104f) + horizontalLineToRelative(0.258f) + lineToRelative(0.002f, 0.104f) + curveToRelative(0.002f, 0.054f, 0.048f, 0.099f, 0.104f, 0.099f) + horizontalLineToRelative(0.259f) + curveToRelative(0.058f, 0f, 0.101f, -0.045f, 0.1f, -0.099f) + close() + moveToRelative(-0.53f, -0.46f) + horizontalLineToRelative(-0.091f) + lineToRelative(0.17f, -0.446f) + lineToRelative(0.012f, 0.446f) + horizontalLineToRelative(-0.091f) + close() + } + } + }.build() + + return _KomojuIcDailyYamazaki!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcDailyYamazaki: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcDiners.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcDiners.kt new file mode 100644 index 0000000..53bdd11 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcDiners.kt @@ -0,0 +1,83 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.Diners: ImageVector + get() { + if (_KomojuIcDiners != null) { + return _KomojuIcDiners!! + } + _KomojuIcDiners = ImageVector.Builder( + name = "KomojuIcDiners", + defaultWidth = 21.dp, + defaultHeight = 16.dp, + viewportWidth = 21f, + viewportHeight = 16f, + ).apply { + path(fill = SolidColor(Color(0xFF0079BE))) { + moveTo(11.783f, 15.906f) + curveToRelative(4.336f, 0.02f, 8.294f, -3.537f, 8.294f, -7.864f) + curveToRelative(0f, -4.732f, -3.958f, -8.003f, -8.294f, -8.001f) + horizontalLineTo(8.051f) + curveToRelative(-4.388f, -0.002f, -8f, 3.27f, -8f, 8.001f) + curveToRelative(0f, 4.328f, 3.612f, 7.884f, 8f, 7.864f) + horizontalLineToRelative(3.732f) + close() + } + path(fill = SolidColor(Color(0xFFFFFFFF))) { + moveTo(8.069f, 0.697f) + curveToRelative(-4.01f, 0.001f, -7.259f, 3.251f, -7.26f, 7.262f) + curveToRelative(0.001f, 4.011f, 3.25f, 7.26f, 7.26f, 7.262f) + curveToRelative(4.01f, -0.002f, 7.26f, -3.251f, 7.261f, -7.262f) + curveToRelative(-0.001f, -4.011f, -3.251f, -7.261f, -7.261f, -7.262f) + close() + moveTo(3.467f, 7.959f) + curveToRelative(0.004f, -1.96f, 1.228f, -3.631f, 2.954f, -4.296f) + verticalLineToRelative(8.591f) + curveTo(4.695f, 11.59f, 3.471f, 9.92f, 3.467f, 7.959f) + close() + moveToRelative(6.249f, 4.297f) + verticalLineTo(3.663f) + curveToRelative(1.727f, 0.663f, 2.953f, 2.335f, 2.956f, 4.296f) + curveToRelative(-0.003f, 1.962f, -1.229f, 3.633f, -2.956f, 4.297f) + close() + } + path(fill = SolidColor(Color(0xFF0079BE))) { + moveTo(11.783f, 15.906f) + curveToRelative(4.336f, 0.02f, 8.294f, -3.537f, 8.294f, -7.864f) + curveToRelative(0f, -4.732f, -3.958f, -8.003f, -8.294f, -8.001f) + horizontalLineTo(8.051f) + curveToRelative(-4.388f, -0.002f, -8f, 3.27f, -8f, 8.001f) + curveToRelative(0f, 4.328f, 3.612f, 7.884f, 8f, 7.864f) + horizontalLineToRelative(3.732f) + close() + } + path(fill = SolidColor(Color(0xFFFFFFFF))) { + moveTo(8.069f, 0.697f) + curveToRelative(-4.01f, 0.001f, -7.259f, 3.251f, -7.26f, 7.262f) + curveToRelative(0.001f, 4.011f, 3.25f, 7.26f, 7.26f, 7.262f) + curveToRelative(4.01f, -0.002f, 7.26f, -3.251f, 7.261f, -7.262f) + curveToRelative(-0.001f, -4.011f, -3.251f, -7.261f, -7.261f, -7.262f) + close() + moveTo(3.467f, 7.959f) + curveToRelative(0.004f, -1.96f, 1.228f, -3.631f, 2.954f, -4.296f) + verticalLineToRelative(8.591f) + curveTo(4.695f, 11.59f, 3.471f, 9.92f, 3.467f, 7.959f) + close() + moveToRelative(6.249f, 4.297f) + verticalLineTo(3.663f) + curveToRelative(1.727f, 0.663f, 2.953f, 2.335f, 2.956f, 4.296f) + curveToRelative(-0.003f, 1.962f, -1.229f, 3.633f, -2.956f, 4.297f) + close() + } + }.build() + + return _KomojuIcDiners!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcDiners: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcFamilyMart.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcFamilyMart.kt new file mode 100644 index 0000000..0e38025 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcFamilyMart.kt @@ -0,0 +1,216 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.group +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.FamilyMart: ImageVector + get() { + if (_KomojuIcFamilyMart != null) { + return _KomojuIcFamilyMart!! + } + _KomojuIcFamilyMart = ImageVector.Builder( + name = "KomojuIcFamilyMart", + defaultWidth = 32.dp, + defaultHeight = 32.dp, + viewportWidth = 32f, + viewportHeight = 32f, + ).apply { + path(fill = SolidColor(Color(0xFFF1FAFF))) { + moveTo(5.333f, 0f) + horizontalLineToRelative(21.334f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 32f, 5.333f) + verticalLineToRelative(21.334f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 26.667f, 32f) + horizontalLineTo(5.333f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 0f, 26.667f) + verticalLineTo(5.333f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 5.333f, 0f) + close() + } + group { + path(fill = SolidColor(Color(0xFFFFFFFF))) { + moveTo(6.478f, 11.611f) + horizontalLineToRelative(19.049f) + verticalLineToRelative(7.999f) + horizontalLineTo(6.478f) + close() + } + path(fill = SolidColor(Color(0xFF00A041))) { + moveTo(25.527f, 11.611f) + horizontalLineTo(6.479f) + verticalLineTo(5.306f) + horizontalLineToRelative(19.048f) + verticalLineToRelative(6.305f) + close() + } + path(fill = SolidColor(Color(0xFF008CD6))) { + moveTo(25.527f, 26.592f) + horizontalLineTo(6.479f) + verticalLineTo(19.61f) + horizontalLineToRelative(19.048f) + verticalLineToRelative(6.982f) + close() + moveTo(7.154f, 13.747f) + verticalLineToRelative(2.813f) + horizontalLineToRelative(0.572f) + verticalLineToRelative(-1.23f) + horizontalLineToRelative(1.191f) + verticalLineToRelative(-0.544f) + horizontalLineTo(7.726f) + verticalLineTo(14.29f) + horizontalLineToRelative(1.211f) + verticalLineToRelative(-0.543f) + horizontalLineTo(7.154f) + close() + moveToRelative(3.446f, 2.409f) + verticalLineToRelative(-0.915f) + curveToRelative(0f, -0.302f, -0.156f, -0.684f, -0.817f, -0.684f) + curveToRelative(-0.26f, 0f, -0.471f, 0.058f, -0.614f, 0.115f) + verticalLineToRelative(0.499f) + curveToRelative(0.163f, -0.102f, 0.344f, -0.156f, 0.541f, -0.156f) + curveToRelative(0.178f, 0f, 0.357f, 0.061f, 0.357f, 0.27f) + verticalLineToRelative(0.013f) + curveToRelative(-0.088f, -0.031f, -0.2f, -0.052f, -0.315f, -0.052f) + curveToRelative(-0.451f, 0f, -0.782f, 0.237f, -0.782f, 0.699f) + curveToRelative(0f, 0.455f, 0.372f, 0.627f, 0.67f, 0.627f) + curveToRelative(0.186f, 0f, 0.346f, -0.06f, 0.45f, -0.144f) + curveToRelative(0.011f, 0.059f, 0.026f, 0.107f, 0.044f, 0.131f) + horizontalLineToRelative(0.588f) + curveToRelative(-0.071f, -0.056f, -0.122f, -0.171f, -0.122f, -0.403f) + close() + moveToRelative(-1.094f, -0.271f) + curveToRelative(0f, -0.155f, 0.134f, -0.26f, 0.325f, -0.26f) + curveToRelative(0.097f, 0f, 0.175f, 0.022f, 0.236f, 0.054f) + verticalLineToRelative(0.336f) + curveToRelative(-0.054f, 0.049f, -0.148f, 0.106f, -0.284f, 0.106f) + curveToRelative(-0.177f, 0f, -0.277f, -0.1f, -0.277f, -0.236f) + close() + moveToRelative(12.706f, 0.271f) + verticalLineToRelative(-0.915f) + curveToRelative(0f, -0.302f, -0.156f, -0.684f, -0.817f, -0.684f) + curveToRelative(-0.26f, 0f, -0.472f, 0.058f, -0.615f, 0.115f) + verticalLineToRelative(0.499f) + curveToRelative(0.164f, -0.102f, 0.345f, -0.156f, 0.542f, -0.156f) + curveToRelative(0.178f, 0f, 0.356f, 0.061f, 0.356f, 0.27f) + verticalLineToRelative(0.013f) + curveToRelative(-0.088f, -0.031f, -0.2f, -0.052f, -0.315f, -0.052f) + curveToRelative(-0.45f, 0f, -0.781f, 0.237f, -0.781f, 0.699f) + curveToRelative(0f, 0.455f, 0.371f, 0.627f, 0.669f, 0.627f) + curveToRelative(0.187f, 0f, 0.347f, -0.06f, 0.45f, -0.144f) + curveToRelative(0.011f, 0.059f, 0.027f, 0.107f, 0.043f, 0.131f) + horizontalLineToRelative(0.589f) + curveToRelative(-0.07f, -0.056f, -0.121f, -0.171f, -0.121f, -0.403f) + close() + moveToRelative(-1.094f, -0.271f) + curveToRelative(0f, -0.155f, 0.133f, -0.26f, 0.324f, -0.26f) + curveToRelative(0.097f, 0f, 0.175f, 0.022f, 0.236f, 0.054f) + verticalLineToRelative(0.336f) + curveToRelative(-0.055f, 0.049f, -0.146f, 0.106f, -0.284f, 0.106f) + curveToRelative(-0.176f, 0f, -0.276f, -0.1f, -0.276f, -0.236f) + close() + moveToRelative(-8.142f, -1.309f) + curveToRelative(-0.232f, 0f, -0.402f, 0.056f, -0.562f, 0.226f) + curveToRelative(-0.112f, -0.142f, -0.289f, -0.226f, -0.503f, -0.226f) + curveToRelative(-0.176f, 0f, -0.34f, 0.051f, -0.489f, 0.182f) + verticalLineToRelative(-0.162f) + horizontalLineToRelative(-0.499f) + verticalLineToRelative(1.963f) + horizontalLineToRelative(0.537f) + verticalLineToRelative(-1.323f) + curveToRelative(0.065f, -0.08f, 0.156f, -0.147f, 0.283f, -0.147f) + curveToRelative(0.162f, 0f, 0.254f, 0.11f, 0.254f, 0.31f) + verticalLineToRelative(1.16f) + horizontalLineToRelative(0.547f) + verticalLineToRelative(-1.337f) + curveToRelative(0.062f, -0.078f, 0.153f, -0.133f, 0.279f, -0.133f) + curveToRelative(0.175f, 0f, 0.255f, 0.123f, 0.255f, 0.31f) + verticalLineToRelative(1.16f) + horizontalLineToRelative(0.547f) + verticalLineToRelative(-1.36f) + curveToRelative(0f, -0.368f, -0.236f, -0.623f, -0.649f, -0.623f) + close() + moveToRelative(1.908f, 1.983f) + horizontalLineToRelative(0.537f) + verticalLineToRelative(-2.812f) + horizontalLineToRelative(-0.537f) + verticalLineToRelative(2.812f) + close() + moveToRelative(4.163f, -1.938f) + lineToRelative(-0.711f, -0.874f) + horizontalLineToRelative(-0.587f) + verticalLineToRelative(2.813f) + horizontalLineToRelative(0.587f) + verticalLineToRelative(-1.939f) + lineToRelative(0.711f, 0.941f) + lineToRelative(0.71f, -0.941f) + verticalLineToRelative(1.939f) + horizontalLineToRelative(0.588f) + verticalLineToRelative(-2.813f) + horizontalLineToRelative(-0.588f) + lineToRelative(-0.71f, 0.874f) + close() + moveToRelative(-5.068f, 1.937f) + horizontalLineToRelative(0.537f) + verticalLineToRelative(-1.963f) + horizontalLineToRelative(-0.537f) + verticalLineToRelative(1.963f) + close() + moveToRelative(0.269f, -2.854f) + curveToRelative(-0.193f, 0f, -0.35f, 0.155f, -0.35f, 0.349f) + curveToRelative(0f, 0.192f, 0.157f, 0.348f, 0.35f, 0.348f) + curveToRelative(0.192f, 0f, 0.348f, -0.156f, 0.348f, -0.348f) + curveToRelative(0f, -0.194f, -0.156f, -0.349f, -0.348f, -0.349f) + close() + moveToRelative(8.776f, 1.097f) + verticalLineToRelative(-0.206f) + horizontalLineTo(22.51f) + verticalLineToRelative(1.964f) + horizontalLineToRelative(0.537f) + verticalLineToRelative(-1.234f) + curveToRelative(0.078f, -0.1f, 0.204f, -0.189f, 0.386f, -0.189f) + curveToRelative(0.141f, 0f, 0.243f, 0.055f, 0.302f, 0.098f) + verticalLineToRelative(-0.591f) + curveToRelative(-0.066f, -0.048f, -0.173f, -0.072f, -0.261f, -0.072f) + curveToRelative(-0.153f, 0f, -0.321f, 0.058f, -0.45f, 0.23f) + close() + moveToRelative(1.865f, 1.256f) + curveToRelative(-0.17f, 0f, -0.235f, -0.132f, -0.235f, -0.277f) + verticalLineToRelative(-0.67f) + horizontalLineToRelative(0.458f) + verticalLineToRelative(-0.515f) + horizontalLineToRelative(-0.458f) + verticalLineToRelative(-0.741f) + lineToRelative(-0.53f, 0.225f) + verticalLineToRelative(0.516f) + horizontalLineToRelative(-0.289f) + verticalLineToRelative(0.515f) + horizontalLineToRelative(0.289f) + verticalLineToRelative(0.748f) + curveToRelative(0f, 0.408f, 0.163f, 0.723f, 0.643f, 0.723f) + curveToRelative(0.143f, 0f, 0.268f, -0.022f, 0.352f, -0.056f) + verticalLineToRelative(-0.542f) + curveToRelative(-0.04f, 0.044f, -0.114f, 0.074f, -0.23f, 0.074f) + close() + moveToRelative(-8.82f, 1.01f) + horizontalLineToRelative(0.604f) + lineToRelative(0.906f, -2.472f) + horizontalLineTo(16.99f) + lineToRelative(-0.373f, 1.061f) + lineToRelative(-0.405f, -1.061f) + horizontalLineToRelative(-0.614f) + lineToRelative(0.74f, 1.78f) + lineToRelative(-0.269f, 0.692f) + close() + } + } + }.build() + + return _KomojuIcFamilyMart!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcFamilyMart: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcJcb.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcJcb.kt new file mode 100644 index 0000000..03ac3f1 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcJcb.kt @@ -0,0 +1,178 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.graphics.Brush +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.group +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.Jcb: ImageVector + get() { + if (_KomojuIcJcb != null) { + return _KomojuIcJcb!! + } + _KomojuIcJcb = ImageVector.Builder( + name = "KomojuIcJcb", + defaultWidth = 22.dp, + defaultHeight = 17.dp, + viewportWidth = 22f, + viewportHeight = 17f, + ).apply { + group { + path(fill = SolidColor(Color(0xFFFFFFFF))) { + moveTo(21.063f, 13.63f) + curveTo(21.063f, 15.393f, 19.61f, 16.828f, 17.825f, 16.828f) + horizontalLineTo(0.203f) + verticalLineTo(4.164f) + curveTo(0.203f, 2.401f, 1.657f, 0.966f, 3.442f, 0.966f) + horizontalLineTo(21.063f) + verticalLineTo(13.63f) + close() + } + path( + fill = Brush.linearGradient( + colorStops = arrayOf( + 0f to Color(0xFF007940), + 0.229f to Color(0xFF00873F), + 0.743f to Color(0xFF40A737), + 1f to Color(0xFF5CB531), + ), + start = Offset(14.188f, 9.78f), + end = Offset(19.918f, 9.78f), + ), + ) { + moveTo(15.325f, 10.383f) + horizontalLineTo(16.664f) + curveTo(16.702f, 10.383f, 16.792f, 10.37f, 16.83f, 10.37f) + curveTo(17.085f, 10.32f, 17.302f, 10.093f, 17.302f, 9.778f) + curveTo(17.302f, 9.476f, 17.085f, 9.25f, 16.83f, 9.187f) + curveTo(16.792f, 9.174f, 16.715f, 9.174f, 16.664f, 9.174f) + horizontalLineTo(15.325f) + verticalLineTo(10.383f) + close() + } + path( + fill = Brush.linearGradient( + colorStops = arrayOf( + 0f to Color(0xFF007940), + 0.229f to Color(0xFF00873F), + 0.743f to Color(0xFF40A737), + 1f to Color(0xFF5CB531), + ), + start = Offset(14.188f, 8.898f), + end = Offset(19.918f, 8.898f), + ), + ) { + moveTo(16.511f, 2.036f) + curveTo(15.236f, 2.036f, 14.191f, 3.056f, 14.191f, 4.327f) + verticalLineTo(6.707f) + horizontalLineTo(17.467f) + curveTo(17.544f, 6.707f, 17.633f, 6.707f, 17.697f, 6.719f) + curveTo(18.436f, 6.757f, 18.985f, 7.135f, 18.985f, 7.789f) + curveTo(18.985f, 8.305f, 18.615f, 8.746f, 17.926f, 8.834f) + verticalLineTo(8.859f) + curveTo(18.679f, 8.91f, 19.253f, 9.325f, 19.253f, 9.967f) + curveTo(19.253f, 10.66f, 18.615f, 11.113f, 17.773f, 11.113f) + horizontalLineTo(14.178f) + verticalLineTo(15.771f) + horizontalLineTo(17.582f) + curveTo(18.857f, 15.771f, 19.903f, 14.751f, 19.903f, 13.479f) + verticalLineTo(2.036f) + horizontalLineTo(16.511f) + close() + } + path( + fill = Brush.linearGradient( + colorStops = arrayOf( + 0f to Color(0xFF007940), + 0.229f to Color(0xFF00873F), + 0.743f to Color(0xFF40A737), + 1f to Color(0xFF5CB531), + ), + start = Offset(14.188f, 7.939f), + end = Offset(19.918f, 7.939f), + ), + ) { + moveTo(17.136f, 7.94f) + curveTo(17.136f, 7.638f, 16.919f, 7.437f, 16.664f, 7.399f) + curveTo(16.639f, 7.399f, 16.575f, 7.386f, 16.537f, 7.386f) + horizontalLineTo(15.325f) + verticalLineTo(8.494f) + horizontalLineTo(16.537f) + curveTo(16.575f, 8.494f, 16.651f, 8.494f, 16.664f, 8.482f) + curveTo(16.919f, 8.444f, 17.136f, 8.242f, 17.136f, 7.94f) + close() + } + path( + fill = Brush.linearGradient( + colorStops = arrayOf( + 0f to Color(0xFF1F286F), + 0.475f to Color(0xFF004E94), + 0.826f to Color(0xFF0066B1), + 1f to Color(0xFF006FBC), + ), + start = Offset(1.361f, 8.898f), + end = Offset(7.179f, 8.898f), + ), + ) { + moveTo(3.684f, 2.036f) + curveTo(2.409f, 2.036f, 1.363f, 3.056f, 1.363f, 4.327f) + verticalLineTo(9.98f) + curveTo(2.014f, 10.295f, 2.689f, 10.496f, 3.365f, 10.496f) + curveTo(4.168f, 10.496f, 4.602f, 10.017f, 4.602f, 9.363f) + verticalLineTo(6.694f) + horizontalLineTo(6.591f) + verticalLineTo(9.35f) + curveTo(6.591f, 10.383f, 5.941f, 11.226f, 3.735f, 11.226f) + curveTo(2.396f, 11.226f, 1.351f, 10.936f, 1.351f, 10.936f) + verticalLineTo(15.758f) + horizontalLineTo(4.755f) + curveTo(6.03f, 15.758f, 7.076f, 14.738f, 7.076f, 13.467f) + verticalLineTo(2.036f) + horizontalLineTo(3.684f) + close() + } + path( + fill = Brush.linearGradient( + colorStops = arrayOf( + 0f to Color(0xFF6C2C2F), + 0.173f to Color(0xFF882730), + 0.573f to Color(0xFFBE1833), + 0.859f to Color(0xFFDC0436), + 1f to Color(0xFFE60039), + ), + start = Offset(7.744f, 8.898f), + end = Offset(13.395f, 8.898f), + ), + ) { + moveTo(10.098f, 2.036f) + curveTo(8.823f, 2.036f, 7.777f, 3.056f, 7.777f, 4.327f) + verticalLineTo(7.324f) + curveTo(8.364f, 6.833f, 9.384f, 6.518f, 11.028f, 6.593f) + curveTo(11.908f, 6.631f, 12.852f, 6.87f, 12.852f, 6.87f) + verticalLineTo(7.84f) + curveTo(12.38f, 7.6f, 11.819f, 7.386f, 11.092f, 7.336f) + curveTo(9.843f, 7.248f, 9.09f, 7.852f, 9.09f, 8.91f) + curveTo(9.09f, 9.98f, 9.843f, 10.584f, 11.092f, 10.483f) + curveTo(11.819f, 10.433f, 12.38f, 10.206f, 12.852f, 9.98f) + verticalLineTo(10.949f) + curveTo(12.852f, 10.949f, 11.921f, 11.188f, 11.028f, 11.226f) + curveTo(9.384f, 11.302f, 8.364f, 10.987f, 7.777f, 10.496f) + verticalLineTo(15.783f) + horizontalLineTo(11.182f) + curveTo(12.457f, 15.783f, 13.502f, 14.763f, 13.502f, 13.492f) + verticalLineTo(2.036f) + horizontalLineTo(10.098f) + close() + } + } + }.build() + + return _KomojuIcJcb!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcJcb: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcKonbini.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcKonbini.kt new file mode 100644 index 0000000..67244f2 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcKonbini.kt @@ -0,0 +1,91 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.StrokeCap +import androidx.compose.ui.graphics.StrokeJoin +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.Konbini: ImageVector + get() { + if (_KomojuIcKonbini != null) { + return _KomojuIcKonbini!! + } + _KomojuIcKonbini = ImageVector.Builder( + name = "KomojuIcKonbini", + defaultWidth = 33.dp, + defaultHeight = 33.dp, + viewportWidth = 33f, + viewportHeight = 33f, + ).apply { + path( + stroke = SolidColor(Color(0xFF0F1C29)), + strokeLineWidth = 1.5f, + strokeLineCap = StrokeCap.Round, + strokeLineJoin = StrokeJoin.Round, + ) { + moveTo(6.151f, 14.591f) + verticalLineToRelative(11.436f) + curveToRelative(0f, 1.12f, 0f, 1.68f, 0.218f, 2.108f) + curveToRelative(0.192f, 0.376f, 0.498f, 0.682f, 0.874f, 0.874f) + curveToRelative(0.428f, 0.218f, 0.988f, 0.218f, 2.108f, 0.218f) + horizontalLineToRelative(13.964f) + curveToRelative(1.12f, 0f, 1.68f, 0f, 2.108f, -0.218f) + curveToRelative(0.376f, -0.192f, 0.682f, -0.498f, 0.874f, -0.874f) + curveToRelative(0.218f, -0.428f, 0.218f, -0.988f, 0.218f, -2.108f) + verticalLineTo(14.591f) + } + path( + fill = SolidColor(Color(0xFF79C3F8)), + stroke = SolidColor(Color(0xFF0F1C29)), + strokeLineWidth = 1.5f, + strokeLineCap = StrokeCap.Round, + strokeLineJoin = StrokeJoin.Round, + ) { + moveTo(6.151f, 3.773f) + lineToRelative(-3.818f, 6.363f) + curveToRelative(-0.002f, 0.859f, 0.286f, 1.692f, 0.818f, 2.366f) + curveToRelative(0.531f, 0.674f, 1.275f, 1.149f, 2.11f, 1.348f) + curveToRelative(0.835f, 0.198f, 1.712f, 0.109f, 2.49f, -0.254f) + curveToRelative(0.778f, -0.363f, 1.41f, -0.978f, 1.795f, -1.745f) + curveToRelative(0.313f, 0.632f, 0.797f, 1.163f, 1.397f, 1.535f) + curveToRelative(0.6f, 0.372f, 1.291f, 0.569f, 1.996f, 0.569f) + curveToRelative(0.706f, 0f, 1.398f, -0.197f, 1.997f, -0.569f) + curveToRelative(0.6f, -0.372f, 1.084f, -0.903f, 1.397f, -1.535f) + curveToRelative(0.314f, 0.632f, 0.798f, 1.163f, 1.397f, 1.535f) + curveToRelative(0.6f, 0.372f, 1.291f, 0.569f, 1.997f, 0.569f) + curveToRelative(0.706f, 0f, 1.397f, -0.197f, 1.996f, -0.569f) + curveToRelative(0.6f, -0.372f, 1.084f, -0.903f, 1.398f, -1.535f) + curveToRelative(0.384f, 0.767f, 1.017f, 1.382f, 1.794f, 1.745f) + curveToRelative(0.778f, 0.363f, 1.656f, 0.452f, 2.491f, 0.254f) + curveToRelative(0.835f, -0.199f, 1.578f, -0.674f, 2.11f, -1.348f) + curveToRelative(0.531f, -0.674f, 0.819f, -1.507f, 0.817f, -2.366f) + lineToRelative(-3.818f, -6.363f) + horizontalLineTo(6.151f) + close() + } + path( + stroke = SolidColor(Color(0xFF0F1C29)), + strokeLineWidth = 1.5f, + strokeLineCap = StrokeCap.Round, + strokeLineJoin = StrokeJoin.Round, + ) { + moveTo(13.788f, 29.227f) + verticalLineToRelative(-5.091f) + curveToRelative(0f, -0.507f, 0f, -0.76f, 0.045f, -0.97f) + curveToRelative(0.167f, -0.765f, 0.765f, -1.363f, 1.53f, -1.53f) + curveToRelative(0.21f, -0.045f, 0.463f, -0.045f, 0.97f, -0.045f) + curveToRelative(0.507f, 0f, 0.761f, 0f, 0.971f, 0.045f) + curveToRelative(0.765f, 0.167f, 1.363f, 0.765f, 1.529f, 1.53f) + curveToRelative(0.046f, 0.21f, 0.046f, 0.463f, 0.046f, 0.97f) + verticalLineToRelative(5.091f) + } + }.build() + + return _KomojuIcKonbini!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcKonbini: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcLawson.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcLawson.kt new file mode 100644 index 0000000..ba370e2 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcLawson.kt @@ -0,0 +1,286 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.group +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.Lawson: ImageVector + get() { + if (_KomojuIcLawson != null) { + return _KomojuIcLawson!! + } + _KomojuIcLawson = ImageVector.Builder( + name = "KomojuIcLawson", + defaultWidth = 32.dp, + defaultHeight = 32.dp, + viewportWidth = 32f, + viewportHeight = 32f, + ).apply { + path(fill = SolidColor(Color(0xFFF1F4FF))) { + moveTo(5.333f, 0f) + lineTo(26.667f, 0f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 32f, 5.333f) + lineTo(32f, 26.667f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 26.667f, 32f) + lineTo(5.333f, 32f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 0f, 26.667f) + lineTo(0f, 5.333f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 5.333f, 0f) + close() + } + group { + path(fill = SolidColor(Color(0xFF007BC2))) { + moveTo(18.017f, 16.234f) + curveTo(18.528f, 16.234f, 19.674f, 16.234f, 19.758f, 16.234f) + curveTo(19.908f, 16.234f, 19.908f, 16.281f, 19.908f, 16.359f) + curveTo(19.908f, 16.437f, 19.908f, 16.84f, 19.908f, 17.002f) + curveTo(19.908f, 17.164f, 19.882f, 17.219f, 19.646f, 17.219f) + curveTo(19.41f, 17.219f, 18.102f, 17.219f, 18.04f, 17.219f) + curveTo(17.978f, 17.219f, 17.894f, 17.244f, 17.894f, 17.119f) + curveTo(17.894f, 16.993f, 17.894f, 16.708f, 17.894f, 16.622f) + curveTo(17.894f, 16.537f, 17.875f, 16.507f, 17.782f, 16.507f) + curveTo(17.689f, 16.507f, 17.472f, 16.507f, 17.418f, 16.507f) + curveTo(17.364f, 16.507f, 17.31f, 16.507f, 17.31f, 16.622f) + curveTo(17.31f, 16.739f, 17.31f, 17.203f, 17.31f, 17.498f) + curveTo(17.31f, 17.792f, 17.433f, 17.978f, 17.813f, 17.978f) + curveTo(18.192f, 17.978f, 19.602f, 17.978f, 19.912f, 17.978f) + curveTo(20.222f, 17.978f, 20.497f, 17.815f, 20.497f, 17.42f) + curveTo(20.497f, 17.025f, 20.497f, 16.421f, 20.497f, 16.143f) + curveTo(20.497f, 15.863f, 20.287f, 15.646f, 19.908f, 15.646f) + curveTo(19.528f, 15.646f, 18.162f, 15.646f, 18.068f, 15.646f) + curveTo(17.975f, 15.646f, 17.894f, 15.632f, 17.894f, 15.5f) + curveTo(17.894f, 15.368f, 17.894f, 14.981f, 17.894f, 14.91f) + curveTo(17.894f, 14.841f, 17.931f, 14.788f, 18.048f, 14.788f) + curveTo(18.164f, 14.788f, 19.617f, 14.788f, 19.78f, 14.788f) + curveTo(19.943f, 14.788f, 19.908f, 14.825f, 19.908f, 14.942f) + curveTo(19.908f, 15.058f, 19.908f, 15.19f, 19.908f, 15.282f) + curveTo(19.908f, 15.376f, 19.981f, 15.376f, 20.066f, 15.376f) + curveTo(20.151f, 15.376f, 20.299f, 15.376f, 20.391f, 15.376f) + curveTo(20.485f, 15.376f, 20.497f, 15.329f, 20.497f, 15.259f) + curveTo(20.497f, 15.19f, 20.497f, 14.735f, 20.497f, 14.735f) + curveTo(20.497f, 14.217f, 20.314f, 14.028f, 19.88f, 14.028f) + curveTo(19.446f, 14.028f, 18.528f, 14.028f, 18.048f, 14.028f) + curveTo(17.568f, 14.028f, 17.31f, 14.037f, 17.305f, 14.735f) + curveTo(17.305f, 15.095f, 17.305f, 15.18f, 17.305f, 15.198f) + verticalLineTo(15.201f) + curveTo(17.305f, 15.222f, 17.305f, 15.445f, 17.305f, 15.754f) + curveTo(17.305f, 16.081f, 17.506f, 16.234f, 18.017f, 16.234f) + close() + } + path(fill = SolidColor(Color(0xFF007BC2))) { + moveTo(21.705f, 16.073f) + curveTo(21.705f, 16.073f, 21.705f, 15.12f, 21.705f, 14.973f) + curveTo(21.705f, 14.825f, 21.786f, 14.788f, 21.879f, 14.788f) + curveTo(21.925f, 14.788f, 23.451f, 14.788f, 23.567f, 14.788f) + curveTo(23.684f, 14.788f, 23.718f, 14.818f, 23.718f, 14.91f) + curveTo(23.718f, 15.003f, 23.718f, 16.955f, 23.718f, 17.088f) + curveTo(23.718f, 17.219f, 23.645f, 17.219f, 23.567f, 17.219f) + curveTo(23.491f, 17.219f, 21.987f, 17.219f, 21.871f, 17.219f) + curveTo(21.755f, 17.219f, 21.705f, 17.195f, 21.705f, 17.08f) + curveTo(21.705f, 16.963f, 21.705f, 16.073f, 21.705f, 16.073f) + close() + moveTo(21.711f, 17.978f) + curveTo(22.152f, 17.978f, 23.224f, 17.978f, 23.657f, 17.978f) + curveTo(24.091f, 17.978f, 24.307f, 17.833f, 24.307f, 17.321f) + curveTo(24.307f, 16.81f, 24.307f, 15.208f, 24.307f, 14.735f) + curveTo(24.307f, 14.26f, 24.109f, 14.028f, 23.681f, 14.028f) + curveTo(23.277f, 14.028f, 22.158f, 14.028f, 21.755f, 14.028f) + curveTo(21.352f, 14.028f, 21.115f, 14.193f, 21.115f, 14.735f) + curveTo(21.115f, 15.277f, 21.115f, 16.22f, 21.115f, 16.22f) + curveTo(21.115f, 16.22f, 21.115f, 17.074f, 21.115f, 17.406f) + curveTo(21.115f, 17.739f, 21.27f, 17.978f, 21.711f, 17.978f) + close() + } + path(fill = SolidColor(Color(0xFF007BC2))) { + moveTo(3.093f, 14.788f) + horizontalLineTo(3.616f) + verticalLineTo(17.219f) + horizontalLineTo(3.108f) + curveTo(3.059f, 17.219f, 3.02f, 17.258f, 3.02f, 17.307f) + verticalLineTo(17.89f) + curveTo(3.02f, 17.94f, 3.059f, 17.978f, 3.108f, 17.978f) + horizontalLineTo(6.184f) + curveTo(6.233f, 17.978f, 6.272f, 17.94f, 6.272f, 17.89f) + verticalLineTo(16.556f) + curveTo(6.272f, 16.507f, 6.234f, 16.468f, 6.185f, 16.468f) + horizontalLineTo(5.768f) + curveTo(5.72f, 16.468f, 5.68f, 16.507f, 5.68f, 16.556f) + verticalLineTo(17.219f) + horizontalLineTo(4.204f) + verticalLineTo(14.788f) + horizontalLineTo(4.697f) + curveTo(4.747f, 14.788f, 4.786f, 14.748f, 4.786f, 14.699f) + verticalLineTo(14.116f) + curveTo(4.786f, 14.068f, 4.747f, 14.028f, 4.697f, 14.028f) + horizontalLineTo(3.093f) + curveTo(3.044f, 14.028f, 3.004f, 14.068f, 3.004f, 14.116f) + verticalLineTo(14.699f) + curveTo(3.004f, 14.748f, 3.044f, 14.788f, 3.093f, 14.788f) + close() + } + path(fill = SolidColor(Color(0xFF007BC2))) { + moveTo(8.851f, 15.411f) + lineTo(9.3f, 16.22f) + horizontalLineTo(9.305f) + lineTo(9.301f, 16.222f) + lineTo(9.3f, 16.22f) + horizontalLineTo(8.395f) + lineTo(8.391f, 16.219f) + lineTo(8.851f, 15.411f) + close() + moveTo(6.717f, 17.978f) + horizontalLineTo(8.321f) + curveTo(8.37f, 17.978f, 8.41f, 17.94f, 8.41f, 17.89f) + verticalLineTo(17.307f) + curveTo(8.41f, 17.258f, 8.37f, 17.219f, 8.321f, 17.219f) + horizontalLineTo(7.825f) + lineTo(7.822f, 17.217f) + lineTo(8.054f, 16.808f) + horizontalLineTo(9.626f) + lineTo(9.625f, 16.81f) + lineTo(9.852f, 17.22f) + lineTo(9.85f, 17.219f) + horizontalLineTo(9.365f) + curveTo(9.317f, 17.219f, 9.277f, 17.258f, 9.277f, 17.307f) + verticalLineTo(17.89f) + curveTo(9.277f, 17.94f, 9.317f, 17.978f, 9.365f, 17.978f) + horizontalLineTo(10.972f) + curveTo(11.019f, 17.978f, 11.059f, 17.94f, 11.059f, 17.89f) + verticalLineTo(17.307f) + curveTo(11.059f, 17.258f, 11.019f, 17.219f, 10.972f, 17.219f) + horizontalLineTo(10.524f) + verticalLineTo(17.22f) + lineTo(9.181f, 14.788f) + horizontalLineTo(9.685f) + curveTo(9.735f, 14.788f, 9.774f, 14.748f, 9.774f, 14.699f) + verticalLineTo(14.116f) + curveTo(9.774f, 14.068f, 9.735f, 14.028f, 9.685f, 14.028f) + horizontalLineTo(8.08f) + curveTo(8.031f, 14.028f, 7.992f, 14.068f, 7.992f, 14.116f) + verticalLineTo(14.699f) + curveTo(7.992f, 14.748f, 8.031f, 14.788f, 8.08f, 14.788f) + horizontalLineTo(8.527f) + lineTo(7.146f, 17.217f) + lineTo(7.147f, 17.219f) + horizontalLineTo(6.717f) + curveTo(6.668f, 17.219f, 6.628f, 17.258f, 6.628f, 17.307f) + verticalLineTo(17.89f) + curveTo(6.628f, 17.94f, 6.668f, 17.978f, 6.717f, 17.978f) + close() + } + path(fill = SolidColor(Color(0xFF007BC2))) { + moveTo(10.418f, 14.788f) + horizontalLineTo(10.9f) + lineTo(12.104f, 17.219f) + horizontalLineTo(11.612f) + curveTo(11.563f, 17.219f, 11.524f, 17.258f, 11.524f, 17.307f) + verticalLineTo(17.89f) + curveTo(11.524f, 17.94f, 11.563f, 17.978f, 11.612f, 17.978f) + horizontalLineTo(13.218f) + curveTo(13.266f, 17.978f, 13.306f, 17.94f, 13.306f, 17.89f) + verticalLineTo(17.307f) + curveTo(13.306f, 17.258f, 13.266f, 17.219f, 13.218f, 17.219f) + horizontalLineTo(12.771f) + lineTo(13.642f, 15.442f) + lineTo(14.521f, 17.219f) + horizontalLineTo(14.044f) + curveTo(13.995f, 17.219f, 13.956f, 17.258f, 13.956f, 17.307f) + verticalLineTo(17.89f) + curveTo(13.956f, 17.94f, 13.995f, 17.978f, 14.044f, 17.978f) + horizontalLineTo(15.649f) + curveTo(15.698f, 17.978f, 15.737f, 17.94f, 15.737f, 17.89f) + verticalLineTo(17.307f) + curveTo(15.737f, 17.258f, 15.698f, 17.219f, 15.649f, 17.219f) + horizontalLineTo(15.199f) + lineTo(16.387f, 14.788f) + horizontalLineTo(16.858f) + curveTo(16.907f, 14.788f, 16.945f, 14.748f, 16.945f, 14.699f) + verticalLineTo(14.116f) + curveTo(16.945f, 14.068f, 16.907f, 14.028f, 16.858f, 14.028f) + horizontalLineTo(15.252f) + curveTo(15.203f, 14.028f, 15.164f, 14.068f, 15.164f, 14.116f) + verticalLineTo(14.699f) + curveTo(15.164f, 14.748f, 15.203f, 14.788f, 15.252f, 14.788f) + horizontalLineTo(15.733f) + lineTo(14.858f, 16.572f) + lineTo(13.975f, 14.788f) + horizontalLineTo(14.442f) + curveTo(14.49f, 14.788f, 14.529f, 14.748f, 14.529f, 14.699f) + verticalLineTo(14.116f) + curveTo(14.529f, 14.068f, 14.49f, 14.028f, 14.442f, 14.028f) + horizontalLineTo(12.835f) + curveTo(12.787f, 14.028f, 12.748f, 14.068f, 12.748f, 14.116f) + verticalLineTo(14.699f) + curveTo(12.748f, 14.748f, 12.787f, 14.788f, 12.835f, 14.788f) + horizontalLineTo(13.302f) + lineTo(12.436f, 16.556f) + lineTo(11.559f, 14.788f) + horizontalLineTo(12.024f) + curveTo(12.074f, 14.788f, 12.113f, 14.748f, 12.113f, 14.699f) + verticalLineTo(14.116f) + curveTo(12.113f, 14.068f, 12.074f, 14.028f, 12.024f, 14.028f) + horizontalLineTo(10.418f) + curveTo(10.37f, 14.028f, 10.331f, 14.068f, 10.331f, 14.116f) + verticalLineTo(14.699f) + curveTo(10.331f, 14.748f, 10.37f, 14.788f, 10.418f, 14.788f) + close() + } + path(fill = SolidColor(Color(0xFF007BC2))) { + moveTo(24.778f, 17.978f) + horizontalLineTo(26.383f) + curveTo(26.433f, 17.978f, 26.471f, 17.94f, 26.471f, 17.89f) + verticalLineTo(17.307f) + curveTo(26.471f, 17.258f, 26.433f, 17.219f, 26.383f, 17.219f) + horizontalLineTo(25.855f) + verticalLineTo(15.48f) + horizontalLineTo(25.857f) + lineTo(27.718f, 17.219f) + horizontalLineTo(27.302f) + curveTo(27.254f, 17.219f, 27.215f, 17.258f, 27.215f, 17.307f) + verticalLineTo(17.89f) + curveTo(27.215f, 17.94f, 27.254f, 17.978f, 27.302f, 17.978f) + horizontalLineTo(28.908f) + curveTo(28.957f, 17.978f, 28.996f, 17.94f, 28.996f, 17.89f) + verticalLineTo(17.307f) + curveTo(28.996f, 17.258f, 28.957f, 17.219f, 28.908f, 17.219f) + horizontalLineTo(28.397f) + verticalLineTo(14.788f) + horizontalLineTo(28.908f) + curveTo(28.957f, 14.788f, 28.996f, 14.748f, 28.996f, 14.699f) + verticalLineTo(14.116f) + curveTo(28.996f, 14.068f, 28.957f, 14.028f, 28.908f, 14.028f) + horizontalLineTo(27.302f) + curveTo(27.254f, 14.028f, 27.215f, 14.068f, 27.215f, 14.116f) + verticalLineTo(14.699f) + curveTo(27.215f, 14.748f, 27.254f, 14.788f, 27.302f, 14.788f) + horizontalLineTo(27.807f) + verticalLineTo(16.496f) + horizontalLineTo(27.805f) + lineTo(25.979f, 14.788f) + horizontalLineTo(26.383f) + curveTo(26.433f, 14.788f, 26.471f, 14.748f, 26.471f, 14.699f) + verticalLineTo(14.116f) + curveTo(26.471f, 14.068f, 26.433f, 14.028f, 26.383f, 14.028f) + horizontalLineTo(24.778f) + curveTo(24.729f, 14.028f, 24.69f, 14.068f, 24.69f, 14.116f) + verticalLineTo(14.699f) + curveTo(24.69f, 14.748f, 24.729f, 14.788f, 24.778f, 14.788f) + horizontalLineTo(25.267f) + verticalLineTo(17.219f) + horizontalLineTo(24.778f) + curveTo(24.729f, 17.219f, 24.69f, 17.258f, 24.69f, 17.307f) + verticalLineTo(17.89f) + curveTo(24.69f, 17.94f, 24.729f, 17.978f, 24.778f, 17.978f) + close() + } + } + }.build() + + return _KomojuIcLawson!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcLawson: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcLinepay.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcLinepay.kt new file mode 100644 index 0000000..af74f75 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcLinepay.kt @@ -0,0 +1,165 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.Linepay: ImageVector + get() { + if (_KomojuIcLinepay != null) { + return _KomojuIcLinepay!! + } + _KomojuIcLinepay = ImageVector.Builder( + name = "KomojuIcLinepay", + defaultWidth = 44.dp, + defaultHeight = 47.dp, + viewportWidth = 44f, + viewportHeight = 47f, + ).apply { + path(fill = SolidColor(Color(0xFF000000))) { + moveTo(15.5f, 0f) + horizontalLineToRelative(-2f) + curveToRelative(-0.4f, 0f, -0.7f, 0.3f, -0.7f, 0.6f) + verticalLineToRelative(13.2f) + curveToRelative(0f, 0.3f, 0.3f, 0.6f, 0.6f, 0.6f) + horizontalLineToRelative(2.1f) + curveToRelative(0.3f, 0f, 0.6f, -0.3f, 0.6f, -0.6f) + verticalLineTo(0.6f) + curveToRelative(0f, -0.3f, -0.3f, -0.6f, -0.6f, -0.6f) + close() + moveToRelative(-5.1f, 11f) + horizontalLineTo(4.8f) + verticalLineTo(0.7f) + curveToRelative(0f, -0.3f, -0.3f, -0.6f, -0.6f, -0.6f) + horizontalLineTo(2f) + curveToRelative(-0.3f, 0f, -0.6f, 0.3f, -0.6f, 0.6f) + verticalLineToRelative(13.2f) + curveToRelative(0f, 0.3f, 0.3f, 0.5f, 0.6f, 0.5f) + horizontalLineToRelative(8.3f) + curveToRelative(0.4f, 0f, 0.6f, -0.2f, 0.6f, -0.5f) + verticalLineToRelative(-2.2f) + curveToRelative(0f, -0.3f, -0.2f, -0.5f, -0.6f, -0.5f) + close() + moveToRelative(31.3f, -7.7f) + curveToRelative(0.3f, 0f, 0.6f, -0.3f, 0.6f, -0.6f) + verticalLineTo(0.6f) + curveTo(42.3f, 0.3f, 42f, 0f, 41.7f, 0f) + horizontalLineToRelative(-8.4f) + curveToRelative(-0.3f, 0f, -0.5f, 0.3f, -0.5f, 0.6f) + verticalLineToRelative(13.2f) + curveToRelative(0f, 0.3f, 0.2f, 0.5f, 0.5f, 0.5f) + horizontalLineToRelative(8.4f) + curveToRelative(0.3f, 0f, 0.6f, -0.2f, 0.6f, -0.5f) + verticalLineToRelative(-2.2f) + curveToRelative(0f, -0.3f, -0.3f, -0.5f, -0.6f, -0.5f) + horizontalLineTo(36f) + verticalLineTo(8.8f) + horizontalLineToRelative(5.7f) + curveToRelative(0.3f, 0f, 0.6f, -0.2f, 0.6f, -0.6f) + verticalLineToRelative(-2f) + curveToRelative(0f, -0.4f, -0.3f, -0.7f, -0.6f, -0.7f) + horizontalLineTo(36f) + verticalLineTo(3.3f) + horizontalLineToRelative(5.7f) + close() + moveTo(30f, 0f) + horizontalLineToRelative(-2.2f) + curveToRelative(-0.3f, 0f, -0.5f, 0.3f, -0.5f, 0.6f) + verticalLineToRelative(7.6f) + lineToRelative(-5.5f, -8f) + lineTo(21f, 0f) + horizontalLineToRelative(-2.2f) + curveToRelative(-0.3f, 0f, -0.6f, 0.3f, -0.6f, 0.6f) + verticalLineToRelative(13.2f) + curveToRelative(0f, 0.3f, 0.3f, 0.5f, 0.6f, 0.5f) + horizontalLineTo(21f) + curveToRelative(0.3f, 0f, 0.6f, -0.2f, 0.6f, -0.5f) + verticalLineToRelative(-8f) + lineToRelative(5.7f, 8.3f) + horizontalLineToRelative(0.1f) + curveToRelative(0.1f, 0.2f, 0.2f, 0.2f, 0.4f, 0.2f) + horizontalLineTo(30f) + curveToRelative(0.4f, 0f, 0.6f, -0.2f, 0.6f, -0.5f) + verticalLineTo(0.6f) + curveTo(30.6f, 0.3f, 30.4f, 0f, 30f, 0f) + close() + } + path(fill = SolidColor(Color(0xFF08BF5B))) { + moveTo(42.4f, 47f) + horizontalLineTo(1.6f) + curveTo(0.7f, 47f, 0f, 46.1f, 0f, 45.2f) + verticalLineTo(20.8f) + curveToRelative(0f, -1f, 0.7f, -1.7f, 1.6f, -1.7f) + horizontalLineToRelative(40.8f) + curveToRelative(0.9f, 0f, 1.6f, 0.8f, 1.6f, 1.7f) + verticalLineToRelative(24.5f) + curveToRelative(0f, 0.9f, -0.7f, 1.6f, -1.6f, 1.6f) + close() + } + path(fill = SolidColor(Color(0xFFFFFFFF))) { + moveTo(15.9f, 30f) + curveToRelative(0f, 2.4f, -2f, 4.4f, -4.5f, 4.4f) + horizontalLineToRelative(-2f) + verticalLineTo(38f) + curveToRelative(0f, 0.2f, -0.1f, 0.4f, -0.3f, 0.4f) + horizontalLineTo(7f) + arcTo(0.4f, 0.4f, 0f, isMoreThanHalf = false, isPositiveArc = true, 6.6f, 38f) + verticalLineTo(26f) + curveToRelative(0f, -0.2f, 0.2f, -0.4f, 0.4f, -0.4f) + horizontalLineToRelative(4.4f) + curveToRelative(2.5f, 0f, 4.5f, 2f, 4.5f, 4.4f) + close() + moveToRelative(-3f, 0f) + curveToRelative(0f, -1f, -0.6f, -1.7f, -1.5f, -1.7f) + horizontalLineToRelative(-2f) + verticalLineToRelative(3.3f) + horizontalLineToRelative(2f) + curveToRelative(0.9f, 0f, 1.5f, -0.7f, 1.5f, -1.6f) + close() + moveToRelative(13.8f, -0.5f) + verticalLineToRelative(8.7f) + lineToRelative(-0.2f, 0.2f) + horizontalLineToRelative(-2.3f) + arcToRelative(0.2f, 0.2f, 0f, isMoreThanHalf = false, isPositiveArc = true, -0.2f, -0.2f) + verticalLineToRelative(-0.6f) + curveToRelative(-0.6f, 0.7f, -1.5f, 1f, -2.8f, 1f) + curveToRelative(-2.3f, 0f, -4.3f, -2f, -4.3f, -4.8f) + curveToRelative(0f, -2.7f, 2f, -4.8f, 4.3f, -4.8f) + curveToRelative(1.3f, 0f, 2.2f, 0.4f, 2.8f, 1.1f) + verticalLineToRelative(-0.6f) + curveToRelative(0f, -0.1f, 0f, -0.2f, 0.2f, -0.2f) + horizontalLineToRelative(2.3f) + reflectiveCurveToRelative(0.2f, 0f, 0.2f, 0.2f) + close() + moveTo(24f, 33.8f) + curveToRelative(0f, -1.3f, -1f, -2.2f, -2.2f, -2.2f) + curveToRelative(-1.3f, 0f, -2.2f, 0.9f, -2.2f, 2.2f) + curveToRelative(0f, 1.4f, 1f, 2.3f, 2.2f, 2.3f) + curveToRelative(1.2f, 0f, 2.2f, -0.9f, 2.2f, -2.3f) + close() + moveToRelative(11.8f, -4.3f) + lineToRelative(-2.1f, 5.3f) + lineToRelative(-2.2f, -5.3f) + curveToRelative(0f, -0.2f, -0.2f, -0.3f, -0.3f, -0.3f) + horizontalLineToRelative(-2.4f) + lineToRelative(-0.2f, 0.4f) + lineToRelative(3.7f, 8.8f) + lineToRelative(-1.4f, 3.4f) + curveToRelative(0f, 0.1f, 0f, 0.3f, 0.2f, 0.3f) + horizontalLineToRelative(2.4f) + lineToRelative(0.3f, -0.2f) + lineToRelative(4.9f, -12.3f) + curveToRelative(0f, -0.2f, 0f, -0.4f, -0.2f, -0.4f) + horizontalLineTo(36f) + curveToRelative(-0.1f, 0f, -0.3f, 0.1f, -0.3f, 0.3f) + close() + } + }.build() + + return _KomojuIcLinepay!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcLinepay: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcMaster.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcMaster.kt new file mode 100644 index 0000000..284065b --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcMaster.kt @@ -0,0 +1,70 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.PathFillType +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.group +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.Master: ImageVector + get() { + if (_KomojuIcMaster != null) { + return _KomojuIcMaster!! + } + _KomojuIcMaster = ImageVector.Builder( + name = "KomojuIcMaster", + defaultWidth = 24.dp, + defaultHeight = 17.dp, + viewportWidth = 24f, + viewportHeight = 17f, + ).apply { + group { + path(fill = SolidColor(Color(0xFF252525))) { + moveTo(22f, 0.5f) + horizontalLineTo(2f) + curveToRelative(-1.105f, 0f, -2f, 0.895f, -2f, 2f) + verticalLineToRelative(12f) + curveToRelative(0f, 1.105f, 0.895f, 2f, 2f, 2f) + horizontalLineToRelative(20f) + curveToRelative(1.105f, 0f, 2f, -0.895f, 2f, -2f) + verticalLineToRelative(-12f) + curveToRelative(0f, -1.105f, -0.895f, -2f, -2f, -2f) + close() + } + path(fill = SolidColor(Color(0xFFEB001B))) { + moveTo(9f, 13.5f) + curveToRelative(2.761f, 0f, 5f, -2.239f, 5f, -5f) + reflectiveCurveToRelative(-2.239f, -5f, -5f, -5f) + reflectiveCurveToRelative(-5f, 2.239f, -5f, 5f) + reflectiveCurveToRelative(2.239f, 5f, 5f, 5f) + close() + } + path(fill = SolidColor(Color(0xFFF79E1B))) { + moveTo(15f, 13.5f) + curveToRelative(2.761f, 0f, 5f, -2.239f, 5f, -5f) + reflectiveCurveToRelative(-2.239f, -5f, -5f, -5f) + reflectiveCurveToRelative(-5f, 2.239f, -5f, 5f) + reflectiveCurveToRelative(2.239f, 5f, 5f, 5f) + close() + } + path( + fill = SolidColor(Color(0xFFFF5F00)), + pathFillType = PathFillType.EvenOdd, + ) { + moveTo(12f, 4.5f) + curveToRelative(1.214f, 0.912f, 2f, 2.364f, 2f, 4f) + curveToRelative(0f, 1.636f, -0.786f, 3.088f, -2f, 4f) + curveToRelative(-1.214f, -0.912f, -2f, -2.364f, -2f, -4f) + curveToRelative(0f, -1.636f, 0.786f, -3.088f, 2f, -4f) + close() + } + } + }.build() + + return _KomojuIcMaster!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcMaster: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcMerpay.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcMerpay.kt new file mode 100644 index 0000000..4a40841 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcMerpay.kt @@ -0,0 +1,129 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.Merpay: ImageVector + get() { + if (_KomojuIcMerpay != null) { + return _KomojuIcMerpay!! + } + _KomojuIcMerpay = ImageVector.Builder( + name = "KomojuIcMerpay", + defaultWidth = 150.dp, + defaultHeight = 60.dp, + viewportWidth = 150f, + viewportHeight = 60f, + ).apply { + path(fill = SolidColor(Color(0xFF222222))) { + moveTo(143.71f, 22.74f) + lineTo(137.53f, 38.04f) + lineTo(131.27f, 22.74f) + horizontalLineTo(125.07f) + lineTo(134.74f, 44.38f) + lineTo(129.65f, 56.29f) + horizontalLineTo(135f) + lineTo(149.46f, 22.74f) + horizontalLineTo(143.71f) + close() + } + path(fill = SolidColor(Color(0xFF222222))) { + moveTo(85f, 11.3f) + horizontalLineTo(77.4f) + horizontalLineTo(71.9f) + verticalLineTo(46.66f) + horizontalLineTo(77.4f) + verticalLineTo(32.93f) + horizontalLineTo(85f) + curveTo(92.22f, 32.93f, 96.54f, 28.43f, 96.54f, 22.18f) + curveTo(96.56f, 15.85f, 92.24f, 11.3f, 85f, 11.3f) + close() + moveTo(85.93f, 27.74f) + horizontalLineTo(77.5f) + verticalLineTo(16.5f) + horizontalLineTo(85.95f) + curveTo(89.66f, 16.5f, 90.98f, 19.92f, 90.98f, 22.2f) + curveTo(90.98f, 24.48f, 89.66f, 27.74f, 85.95f, 27.74f) + horizontalLineTo(85.93f) + close() + } + path(fill = SolidColor(Color(0xFF222222))) { + moveTo(110.38f, 22.42f) + curveTo(103.25f, 22.42f, 98.07f, 27.55f, 98.07f, 34.62f) + curveTo(98.07f, 41.8f, 102.92f, 46.82f, 109.86f, 46.82f) + curveTo(112.71f, 46.82f, 115.78f, 45.13f, 116.89f, 43.02f) + verticalLineTo(46.67f) + horizontalLineTo(122.46f) + verticalLineTo(34.62f) + curveTo(122.46f, 27.21f, 117.79f, 22.42f, 110.38f, 22.42f) + close() + moveTo(110.32f, 41.92f) + curveTo(106.24f, 41.92f, 103.68f, 39.12f, 103.68f, 34.61f) + curveTo(103.68f, 30.45f, 106.54f, 27.31f, 110.32f, 27.31f) + curveTo(114.36f, 27.31f, 116.82f, 30.18f, 116.82f, 34.61f) + curveTo(116.85f, 38.16f, 114.64f, 41.93f, 110.32f, 41.93f) + verticalLineTo(41.92f) + close() + } + path(fill = SolidColor(Color(0xFFFF0211))) { + moveTo(30.79f, 59.5f) + lineTo(54f, 47.87f) + curveTo(54.8f, 47.47f, 55.48f, 46.85f, 55.95f, 46.09f) + curveTo(56.42f, 45.33f, 56.67f, 44.45f, 56.67f, 43.55f) + verticalLineTo(16.45f) + curveTo(56.67f, 15.55f, 56.42f, 14.67f, 55.95f, 13.91f) + curveTo(55.48f, 13.15f, 54.8f, 12.53f, 54f, 12.13f) + lineTo(30.79f, 0.5f) + curveTo(30.11f, 0.16f, 29.36f, -0.01f, 28.61f, -0.01f) + curveTo(27.85f, -0.01f, 27.1f, 0.16f, 26.42f, 0.5f) + lineTo(3.22f, 12.13f) + curveTo(2.42f, 12.53f, 1.74f, 13.15f, 1.27f, 13.91f) + curveTo(0.8f, 14.67f, 0.55f, 15.55f, 0.54f, 16.45f) + verticalLineTo(43.55f) + curveTo(0.55f, 44.45f, 0.8f, 45.33f, 1.27f, 46.09f) + curveTo(1.74f, 46.85f, 2.42f, 47.47f, 3.22f, 47.87f) + lineTo(26.42f, 59.5f) + curveTo(27.1f, 59.84f, 27.85f, 60.01f, 28.61f, 60.01f) + curveTo(29.36f, 60.01f, 30.11f, 59.84f, 30.79f, 59.5f) + close() + } + path(fill = SolidColor(Color(0xFF4DC9FF))) { + moveTo(47.96f, 29.36f) + curveTo(54.91f, 29.36f, 60.54f, 23.72f, 60.54f, 16.78f) + curveTo(60.54f, 9.83f, 54.91f, 4.2f, 47.96f, 4.2f) + curveTo(41.01f, 4.2f, 35.38f, 9.83f, 35.38f, 16.78f) + curveTo(35.38f, 23.72f, 41.01f, 29.36f, 47.96f, 29.36f) + close() + } + path(fill = SolidColor(Color(0xFFFFFFFF))) { + moveTo(8.27f, 39.76f) + lineTo(5.81f, 38.53f) + verticalLineTo(31.25f) + curveTo(5.81f, 29.12f, 7.01f, 27f, 9.49f, 27.25f) + curveTo(11.8f, 27.5f, 13.59f, 29.56f, 14.14f, 30.9f) + curveTo(14.51f, 30.56f, 14.96f, 30.31f, 15.45f, 30.17f) + curveTo(15.93f, 30.04f, 16.45f, 30.03f, 16.94f, 30.14f) + curveTo(18.21f, 30.31f, 22.98f, 32.14f, 22.98f, 38.59f) + verticalLineTo(47.18f) + lineTo(20.28f, 45.82f) + verticalLineTo(37.79f) + curveTo(20.28f, 35.43f, 18.84f, 33.46f, 16.9f, 33.24f) + curveTo(16.1f, 33.14f, 15.4f, 33.79f, 15.4f, 35.17f) + curveTo(15.4f, 36.56f, 15.4f, 43.34f, 15.4f, 43.34f) + lineTo(12.93f, 42.1f) + verticalLineTo(34.5f) + curveTo(12.93f, 31.15f, 10.76f, 30.09f, 9.81f, 30f) + curveTo(9.28f, 29.94f, 8.28f, 30.26f, 8.28f, 32f) + lineTo(8.27f, 39.76f) + close() + } + }.build() + + return _KomojuIcMerpay!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcMerpay: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcMinistop.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcMinistop.kt new file mode 100644 index 0000000..ed1f15a --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcMinistop.kt @@ -0,0 +1,257 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp +import kotlin.Suppress + +val KomojuIcon.Ministop: ImageVector + get() { + if (_KomojuIcMinistop != null) { + return _KomojuIcMinistop!! + } + _KomojuIcMinistop = ImageVector.Builder( + name = "KomojuIcMinistop", + defaultWidth = 32.dp, + defaultHeight = 32.dp, + viewportWidth = 32f, + viewportHeight = 32f, + ).apply { + path(fill = SolidColor(Color(0xFFEAF2FF))) { + moveTo(5.333f, 0f) + horizontalLineToRelative(21.334f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 32f, 5.333f) + verticalLineToRelative(21.334f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 26.667f, 32f) + horizontalLineTo(5.333f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 0f, 26.667f) + verticalLineTo(5.333f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 5.333f, 0f) + close() + } + path(fill = SolidColor(Color(0xFFFFFFFF))) { + moveTo(6.375f, 17.196f) + curveToRelative(0f, -0.019f, -0.015f, -0.034f, -0.034f, -0.034f) + horizontalLineTo(5.158f) + curveTo(4.519f, 17.162f, 4f, 16.642f, 4f, 16.004f) + curveToRelative(0f, -0.31f, 0.103f, -0.623f, 0.339f, -0.859f) + lineToRelative(6.462f, -6.722f) + curveToRelative(0.454f, -0.454f, 1.188f, -0.454f, 1.642f, 0f) + lineToRelative(1.505f, 1.463f) + lineToRelative(3.042f, -0.004f) + curveToRelative(0.203f, -1.246f, 1.834f, -1.796f, 2.934f, -1.796f) + curveToRelative(1.855f, 0f, 3.406f, 1.295f, 3.801f, 3.029f) + curveToRelative(0.007f, 0.031f, 0.015f, 0.061f, 0.019f, 0.091f) + curveToRelative(0.004f, 0.016f, 0.013f, 0.03f, 0.026f, 0.037f) + curveToRelative(1.334f, 0.734f, 2.268f, 2.103f, 2.395f, 3.7f) + curveToRelative(0.002f, 0.02f, 0.011f, 0.037f, 0.027f, 0.046f) + lineToRelative(0.03f, 0.018f) + curveTo(27.287f, 15.647f, 28f, 16.813f, 28f, 18.146f) + curveToRelative(0f, 1.527f, -0.934f, 2.835f, -2.262f, 3.384f) + curveToRelative(-0.013f, 0.005f, -0.022f, 0.017f, -0.022f, 0.032f) + verticalLineToRelative(1.197f) + curveToRelative(0f, 0.64f, -0.518f, 1.158f, -1.158f, 1.158f) + horizontalLineTo(7.536f) + curveToRelative(-0.64f, 0f, -1.159f, -0.518f, -1.159f, -1.158f) + lineToRelative(-0.002f, -5.563f) + close() + } + path(fill = SolidColor(Color(0xFF003894))) { + moveTo(15.652f, 16.904f) + curveToRelative(0.411f, 0f, 0.745f, -0.333f, 0.745f, -0.745f) + verticalLineToRelative(-2.712f) + curveToRelative(0f, -0.411f, -0.334f, -0.745f, -0.745f, -0.745f) + curveToRelative(-0.412f, 0f, -0.745f, 0.334f, -0.745f, 0.745f) + verticalLineToRelative(2.712f) + curveToRelative(0f, 0.411f, 0.333f, 0.745f, 0.745f, 0.745f) + close() + moveToRelative(5.865f, 0f) + curveToRelative(0.411f, 0f, 0.745f, -0.333f, 0.745f, -0.745f) + verticalLineToRelative(-2.712f) + curveToRelative(0f, -0.411f, -0.334f, -0.745f, -0.745f, -0.745f) + reflectiveCurveToRelative(-0.745f, 0.334f, -0.745f, 0.745f) + verticalLineToRelative(2.712f) + curveToRelative(0f, 0.411f, 0.334f, 0.745f, 0.745f, 0.745f) + close() + moveToRelative(-8.259f, 1.718f) + curveToRelative(0f, -0.023f, -0.018f, -0.042f, -0.041f, -0.042f) + horizontalLineToRelative(-0.195f) + curveToRelative(-0.344f, 0f, -0.623f, -0.279f, -0.623f, -0.623f) + reflectiveCurveToRelative(0.279f, -0.623f, 0.623f, -0.623f) + horizontalLineToRelative(1.758f) + curveToRelative(0.344f, 0f, 0.623f, 0.279f, 0.623f, 0.623f) + reflectiveCurveToRelative(-0.279f, 0.623f, -0.623f, 0.623f) + horizontalLineToRelative(-0.101f) + curveToRelative(-0.023f, 0f, -0.041f, 0.019f, -0.041f, 0.042f) + lineToRelative(-0.001f, 2.218f) + curveToRelative(0f, 0.381f, -0.309f, 0.689f, -0.689f, 0.689f) + curveToRelative(-0.38f, 0f, -0.689f, -0.308f, -0.689f, -0.689f) + lineToRelative(-0.001f, -2.218f) + close() + moveToRelative(6.317f, -5.92f) + curveToRelative(-0.397f, 0f, -0.719f, 0.322f, -0.719f, 0.718f) + lineToRelative(-0.006f, 0.528f) + lineToRelative(-0.001f, -0.003f) + curveToRelative(0f, 0.008f, -0.006f, 0.015f, -0.015f, 0.015f) + curveToRelative(-0.005f, 0f, -0.01f, -0.003f, -0.012f, -0.007f) + lineToRelative(-0.642f, -0.929f) + curveToRelative(-0.129f, -0.187f, -0.345f, -0.309f, -0.59f, -0.309f) + curveToRelative(-0.397f, 0f, -0.718f, 0.321f, -0.718f, 0.719f) + verticalLineToRelative(2.744f) + curveToRelative(0f, 0.397f, 0.321f, 0.719f, 0.718f, 0.719f) + curveToRelative(0.397f, 0f, 0.719f, -0.322f, 0.719f, -0.719f) + lineToRelative(0.007f, -0.539f) + verticalLineToRelative(0.001f) + curveToRelative(0f, -0.008f, 0.007f, -0.015f, 0.015f, -0.015f) + curveToRelative(0.005f, 0f, 0.009f, 0.003f, 0.012f, 0.007f) + lineToRelative(0.628f, 0.923f) + curveToRelative(0.128f, 0.198f, 0.351f, 0.329f, 0.603f, 0.329f) + curveToRelative(0.397f, 0f, 0.719f, -0.322f, 0.719f, -0.719f) + verticalLineTo(13.42f) + curveToRelative(0f, -0.396f, -0.322f, -0.718f, -0.718f, -0.718f) + close() + moveToRelative(-5.884f, 0f) + curveToRelative(-0.231f, 0f, -0.436f, 0.105f, -0.572f, 0.269f) + verticalLineTo(12.97f) + lineToRelative(-0.799f, 0.905f) + reflectiveCurveToRelative(-0.009f, 0.021f, -0.03f, 0.021f) + curveToRelative(-0.02f, 0f, -0.038f, -0.021f, -0.038f, -0.021f) + lineToRelative(-0.811f, -0.898f) + curveToRelative(-0.136f, -0.168f, -0.344f, -0.275f, -0.577f, -0.275f) + curveToRelative(-0.41f, 0f, -0.743f, 0.333f, -0.743f, 0.743f) + verticalLineToRelative(2.736f) + curveToRelative(0f, 0.397f, 0.322f, 0.718f, 0.719f, 0.718f) + curveToRelative(0.396f, 0f, 0.718f, -0.321f, 0.718f, -0.718f) + lineToRelative(0.018f, -0.985f) + curveToRelative(0.001f, -0.01f, 0.01f, -0.019f, 0.021f, -0.019f) + curveToRelative(0.005f, 0f, 0.011f, 0.003f, 0.015f, 0.006f) + lineToRelative(0.645f, 0.722f) + reflectiveCurveToRelative(0.017f, 0.026f, 0.039f, 0.026f) + curveToRelative(0.023f, 0f, 0.039f, -0.026f, 0.039f, -0.026f) + lineToRelative(0.607f, -0.735f) + curveToRelative(0.004f, -0.003f, 0.009f, -0.006f, 0.015f, -0.006f) + curveToRelative(0.012f, 0f, 0.022f, 0.01f, 0.022f, 0.022f) + lineToRelative(0.018f, 0.995f) + curveToRelative(0f, 0.397f, 0.321f, 0.718f, 0.718f, 0.718f) + curveToRelative(0.397f, 0f, 0.719f, -0.321f, 0.719f, -0.718f) + verticalLineToRelative(-2.736f) + curveToRelative(0f, -0.41f, -0.333f, -0.743f, -0.743f, -0.743f) + close() + moveToRelative(7.913f, 6.345f) + horizontalLineToRelative(-0.371f) + curveToRelative(-0.012f, 0f, -0.021f, -0.009f, -0.021f, -0.021f) + verticalLineToRelative(-0.611f) + curveToRelative(0f, -0.012f, 0.009f, -0.021f, 0.021f, -0.021f) + lineToRelative(0.371f, 0.001f) + curveToRelative(0.181f, 0f, 0.327f, 0.145f, 0.327f, 0.326f) + curveToRelative(0f, 0.18f, -0.146f, 0.326f, -0.327f, 0.326f) + close() + moveToRelative(0.003f, -1.713f) + horizontalLineToRelative(-1.412f) + curveToRelative(-0.237f, 0f, -0.43f, 0.193f, -0.43f, 0.43f) + lineToRelative(0.003f, 3.043f) + curveToRelative(0f, 0.399f, 0.323f, 0.722f, 0.722f, 0.722f) + curveToRelative(0.399f, 0f, 0.722f, -0.323f, 0.722f, -0.722f) + verticalLineToRelative(-0.706f) + curveToRelative(0f, -0.011f, 0.01f, -0.021f, 0.022f, -0.021f) + horizontalLineToRelative(0.326f) + curveToRelative(1.01f, 0f, 1.492f, -0.681f, 1.492f, -1.359f) + curveToRelative(0f, -0.766f, -0.647f, -1.387f, -1.445f, -1.387f) + close() + } + path(fill = SolidColor(Color(0xFF003894))) { + moveTo(24.525f, 16.249f) + horizontalLineToRelative(0.002f) + curveToRelative(0.986f, 0.094f, 1.757f, 0.929f, 1.757f, 1.93f) + curveToRelative(0f, 0.982f, -0.741f, 1.793f, -1.701f, 1.91f) + curveToRelative(-0.333f, 0.041f, -0.591f, 0.314f, -0.591f, 0.655f) + verticalLineToRelative(1.395f) + curveToRelative(0f, 0.03f, -0.024f, 0.054f, -0.054f, 0.054f) + horizontalLineTo(8.156f) + curveToRelative(-0.029f, 0f, -0.053f, -0.024f, -0.053f, -0.054f) + lineTo(8.101f, 16.04f) + curveToRelative(0f, -0.337f, -0.273f, -0.61f, -0.61f, -0.61f) + horizontalLineToRelative(-0.94f) + curveToRelative(-0.006f, 0f, -0.012f, -0.003f, -0.017f, -0.007f) + curveToRelative(-0.009f, -0.009f, -0.009f, -0.024f, 0f, -0.034f) + lineToRelative(5.074f, -5.255f) + curveToRelative(0.009f, -0.01f, 0.024f, -0.01f, 0.034f, 0f) + lineToRelative(1.538f, 1.48f) + curveToRelative(0.211f, 0.211f, 0.604f, 0.231f, 0.834f, 0f) + curveToRelative(0.23f, -0.23f, 0.229f, -0.606f, -0.002f, -0.836f) + lineToRelative(-1.974f, -1.922f) + curveToRelative(-0.231f, -0.23f, -0.604f, -0.23f, -0.834f, 0f) + lineToRelative(-6.516f, 6.757f) + curveToRelative(-0.087f, 0.106f, -0.14f, 0.243f, -0.14f, 0.392f) + curveToRelative(0f, 0.337f, 0.284f, 0.6f, 0.61f, 0.6f) + horizontalLineToRelative(1.714f) + curveToRelative(0.029f, 0f, 0.053f, 0.024f, 0.053f, 0.053f) + verticalLineToRelative(6.101f) + curveToRelative(0f, 0.337f, 0.273f, 0.611f, 0.61f, 0.611f) + horizontalLineTo(24.56f) + curveToRelative(0.337f, 0f, 0.61f, -0.274f, 0.61f, -0.611f) + verticalLineToRelative(-1.563f) + curveToRelative(0f, -0.016f, 0.01f, -0.029f, 0.025f, -0.033f) + curveToRelative(1.298f, -0.371f, 2.248f, -1.566f, 2.248f, -2.984f) + curveToRelative(0f, -1.217f, -0.7f, -2.27f, -1.72f, -2.779f) + lineToRelative(-0.061f, -0.03f) + curveToRelative(-0.022f, -0.01f, -0.037f, -0.032f, -0.037f, -0.057f) + curveToRelative(-0.014f, -1.617f, -0.965f, -3.009f, -2.336f, -3.661f) + curveToRelative(-0.022f, -0.01f, -0.033f, -0.032f, -0.036f, -0.057f) + curveToRelative(-0.208f, -1.654f, -1.619f, -2.933f, -3.329f, -2.933f) + curveToRelative(-0.747f, 0f, -1.438f, 0.243f, -1.996f, 0.657f) + curveToRelative(-0.263f, 0.195f, -0.334f, 0.556f, -0.146f, 0.823f) + curveToRelative(0.187f, 0.268f, 0.564f, 0.345f, 0.823f, 0.147f) + curveToRelative(0.366f, -0.28f, 0.823f, -0.445f, 1.319f, -0.445f) + curveToRelative(0.851f, 0f, 1.587f, 0.489f, 1.944f, 1.201f) + curveToRelative(0.146f, 0.292f, 0.276f, 0.707f, 0.276f, 1.406f) + curveToRelative(0f, 0.025f, 0.018f, 0.047f, 0.042f, 0.051f) + curveToRelative(0.039f, 0.008f, 0.076f, 0.018f, 0.113f, 0.029f) + curveToRelative(1.086f, 0.294f, 1.92f, 1.217f, 2.104f, 2.344f) + curveToRelative(0.025f, 0.154f, 0.075f, 0.565f, 0.075f, 1.322f) + curveToRelative(0f, 0.027f, 0.021f, 0.049f, 0.047f, 0.052f) + close() + } + path(fill = SolidColor(Color(0xFF003894))) { + moveTo(12.347f, 20.209f) + curveToRelative(0f, 0.783f, -0.633f, 1.417f, -1.416f, 1.417f) + curveToRelative(-0.546f, 0f, -0.962f, -0.216f, -1.282f, -0.559f) + curveToRelative(-0.098f, -0.105f, -0.153f, -0.249f, -0.153f, -0.404f) + curveToRelative(0f, -0.332f, 0.269f, -0.602f, 0.602f, -0.602f) + curveToRelative(0.131f, 0f, 0.295f, 0.065f, 0.379f, 0.11f) + curveToRelative(0.042f, 0.023f, 0.256f, 0.169f, 0.344f, 0.169f) + curveToRelative(0.066f, 0f, 0.119f, -0.053f, 0.119f, -0.119f) + curveToRelative(0f, -0.085f, -0.117f, -0.159f, -0.17f, -0.186f) + curveToRelative(-0.605f, -0.302f, -1.161f, -0.714f, -1.161f, -1.466f) + reflectiveCurveToRelative(0.541f, -1.345f, 1.394f, -1.345f) + curveToRelative(0.46f, 0f, 0.863f, 0.207f, 1.15f, 0.52f) + curveToRelative(0.088f, 0.095f, 0.139f, 0.22f, 0.139f, 0.359f) + curveToRelative(0f, 0.294f, -0.239f, 0.532f, -0.533f, 0.532f) + curveToRelative(-0.202f, 0f, -0.47f, -0.166f, -0.495f, -0.179f) + curveToRelative(-0.07f, -0.039f, -0.1f, -0.075f, -0.171f, -0.075f) + curveToRelative(-0.07f, 0f, -0.126f, 0.057f, -0.126f, 0.127f) + curveToRelative(0f, 0.095f, 0.112f, 0.173f, 0.377f, 0.302f) + curveToRelative(0.73f, 0.358f, 1.003f, 0.874f, 1.003f, 1.399f) + close() + moveToRelative(4.947f, 0.065f) + curveToRelative(-0.471f, 0f, -0.852f, -0.382f, -0.852f, -0.852f) + curveToRelative(0f, -0.471f, 0.381f, -0.852f, 0.852f, -0.852f) + curveToRelative(0.47f, 0f, 0.852f, 0.381f, 0.852f, 0.852f) + curveToRelative(0f, 0.47f, -0.382f, 0.852f, -0.852f, 0.852f) + close() + moveToRelative(0.001f, -3.043f) + curveToRelative(-1.195f, 0f, -2.163f, 0.981f, -2.163f, 2.191f) + reflectiveCurveToRelative(0.968f, 2.191f, 2.163f, 2.191f) + curveToRelative(1.194f, 0f, 2.162f, -0.981f, 2.162f, -2.191f) + reflectiveCurveToRelative(-0.968f, -2.191f, -2.162f, -2.191f) + close() + } + }.build() + + return _KomojuIcMinistop!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcMinistop: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcNetCash.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcNetCash.kt new file mode 100644 index 0000000..b78f2f1 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcNetCash.kt @@ -0,0 +1,150 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp +import kotlin.Suppress + +val KomojuIcon.NetCash: ImageVector + get() { + if (_KomojuIcNetCash != null) { + return _KomojuIcNetCash!! + } + _KomojuIcNetCash = ImageVector.Builder( + name = "KomojuIcNetCash", + defaultWidth = 72.dp, + defaultHeight = 17.dp, + viewportWidth = 72f, + viewportHeight = 17f, + ).apply { + path(fill = SolidColor(Color(0xFF000000))) { + moveTo(0.243f, 0.983f) + horizontalLineTo(3.757f) + lineTo(6.707f, 10.129f) + lineTo(6.742f, 10.088f) + curveTo(6.598f, 8.338f, 6.326f, 6.609f, 6.326f, 4.857f) + verticalLineTo(0.983f) + horizontalLineTo(9.867f) + verticalLineTo(16.147f) + horizontalLineTo(6.326f) + lineTo(3.574f, 7.4f) + lineTo(3.538f, 7.441f) + curveTo(3.63f, 8.869f, 3.792f, 10.276f, 3.792f, 11.701f) + verticalLineTo(16.147f) + horizontalLineTo(0.252f) + lineTo(0.243f, 0.983f) + close() + } + path(fill = SolidColor(Color(0xFF000000))) { + moveTo(11.631f, 0.983f) + horizontalLineTo(18.49f) + verticalLineTo(4.565f) + horizontalLineTo(15.322f) + verticalLineTo(6.677f) + horizontalLineTo(18.163f) + verticalLineTo(10.256f) + horizontalLineTo(15.322f) + verticalLineTo(12.569f) + horizontalLineTo(18.49f) + verticalLineTo(16.147f) + horizontalLineTo(11.631f) + verticalLineTo(0.983f) + close() + } + path(fill = SolidColor(Color(0xFF000000))) { + moveTo(22.11f, 16.147f) + verticalLineTo(4.671f) + horizontalLineTo(20.075f) + verticalLineTo(0.983f) + horizontalLineTo(27.911f) + verticalLineTo(4.671f) + horizontalLineTo(25.792f) + verticalLineTo(16.147f) + horizontalLineTo(22.11f) + close() + } + path(fill = SolidColor(Color(0xFF000000))) { + moveTo(41.441f, 5.429f) + curveTo(40.916f, 4.866f, 40.482f, 4.544f, 39.721f, 4.544f) + curveTo(37.803f, 4.544f, 37.331f, 6.904f, 37.331f, 8.565f) + curveTo(37.331f, 10.335f, 37.803f, 12.587f, 39.65f, 12.587f) + curveTo(40.482f, 12.587f, 41.007f, 12.227f, 41.603f, 11.625f) + lineTo(41.385f, 15.882f) + curveTo(40.698f, 16.24f, 39.935f, 16.426f, 39.16f, 16.425f) + curveTo(36.136f, 16.425f, 33.555f, 13.87f, 33.555f, 8.683f) + curveTo(33.555f, 1.898f, 37.756f, 0.738f, 39.547f, 0.738f) + curveTo(40.193f, 0.725f, 40.834f, 0.848f, 41.429f, 1.101f) + lineTo(41.441f, 5.429f) + close() + } + path(fill = SolidColor(Color(0xFF000000))) { + moveTo(47.197f, 10.979f) + lineTo(47.704f, 7.459f) + curveTo(47.849f, 6.515f, 47.94f, 5.55f, 48.046f, 4.603f) + horizontalLineTo(48.085f) + curveTo(48.173f, 5.55f, 48.247f, 6.515f, 48.356f, 7.459f) + lineTo(48.754f, 10.979f) + horizontalLineTo(47.197f) + close() + moveTo(53.28f, 16.147f) + lineTo(50.383f, 0.986f) + horizontalLineTo(45.875f) + lineTo(42.6f, 16.147f) + horizontalLineTo(46.4f) + lineTo(46.695f, 14.197f) + horizontalLineTo(49.176f) + lineTo(49.448f, 16.147f) + horizontalLineTo(53.28f) + close() + } + path(fill = SolidColor(Color(0xFF000000))) { + moveTo(54.236f, 11.04f) + curveTo(54.746f, 11.884f, 55.632f, 12.728f, 56.573f, 12.728f) + curveTo(56.71f, 12.735f, 56.848f, 12.715f, 56.977f, 12.668f) + curveTo(57.107f, 12.621f, 57.226f, 12.549f, 57.327f, 12.455f) + curveTo(57.428f, 12.362f, 57.51f, 12.249f, 57.567f, 12.124f) + curveTo(57.623f, 11.998f, 57.655f, 11.863f, 57.658f, 11.725f) + curveTo(57.666f, 11.416f, 57.561f, 11.115f, 57.363f, 10.878f) + curveTo(57.186f, 10.654f, 56.979f, 10.455f, 56.747f, 10.288f) + curveTo(56.048f, 9.736f, 55.433f, 9.086f, 54.921f, 8.359f) + curveTo(54.414f, 7.567f, 54.155f, 6.643f, 54.177f, 5.703f) + curveTo(54.177f, 3.933f, 55.192f, 0.717f, 58.34f, 0.717f) + curveTo(59.267f, 0.739f, 60.172f, 1.003f, 60.966f, 1.481f) + verticalLineTo(6.093f) + curveTo(60.532f, 5.329f, 59.644f, 4.461f, 58.791f, 4.461f) + curveTo(58.543f, 4.461f, 58.305f, 4.558f, 58.127f, 4.731f) + curveTo(57.949f, 4.904f, 57.845f, 5.14f, 57.838f, 5.388f) + curveTo(57.856f, 5.702f, 57.983f, 6.001f, 58.198f, 6.231f) + curveTo(58.407f, 6.455f, 58.63f, 6.664f, 58.868f, 6.857f) + curveTo(59.581f, 7.357f, 60.195f, 7.984f, 60.68f, 8.707f) + curveTo(61.159f, 9.499f, 61.392f, 10.416f, 61.349f, 11.341f) + curveTo(61.349f, 14.156f, 59.579f, 16.41f, 57.004f, 16.41f) + curveTo(56.046f, 16.403f, 55.101f, 16.191f, 54.233f, 15.788f) + lineTo(54.236f, 11.04f) + close() + } + path(fill = SolidColor(Color(0xFF000000))) { + moveTo(68.303f, 16.147f) + verticalLineTo(9.981f) + horizontalLineTo(66.533f) + verticalLineTo(16.147f) + horizontalLineTo(62.854f) + verticalLineTo(0.986f) + horizontalLineTo(66.548f) + verticalLineTo(6.414f) + horizontalLineTo(68.318f) + verticalLineTo(0.986f) + horizontalLineTo(72f) + verticalLineTo(16.147f) + horizontalLineTo(68.303f) + close() + } + }.build() + + return _KomojuIcNetCash!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcNetCash: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPaidy.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPaidy.kt new file mode 100644 index 0000000..917d08d --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPaidy.kt @@ -0,0 +1,215 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.graphics.Brush +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.PathFillType +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp +import kotlin.Suppress + +val KomojuIcon.Paidy: ImageVector + get() { + if (_KomojuIcPaidy != null) { + return _KomojuIcPaidy!! + } + _KomojuIcPaidy = ImageVector.Builder( + name = "KomojuIcPaidy", + defaultWidth = 81.dp, + defaultHeight = 24.dp, + viewportWidth = 300f, + viewportHeight = 90f, + ).apply { + path( + fill = Brush.linearGradient( + colorStops = arrayOf( + 0f to Color(0xFFA6009C), + 1f to Color(0xFFFF009C), + ), + start = Offset(7f, 78.2f), + end = Offset(79f, 12f), + ), + ) { + moveTo(42.8f, 43.5f) + lineToRelative(0.1f, 20.2f) + curveToRelative(0f, 2.5f, -2.1f, 4.5f, -4.6f, 4.5f) + curveToRelative(-2.5f, 0f, -4.5f, -2f, -4.5f, -4.5f) + verticalLineTo(33.1f) + lineToRelative(4.3f, 5.3f) + curveToRelative(2f, 2.5f, 3.3f, 3.9f, 4.7f, 5.1f) + close() + } + path( + fill = Brush.linearGradient( + colorStops = arrayOf( + 0f to Color(0xFFA6009C), + 1f to Color(0xFFFF009C), + ), + start = Offset(7.4f, 102.2f), + end = Offset(56.3f, 17.4f), + ), + ) { + moveTo(84.5f, 55.2f) + curveToRelative(0.4f, 6.7f, -3.8f, 12.2f, -8.9f, 15.6f) + curveToRelative(-1.1f, 0.7f, -18.6f, 11.9f, -24f, 14.6f) + arcToRelative(22.7f, 22.7f, 0f, isMoreThanHalf = false, isPositiveArc = true, -11.3f, 2.7f) + arcTo(26f, 26f, 0f, isMoreThanHalf = false, isPositiveArc = true, 27.2f, 85f) + arcTo(911f, 911f, 0f, isMoreThanHalf = false, isPositiveArc = true, 9.3f, 74.5f) + curveToRelative(-4.9f, -3f, -7.2f, -5.8f, -8.5f, -10.7f) + curveTo(0f, 60.8f, 0f, 57.6f, 0f, 56.7f) + verticalLineTo(31.2f) + curveToRelative(0f, -11.8f, 6.7f, -20.4f, 14.6f, -23f) + curveToRelative(8f, -2.7f, 13.9f, -1f, 18.2f, 1.9f) + curveToRelative(3.4f, 2.3f, 8.1f, 8f, 8.7f, 8.8f) + curveToRelative(0f, 0f, 6.9f, 9.1f, 9.6f, 11.5f) + curveToRelative(2.8f, 2.5f, 5f, 3.7f, 8.5f, 3.7f) + curveToRelative(5.8f, 0f, 10.6f, -4.8f, 10.6f, -10.8f) + curveToRelative(0f, -5.6f, -4.2f, -10.7f, -10.8f, -10.7f) + curveToRelative(-6.4f, 0f, -10.6f, 6.6f, -11.1f, 7.2f) + lineToRelative(-3.1f, -4.1f) + lineToRelative(-2.7f, -3.1f) + arcToRelative(20.1f, 20.1f, 0f, isMoreThanHalf = false, isPositiveArc = true, 37.1f, 10.7f) + curveToRelative(0f, 8.5f, -5.6f, 20f, -20.2f, 20f) + curveToRelative(-5.4f, 0f, -9.9f, -2f, -14.4f, -5.9f) + arcToRelative(165.7f, 165.7f, 0f, isMoreThanHalf = false, isPositiveArc = true, -11.6f, -13.8f) + curveToRelative(-4f, -4.9f, -8.2f, -9.4f, -15.9f, -6.5f) + curveToRelative(-7.2f, 3.1f, -8.4f, 10.2f, -8.4f, 14.1f) + verticalLineToRelative(25.5f) + reflectiveCurveToRelative(0f, 3f, 0.6f, 4.9f) + curveToRelative(0.7f, 2.2f, 2.7f, 4f, 4f, 4.8f) + arcToRelative(527f, 527f, 0f, isMoreThanHalf = false, isPositiveArc = false, 18.9f, 11.1f) + curveToRelative(3.4f, 1.8f, 9.2f, 2.6f, 14.5f, -0.1f) + curveToRelative(4f, -2f, 23.3f, -14.2f, 23.6f, -14.4f) + curveToRelative(4.8f, -3.5f, 4.4f, -6.6f, 4.5f, -7.5f) + arcToRelative(10.8f, 10.8f, 0f, isMoreThanHalf = false, isPositiveArc = false, 9.3f, -0.3f) + close() + } + path( + fill = Brush.linearGradient( + colorStops = arrayOf( + 0f to Color(0xFFA6009C), + 1f to Color(0xFFFF009C), + ), + start = Offset(23.4f, 97.9f), + end = Offset(98.1f, 29.2f), + ), + ) { + moveTo(79.6f, 51.5f) + arcToRelative(5.3f, 5.3f, 0f, isMoreThanHalf = false, isPositiveArc = true, -5.3f, -5.3f) + arcToRelative(5.4f, 5.4f, 0f, isMoreThanHalf = false, isPositiveArc = true, 10.7f, 0f) + curveToRelative(0f, 3f, -2.4f, 5.3f, -5.4f, 5.3f) + close() + } + path(fill = SolidColor(Color(0xFF1C1C1C))) { + moveTo(300.5f, 35f) + curveToRelative(-0.4f, 0.8f, -1f, 1.4f, -1.2f, 2.1f) + lineToRelative(-11.5f, 37.8f) + curveToRelative(-0.5f, 1.6f, -1.1f, 3.2f, -2f, 4.7f) + curveToRelative(-3f, 4.7f, -8.7f, 6.8f, -14.1f, 5.1f) + curveToRelative(-0.4f, -0.1f, -1.1f, -0.4f, -1.2f, -0.7f) + curveToRelative(-0.4f, -2f, -1.1f, -4.1f, -0.7f, -6f) + curveToRelative(0.2f, -1f, 2.1f, -2.2f, 3.5f, -2.4f) + curveToRelative(3.7f, -0.7f, 4.7f, -1.8f, 3.6f, -5.5f) + lineToRelative(-3.7f, -12.3f) + lineToRelative(-7.1f, -23.2f) + curveToRelative(-1.2f, -3.9f, 0.1f, -6.7f, 3.2f, -7.6f) + curveToRelative(3.8f, -1.1f, 6.6f, 0.5f, 7.8f, 4.5f) + curveToRelative(2f, 6.7f, 4f, 13.3f, 6.5f, 20f) + lineToRelative(2.7f, -9.3f) + curveToRelative(1f, -3.2f, 2.2f, -6.3f, 2.8f, -9.6f) + curveToRelative(1f, -5.6f, 5.9f, -8.5f, 11.2f, -4.4f) + curveToRelative(0.2f, 2.2f, 0.2f, 4.4f, 0.2f, 6.8f) + close() + } + path( + fill = SolidColor(Color(0xFF1C1C1C)), + pathFillType = PathFillType.EvenOdd, + ) { + moveTo(247f, 65.3f) + arcToRelative(27.4f, 27.4f, 0f, isMoreThanHalf = false, isPositiveArc = true, -17f, 0.1f) + curveToRelative(-5.5f, -1.7f, -8.4f, -5.8f, -9.5f, -11f) + arcToRelative(29.1f, 29.1f, 0f, isMoreThanHalf = false, isPositiveArc = true, 2.9f, -22.3f) + curveToRelative(4.4f, -6.9f, 15.8f, -8.2f, 21f, -3.6f) + curveToRelative(0.5f, 0.5f, 1.1f, 0.7f, 1.9f, 1.3f) + lineToRelative(0.2f, -2.5f) + verticalLineTo(13.5f) + curveToRelative(0.1f, -3.7f, 2.3f, -5.9f, 5.7f, -5.9f) + curveToRelative(3.2f, 0.1f, 5.5f, 2.6f, 5.5f, 6f) + curveToRelative(0.1f, 12.3f, 0.2f, 24.5f, 0f, 36.8f) + curveToRelative(-0.1f, 7.2f, -3.3f, 12.5f, -10.7f, 14.9f) + close() + moveToRelative(-13.2f, -28.4f) + curveToRelative(-4.1f, 5f, -4f, 10.5f, -1.6f, 16.2f) + curveToRelative(1.5f, 3.5f, 3.7f, 4.5f, 7.8f, 4.1f) + arcToRelative(6.4f, 6.4f, 0f, isMoreThanHalf = false, isPositiveArc = false, 5.8f, -5.3f) + curveToRelative(0.5f, -2.9f, 0.9f, -5.9f, 0.5f, -8.8f) + curveToRelative(-0.8f, -7.1f, -6.5f, -10f, -12.5f, -6.2f) + close() + moveTo(121.1f, 68f) + verticalLineToRelative(11.5f) + curveToRelative(-0.1f, 3.6f, -2.4f, 5.6f, -5.9f, 5.4f) + curveToRelative(-2.6f, -0.2f, -4.4f, -1.8f, -4.4f, -4.3f) + curveToRelative(0f, -13.1f, -0.2f, -26.2f, 0.1f, -39.3f) + curveToRelative(0.2f, -8.1f, 8.3f, -15.3f, 16.7f, -15.4f) + curveToRelative(3.3f, 0f, 6.8f, 0.3f, 9.9f, 1.3f) + curveToRelative(6.2f, 1.9f, 9f, 6.9f, 10.2f, 12.9f) + curveToRelative(1f, 5.4f, 0.6f, 10.7f, -0.9f, 15.9f) + curveToRelative(-3.4f, 11.9f, -16.8f, 13f, -23.8f, 7.4f) + lineToRelative(-1.9f, -1.3f) + verticalLineTo(68f) + close() + moveToRelative(0.1f, -19.6f) + lineToRelative(0.5f, 2.5f) + arcToRelative(8f, 8f, 0f, isMoreThanHalf = false, isPositiveArc = false, 7.1f, 6.1f) + curveToRelative(2.7f, 0.4f, 5.9f, -1.5f, 7.3f, -4.4f) + curveToRelative(2.3f, -4.5f, 1.8f, -9.1f, 0f, -13.6f) + arcToRelative(7.3f, 7.3f, 0f, isMoreThanHalf = false, isPositiveArc = false, -6.9f, -4.6f) + curveToRelative(-3.5f, 0.2f, -6.3f, 2.1f, -7.1f, 5.5f) + curveToRelative(-0.7f, 2.6f, -0.7f, 5.3f, -0.9f, 8.5f) + close() + moveTo(162f, 27.7f) + curveToRelative(7f, -4.1f, 19.7f, -2.9f, 25f, 3.6f) + arcToRelative(20f, 20f, 0f, isMoreThanHalf = false, isPositiveArc = true, 4.5f, 12.1f) + curveToRelative(0.2f, 5.5f, 0.1f, 11f, 0f, 16.6f) + curveToRelative(0f, 2.1f, -0.4f, 4f, -2.4f, 5.2f) + curveToRelative(-3.4f, 2.1f, -6.5f, 0.7f, -8.1f, -3.7f) + curveToRelative(-1.9f, 1.2f, -3.7f, 2.7f, -5.7f, 3.5f) + curveToRelative(-7.4f, 3f, -17.5f, 0.1f, -20f, -9.4f) + curveToRelative(-2.1f, -8.2f, -2.7f, -16.4f, 2.3f, -23.8f) + curveToRelative(1.1f, -1.6f, 2.8f, -2.7f, 4.4f, -4.1f) + close() + moveToRelative(18.3f, 13f) + curveToRelative(-1f, -4.3f, -3.7f, -6.9f, -7.2f, -6.8f) + curveToRelative(-3.5f, 0.2f, -6.5f, 1.3f, -7.9f, 6.4f) + curveToRelative(-0.9f, 3.3f, -1.1f, 6.5f, -0.2f, 9.9f) + curveToRelative(1.1f, 4f, 3.7f, 6.1f, 7.7f, 6.1f) + curveToRelative(3.8f, 0f, 6.8f, -2.2f, 7.5f, -6.2f) + curveToRelative(0.5f, -3f, 0.2f, -6f, 0.1f, -9.4f) + close() + } + path(fill = SolidColor(Color(0xFF1C1C1C))) { + moveTo(199.5f, 41.8f) + verticalLineToRelative(-9.4f) + curveToRelative(0.1f, -3.5f, 2.4f, -5.7f, 6.1f, -5.6f) + curveToRelative(3.6f, 0.1f, 5.7f, 2f, 5.7f, 5.6f) + verticalLineTo(60f) + curveToRelative(0f, 3.7f, -2.3f, 6.1f, -5.7f, 6.1f) + curveToRelative(-3.5f, 0f, -6f, -2.5f, -6.1f, -6.1f) + verticalLineTo(41.8f) + close() + moveToRelative(2.3f, -31.6f) + curveToRelative(3.1f, -1.9f, 6.2f, -1.5f, 8.4f, 0.8f) + curveToRelative(1.9f, 2f, 2f, 4.9f, 0.4f, 7.3f) + curveToRelative(-2f, 2.8f, -6.5f, 3.3f, -9.2f, 1.1f) + curveToRelative(-2.1f, -1.7f, -3f, -6.7f, 0.4f, -9.2f) + close() + } + }.build() + + return _KomojuIcPaidy!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcPaidy: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPayEasy.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPayEasy.kt new file mode 100644 index 0000000..40f0189 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPayEasy.kt @@ -0,0 +1,218 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.graphics.Brush +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp +import kotlin.Suppress + +val KomojuIcon.PayEasy: ImageVector + get() { + if (_KomojuIcPayEasy != null) { + return _KomojuIcPayEasy!! + } + _KomojuIcPayEasy = ImageVector.Builder( + name = "KomojuIcPayEasy", + defaultWidth = 46.dp, + defaultHeight = 42.dp, + viewportWidth = 23f, + viewportHeight = 21f, + ).apply { + path( + fill = Brush.linearGradient( + colorStops = arrayOf( + 0f to Color(0xFF1965AC), + 0.46f to Color(0xFF166CB2), + 0.6f to Color(0xFF0E7CC1), + 0.84f to Color(0xFF0492D5), + 1f to Color(0xFF009ADC), + ), + start = Offset(12.46f, 17.08f), + end = Offset(4.36f, 1.84f), + ), + ) { + moveTo(6.05f, 20.49f) + lineTo(4.22f, 19.22f) + curveTo(2.712f, 16.622f, 2.045f, 13.622f, 2.31f, 10.63f) + curveTo(2.71f, 4.83f, 4f, 2f, 4f, 2f) + lineTo(5.07f, 1.88f) + curveTo(5.784f, 1.353f, 6.597f, 0.975f, 7.46f, 0.77f) + curveTo(8.46f, 0.69f, 11.36f, 0.77f, 11.36f, 0.77f) + curveTo(12.028f, 0.95f, 12.653f, 1.261f, 13.199f, 1.685f) + curveTo(13.745f, 2.109f, 14.201f, 2.638f, 14.54f, 3.24f) + curveTo(15.333f, 4.84f, 15.613f, 6.645f, 15.34f, 8.41f) + curveTo(15.09f, 9.597f, 14.574f, 10.712f, 13.83f, 11.67f) + curveTo(12.83f, 12.67f, 11.44f, 14.06f, 10.01f, 14.06f) + curveTo(9.228f, 14.077f, 8.448f, 13.969f, 7.7f, 13.74f) + curveTo(7.483f, 16.059f, 6.927f, 18.333f, 6.05f, 20.49f) + close() + } + path(fill = SolidColor(Color(0xFF009ADC))) { + moveTo(4f, 2f) + lineTo(6f, 2.16f) + curveTo(6f, 2.16f, 3.81f, 7.49f, 4f, 10.91f) + curveTo(4.19f, 14.33f, 3.92f, 15.04f, 4.65f, 17.35f) + curveTo(4.935f, 18.453f, 5.402f, 19.5f, 6.03f, 20.45f) + lineTo(4.16f, 19.18f) + curveTo(3.379f, 17.795f, 2.828f, 16.292f, 2.53f, 14.73f) + curveTo(2.37f, 12.9f, 1.97f, 12.9f, 2.2f, 10.2f) + curveTo(2.438f, 8.221f, 2.792f, 6.258f, 3.26f, 4.32f) + curveTo(3.425f, 3.523f, 3.673f, 2.746f, 4f, 2f) + close() + } + path( + fill = Brush.linearGradient( + colorStops = arrayOf( + 0f to Color(0xFF009ADC), + 0.52f to Color(0xFFD4EDFF), + 1f to Color(0xFF1965AC), + ), + start = Offset(11.63f, 11.43f), + end = Offset(11.63f, 2.84f), + ), + ) { + moveTo(14.64f, 7.69f) + curveTo(14.56f, 5.62f, 15.04f, 3.32f, 11.06f, 2.84f) + curveTo(10.847f, 2.873f, 10.64f, 2.931f, 10.44f, 3.01f) + curveTo(10.938f, 3.383f, 11.339f, 3.87f, 11.61f, 4.43f) + curveTo(11.941f, 5.208f, 12.052f, 6.063f, 11.93f, 6.9f) + curveTo(11.794f, 7.786f, 11.409f, 8.615f, 10.82f, 9.29f) + curveTo(10.18f, 9.77f, 10.1f, 9.93f, 9.82f, 10.01f) + curveTo(9.549f, 10.163f, 9.255f, 10.271f, 8.95f, 10.33f) + horizontalLineTo(8.58f) + curveTo(8.889f, 10.672f, 9.265f, 10.948f, 9.684f, 11.139f) + curveTo(10.104f, 11.33f, 10.559f, 11.432f, 11.02f, 11.44f) + curveTo(11.317f, 11.44f, 11.612f, 11.386f, 11.89f, 11.28f) + curveTo(12.25f, 11.11f, 14.72f, 9.76f, 14.64f, 7.69f) + close() + } + path(fill = SolidColor(Color(0xFFFFFFFF))) { + moveTo(9.87f, 10f) + curveTo(10.11f, 9.92f, 10.19f, 9.76f, 10.87f, 9.28f) + curveTo(11.459f, 8.605f, 11.844f, 7.776f, 11.98f, 6.89f) + curveTo(12.102f, 6.053f, 11.991f, 5.198f, 11.66f, 4.42f) + curveTo(11.375f, 3.855f, 10.956f, 3.367f, 10.44f, 3f) + curveTo(9.53f, 3.36f, 7.91f, 4.4f, 7.8f, 7.36f) + curveTo(7.689f, 8.409f, 7.982f, 9.46f, 8.62f, 10.3f) + horizontalLineTo(9f) + curveTo(9.304f, 10.248f, 9.598f, 10.146f, 9.87f, 10f) + close() + } + path( + fill = Brush.radialGradient( + colorStops = arrayOf( + 0f to Color(0xFFC3E400), + 0.3f to Color(0xFFC1E300), + 0.41f to Color(0xFFBAE101), + 0.49f to Color(0xFFAFDE03), + 0.55f to Color(0xFF9ED806), + 0.61f to Color(0xFF88D109), + 0.63f to Color(0xFF7ACD0B), + 0.65f to Color(0xFF70CA11), + 0.77f to Color(0xFF40B931), + 0.87f to Color(0xFF1DAD49), + 0.95f to Color(0xFF08A657), + 1f to Color(0xFF00A35C), + ), + center = Offset(20.01f, 6.7f), + radius = 2.5f, + ), + ) { + moveTo(20.01f, 9.2f) + curveTo(21.391f, 9.2f, 22.51f, 8.081f, 22.51f, 6.7f) + curveTo(22.51f, 5.319f, 21.391f, 4.2f, 20.01f, 4.2f) + curveTo(18.629f, 4.2f, 17.51f, 5.319f, 17.51f, 6.7f) + curveTo(17.51f, 8.081f, 18.629f, 9.2f, 20.01f, 9.2f) + close() + } + path( + fill = Brush.radialGradient( + colorStops = arrayOf( + 0f to Color(0xFFC3E400), + 0.3f to Color(0xFFC1E300), + 0.41f to Color(0xFFBAE101), + 0.49f to Color(0xFFAFDE03), + 0.55f to Color(0xFF9ED806), + 0.61f to Color(0xFF88D109), + 0.63f to Color(0xFF7ACD0B), + 0.65f to Color(0xFF70CA11), + 0.77f to Color(0xFF40B931), + 0.87f to Color(0xFF1DAD49), + 0.95f to Color(0xFF08A657), + 1f to Color(0xFF00A35C), + ), + center = Offset(14.48f, 6.74f), + radius = 1.99f, + ), + ) { + moveTo(14.48f, 8.73f) + curveTo(15.579f, 8.73f, 16.47f, 7.839f, 16.47f, 6.74f) + curveTo(16.47f, 5.641f, 15.579f, 4.75f, 14.48f, 4.75f) + curveTo(13.381f, 4.75f, 12.49f, 5.641f, 12.49f, 6.74f) + curveTo(12.49f, 7.839f, 13.381f, 8.73f, 14.48f, 8.73f) + close() + } + path( + fill = Brush.radialGradient( + colorStops = arrayOf( + 0f to Color(0xFFC3E400), + 0.3f to Color(0xFFC1E300), + 0.41f to Color(0xFFBAE101), + 0.49f to Color(0xFFAFDE03), + 0.55f to Color(0xFF9ED806), + 0.61f to Color(0xFF88D109), + 0.63f to Color(0xFF7ACD0B), + 0.65f to Color(0xFF70CA11), + 0.77f to Color(0xFF40B931), + 0.87f to Color(0xFF1DAD49), + 0.95f to Color(0xFF08A657), + 1f to Color(0xFF00A35C), + ), + center = Offset(9.67f, 6.7f), + radius = 1.55f, + ), + ) { + moveTo(9.67f, 8.25f) + curveTo(10.526f, 8.25f, 11.22f, 7.556f, 11.22f, 6.7f) + curveTo(11.22f, 5.844f, 10.526f, 5.15f, 9.67f, 5.15f) + curveTo(8.814f, 5.15f, 8.12f, 5.844f, 8.12f, 6.7f) + curveTo(8.12f, 7.556f, 8.814f, 8.25f, 9.67f, 8.25f) + close() + } + path( + fill = Brush.radialGradient( + colorStops = arrayOf( + 0f to Color(0xFFC3E400), + 0.3f to Color(0xFFC1E300), + 0.41f to Color(0xFFBAE101), + 0.49f to Color(0xFFAFDE03), + 0.55f to Color(0xFF9ED806), + 0.61f to Color(0xFF88D109), + 0.63f to Color(0xFF7ACD0B), + 0.65f to Color(0xFF70CA11), + 0.77f to Color(0xFF40B931), + 0.87f to Color(0xFF1DAD49), + 0.95f to Color(0xFF08A657), + 1f to Color(0xFF00A35C), + ), + center = Offset(1.32f, 6.7f), + radius = 0.83f, + ), + ) { + moveTo(1.32f, 7.53f) + curveTo(1.778f, 7.53f, 2.15f, 7.158f, 2.15f, 6.7f) + curveTo(2.15f, 6.242f, 1.778f, 5.87f, 1.32f, 5.87f) + curveTo(0.862f, 5.87f, 0.49f, 6.242f, 0.49f, 6.7f) + curveTo(0.49f, 7.158f, 0.862f, 7.53f, 1.32f, 7.53f) + close() + } + }.build() + + return _KomojuIcPayEasy!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcPayEasy: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPaymentStatusCompleted.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPaymentStatusCompleted.kt new file mode 100644 index 0000000..2d84aa0 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPaymentStatusCompleted.kt @@ -0,0 +1,48 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp +import kotlin.Suppress + +val KomojuIcon.PaymentStatusCompleted: ImageVector + get() { + if (_KomojuIcPaymentStatusCompleted != null) { + return _KomojuIcPaymentStatusCompleted!! + } + _KomojuIcPaymentStatusCompleted = ImageVector.Builder( + name = "KomojuIcPaymentStatusCompleted", + defaultWidth = 49.dp, + defaultHeight = 49.dp, + viewportWidth = 49f, + viewportHeight = 49f, + ).apply { + path(fill = SolidColor(Color(0xFF3CC239))) { + moveTo(24.5f, 1.5f) + curveTo(11.8f, 1.5f, 1.5f, 11.8f, 1.5f, 24.5f) + curveTo(1.5f, 37.2f, 11.8f, 47.5f, 24.5f, 47.5f) + curveTo(37.2f, 47.5f, 47.5f, 37.2f, 47.5f, 24.5f) + curveTo(47.5f, 11.8f, 37.2f, 1.5f, 24.5f, 1.5f) + close() + moveTo(37.2f, 17.2f) + lineTo(21.2f, 33.2f) + curveTo(21f, 33.4f, 20.8f, 33.5f, 20.5f, 33.5f) + curveTo(20.2f, 33.5f, 20f, 33.4f, 19.8f, 33.2f) + lineTo(11.8f, 25.2f) + curveTo(11.4f, 24.8f, 11.4f, 24.2f, 11.8f, 23.8f) + curveTo(12.2f, 23.4f, 12.8f, 23.4f, 13.2f, 23.8f) + lineTo(20.5f, 31.1f) + lineTo(35.8f, 15.8f) + curveTo(36.2f, 15.4f, 36.8f, 15.4f, 37.2f, 15.8f) + curveTo(37.6f, 16.2f, 37.6f, 16.8f, 37.2f, 17.2f) + close() + } + }.build() + + return _KomojuIcPaymentStatusCompleted!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcPaymentStatusCompleted: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPaymentStatusFailed.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPaymentStatusFailed.kt new file mode 100644 index 0000000..f960b74 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPaymentStatusFailed.kt @@ -0,0 +1,64 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp +import kotlin.Suppress + +val KomojuIcon.PaymentStatusFailed: ImageVector + get() { + if (_KomojuIcPaymentStatusFailed != null) { + return _KomojuIcPaymentStatusFailed!! + } + _KomojuIcPaymentStatusFailed = ImageVector.Builder( + name = "KomojuIcPaymentStatusFailed", + defaultWidth = 49.dp, + defaultHeight = 49.dp, + viewportWidth = 49f, + viewportHeight = 49f, + ).apply { + path(fill = SolidColor(Color(0xFFF24D49))) { + moveTo(46.207f, 15.1f) + lineTo(33.907f, 2.8f) + curveTo(33.721f, 2.61f, 33.466f, 2.502f, 33.2f, 2.5f) + horizontalLineTo(15.8f) + curveTo(15.535f, 2.5f, 15.28f, 2.605f, 15.093f, 2.793f) + lineTo(2.793f, 15.1f) + curveTo(2.607f, 15.286f, 2.502f, 15.537f, 2.5f, 15.8f) + verticalLineTo(33.2f) + curveTo(2.5f, 33.465f, 2.605f, 33.72f, 2.793f, 33.907f) + lineTo(15.093f, 46.207f) + curveTo(15.28f, 46.395f, 15.535f, 46.5f, 15.8f, 46.5f) + horizontalLineTo(33.2f) + curveTo(33.465f, 46.5f, 33.72f, 46.395f, 33.907f, 46.207f) + lineTo(46.207f, 33.907f) + curveTo(46.395f, 33.72f, 46.5f, 33.465f, 46.5f, 33.2f) + verticalLineTo(15.8f) + curveTo(46.498f, 15.537f, 46.393f, 15.286f, 46.207f, 15.1f) + close() + moveTo(24.5f, 38.5f) + curveTo(23.395f, 38.5f, 22.5f, 37.605f, 22.5f, 36.5f) + curveTo(22.5f, 35.395f, 23.395f, 34.5f, 24.5f, 34.5f) + curveTo(25.605f, 34.5f, 26.5f, 35.395f, 26.5f, 36.5f) + curveTo(26.5f, 37.605f, 25.605f, 38.5f, 24.5f, 38.5f) + close() + moveTo(25.025f, 30.5f) + horizontalLineTo(23.976f) + curveTo(23.433f, 30.5f, 22.99f, 30.067f, 22.976f, 29.525f) + lineTo(22.526f, 11.525f) + curveTo(22.512f, 10.963f, 22.964f, 10.5f, 23.526f, 10.5f) + horizontalLineTo(25.475f) + curveTo(26.037f, 10.5f, 26.489f, 10.963f, 26.475f, 11.525f) + lineTo(26.025f, 29.525f) + curveTo(26.011f, 30.067f, 25.568f, 30.5f, 25.025f, 30.5f) + close() + } + }.build() + + return _KomojuIcPaymentStatusFailed!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcPaymentStatusFailed: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPaymentStatusKonbiniPending.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPaymentStatusKonbiniPending.kt new file mode 100644 index 0000000..cbb8dc8 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPaymentStatusKonbiniPending.kt @@ -0,0 +1,80 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.group +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.PaymentStatusKonbiniPending: ImageVector + get() { + if (_KomojuIcPaymentStatusKonbiniPending != null) { + return _KomojuIcPaymentStatusKonbiniPending!! + } + _KomojuIcPaymentStatusKonbiniPending = ImageVector.Builder( + name = "KomojuIcPaymentStatusKonbiniPending", + defaultWidth = 49.dp, + defaultHeight = 49.dp, + viewportWidth = 49f, + viewportHeight = 49f, + ).apply { + group { + path(fill = SolidColor(Color(0xFF0F1C29))) { + moveTo(46.7f, 13.1f) + lineTo(37.7f, 1.1f) + curveTo(37.4f, 0.65f, 36.95f, 0.5f, 36.5f, 0.5f) + horizontalLineTo(12.5f) + curveTo(12.05f, 0.5f, 11.6f, 0.65f, 11.3f, 1.1f) + lineTo(2.3f, 13.1f) + curveTo(2.15f, 13.4f, 2f, 13.7f, 2f, 14f) + curveTo(2f, 19.25f, 5.45f, 21.5f, 8.75f, 21.5f) + curveTo(11f, 21.5f, 12.8f, 20.75f, 14f, 19.4f) + curveTo(15.2f, 20.75f, 17.15f, 21.5f, 19.4f, 21.5f) + curveTo(21.5f, 21.5f, 23.3f, 20.75f, 24.5f, 19.55f) + curveTo(25.7f, 20.75f, 27.5f, 21.5f, 29.6f, 21.5f) + curveTo(31.85f, 21.5f, 33.8f, 20.75f, 35f, 19.4f) + curveTo(36.2f, 20.75f, 38f, 21.5f, 40.25f, 21.5f) + curveTo(43.55f, 21.5f, 47f, 19.25f, 47f, 14f) + curveTo(47f, 13.7f, 46.85f, 13.4f, 46.7f, 13.1f) + close() + } + path(fill = SolidColor(Color(0xFFFF993B))) { + moveTo(39.5f, 24.5f) + curveTo(35.15f, 24.5f, 30.5f, 27.8f, 30.5f, 33.5f) + curveTo(30.5f, 38.6f, 37.7f, 45.95f, 38.45f, 46.7f) + curveTo(38.75f, 47f, 39.2f, 47.15f, 39.5f, 47.15f) + curveTo(39.8f, 47.15f, 40.25f, 47f, 40.55f, 46.7f) + curveTo(41.3f, 45.95f, 48.5f, 38.6f, 48.5f, 33.5f) + curveTo(48.5f, 27.8f, 43.85f, 24.5f, 39.5f, 24.5f) + close() + moveTo(39.5f, 36.5f) + curveTo(37.85f, 36.5f, 36.5f, 35.15f, 36.5f, 33.5f) + curveTo(36.5f, 31.85f, 37.85f, 30.5f, 39.5f, 30.5f) + curveTo(41.15f, 30.5f, 42.5f, 31.85f, 42.5f, 33.5f) + curveTo(42.5f, 35.15f, 41.15f, 36.5f, 39.5f, 36.5f) + close() + } + path(fill = SolidColor(Color(0xFF0F1C29))) { + moveTo(27.5f, 33.5f) + curveTo(27.5f, 29.45f, 29.3f, 26.3f, 31.7f, 24.35f) + curveTo(30.95f, 24.5f, 30.35f, 24.5f, 29.6f, 24.5f) + curveTo(27.65f, 24.5f, 26f, 24.05f, 24.5f, 23.3f) + curveTo(23f, 24.05f, 21.35f, 24.5f, 19.4f, 24.5f) + curveTo(17.45f, 24.5f, 15.65f, 24.05f, 14f, 23.15f) + curveTo(12.5f, 24.05f, 10.7f, 24.5f, 8.75f, 24.5f) + curveTo(8f, 24.5f, 7.25f, 24.35f, 6.5f, 24.2f) + verticalLineTo(44f) + curveTo(6.5f, 44.9f, 7.1f, 45.5f, 8f, 45.5f) + horizontalLineTo(33.35f) + curveTo(30.65f, 42.35f, 27.5f, 37.55f, 27.5f, 33.5f) + close() + } + } + }.build() + + return _KomojuIcPaymentStatusKonbiniPending!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcPaymentStatusKonbiniPending: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPaymentStatusPrenidng.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPaymentStatusPrenidng.kt new file mode 100644 index 0000000..3324e48 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPaymentStatusPrenidng.kt @@ -0,0 +1,48 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.PaymentStatusPending: ImageVector + get() { + if (_KomojuIcPaymentStatusPending != null) { + return _KomojuIcPaymentStatusPending!! + } + _KomojuIcPaymentStatusPending = ImageVector.Builder( + name = "KomojuIcPaymentStatusPending", + defaultWidth = 49.dp, + defaultHeight = 49.dp, + viewportWidth = 24f, + viewportHeight = 24f, + ).apply { + path(fill = SolidColor(Color(0xFF000000))) { + moveTo(16.24f, 7.76f) + curveTo(15.07f, 6.59f, 13.54f, 6f, 12f, 6f) + verticalLineToRelative(6f) + lineToRelative(-4.24f, 4.24f) + curveToRelative(2.34f, 2.34f, 6.14f, 2.34f, 8.49f, 0f) + curveToRelative(2.34f, -2.34f, 2.34f, -6.14f, -0.01f, -8.48f) + close() + moveTo(12f, 2f) + curveTo(6.48f, 2f, 2f, 6.48f, 2f, 12f) + reflectiveCurveToRelative(4.48f, 10f, 10f, 10f) + reflectiveCurveToRelative(10f, -4.48f, 10f, -10f) + reflectiveCurveTo(17.52f, 2f, 12f, 2f) + close() + moveTo(12f, 20f) + curveToRelative(-4.42f, 0f, -8f, -3.58f, -8f, -8f) + reflectiveCurveToRelative(3.58f, -8f, 8f, -8f) + reflectiveCurveToRelative(8f, 3.58f, 8f, 8f) + reflectiveCurveToRelative(-3.58f, 8f, -8f, 8f) + close() + } + }.build() + + return _KomojuIcPaymentStatusPending!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcPaymentStatusPending: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPaypay.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPaypay.kt new file mode 100644 index 0000000..faf296b --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcPaypay.kt @@ -0,0 +1,53 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp +import kotlin.Suppress + +val KomojuIcon.Paypay: ImageVector + get() { + if (_KomojuIcPaypay != null) { + return _KomojuIcPaypay!! + } + _KomojuIcPaypay = ImageVector.Builder( + name = "KomojuIcPaypay", + defaultWidth = 35.dp, + defaultHeight = 33.dp, + viewportWidth = 35f, + viewportHeight = 33f, + ).apply { + path(fill = SolidColor(Color(0xFFFF0033))) { + moveTo(8.507f, 31.451f) + horizontalLineTo(7.104f) + curveToRelative(-2.441f, 0f, -4.437f, -1.99f, -4.437f, -4.423f) + verticalLineTo(10.902f) + curveToRelative(3.981f, -0.401f, 7.693f, -0.39f, 10.949f, -0.079f) + lineTo(8.507f, 31.451f) + close() + moveToRelative(18.044f, -13.94f) + curveToRelative(0.705f, -2.856f, -3.918f, -5.5f, -11.315f, -6.498f) + lineTo(12.552f, 22.15f) + curveToRelative(6.2f, 0.296f, 13.242f, -1.567f, 13.999f, -4.639f) + close() + moveTo(28.23f, 1.544f) + horizontalLineTo(7.104f) + curveToRelative(-2.362f, 0f, -4.3f, 1.863f, -4.427f, 4.186f) + curveToRelative(17.69f, -0.496f, 26.294f, 5.637f, 24.944f, 11.754f) + curveToRelative(-1.218f, 5.506f, -6.83f, 7.617f, -15.948f, 8.314f) + lineToRelative(-1.366f, 5.658f) + horizontalLineTo(28.23f) + curveToRelative(2.441f, 0f, 4.437f, -1.99f, 4.437f, -4.423f) + verticalLineTo(5.967f) + curveToRelative(0f, -2.433f, -1.996f, -4.423f, -4.437f, -4.423f) + close() + } + }.build() + + return _KomojuIcPaypay!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcPaypay: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcRakutenPay.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcRakutenPay.kt new file mode 100644 index 0000000..3e8f5cc --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcRakutenPay.kt @@ -0,0 +1,100 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.PathFillType +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp +import kotlin.Suppress + +val KomojuIcon.RakutenPay: ImageVector + get() { + if (_KomojuIcRakutenPay != null) { + return _KomojuIcRakutenPay!! + } + _KomojuIcRakutenPay = ImageVector.Builder( + name = "KomojuIcRakutenPay", + defaultWidth = 77.dp, + defaultHeight = 29.dp, + viewportWidth = 572f, + viewportHeight = 215f, + ).apply { + path( + fill = SolidColor(Color(0xFFBF0000)), + pathFillType = PathFillType.EvenOdd, + ) { + moveTo(571.6f, 41.5f) + lineToRelative(-47f, 142.5f) + curveToRelative(-5f, 15.2f, -16f, 23.7f, -30.2f, 23.7f) + curveToRelative(-8.9f, 0f, -17.1f, -3.3f, -23.3f, -9.4f) + lineToRelative(8.7f, -13.5f) + curveToRelative(4.2f, 3.7f, 8.1f, 5.4f, 13.3f, 5.4f) + curveToRelative(7.3f, 0f, 10.8f, -3.1f, 14.4f, -12.9f) + lineToRelative(2.9f, -7.9f) + lineToRelative(-45.4f, -128f) + horizontalLineToRelative(19.4f) + lineToRelative(34.8f, 101.8f) + lineToRelative(32.9f, -101.8f) + horizontalLineToRelative(19.5f) + close() + moveTo(428.4f, 158.2f) + curveToRelative(-10.2f, 12.1f, -21.8f, 17.7f, -37f, 17.7f) + curveToRelative(-34.3f, 0f, -57.8f, -28.1f, -57.8f, -68.9f) + curveToRelative(0f, -40.8f, 23.7f, -68.7f, 58.3f, -68.7f) + curveToRelative(15.6f, 0f, 26.4f, 4.6f, 36.8f, 15.4f) + lineToRelative(2.7f, -12.3f) + horizontalLineToRelative(16.7f) + verticalLineToRelative(131.1f) + horizontalLineToRelative(-16.7f) + close() + moveTo(353.5f, 107f) + curveToRelative(0f, 29.8f, 16.2f, 51.4f, 38.3f, 51.4f) + curveToRelative(22.1f, 0f, 38.1f, -21.4f, 38.1f, -51.2f) + curveToRelative(0f, -30f, -16f, -51.4f, -38.3f, -51.4f) + curveToRelative(-21.9f, 0f, -38.1f, 21.9f, -38.1f, 51.2f) + close() + moveTo(275.6f, 8.8f) + curveToRelative(29.3f, 0f, 50.2f, 20.2f, 50.2f, 49.1f) + curveToRelative(0f, 28.9f, -20.8f, 49.3f, -50.2f, 49.3f) + horizontalLineTo(240f) + verticalLineToRelative(65.3f) + horizontalLineToRelative(-18.7f) + verticalLineTo(8.8f) + close() + moveToRelative(-1.2f, 81f) + curveToRelative(18.3f, 0f, 31.4f, -13.3f, 31.4f, -31.8f) + reflectiveCurveToRelative(-12.9f, -31.6f, -31.4f, -31.6f) + horizontalLineToRelative(-34.3f) + verticalLineToRelative(63.5f) + horizontalLineToRelative(34.3f) + close() + moveToRelative(-245.3f, 125f) + lineTo(0.4f, 190.7f) + horizontalLineTo(202f) + close() + moveToRelative(32.8f, -42.1f) + horizontalLineTo(29.1f) + verticalLineTo(0.3f) + horizontalLineToRelative(54f) + curveToRelative(32.8f, 0f, 59.5f, 26.6f, 59.5f, 59.4f) + curveToRelative(0f, 19.9f, -9.9f, 37.6f, -25f, 48.4f) + lineToRelative(48.5f, 64.5f) + horizontalLineToRelative(-41f) + lineTo(85f, 119.1f) + horizontalLineTo(61.9f) + close() + moveToRelative(0f, -86.4f) + horizontalLineToRelative(21.4f) + curveTo(98f, 86.3f, 110f, 74.4f, 110f, 59.6f) + curveToRelative(0f, -14.7f, -12f, -26.7f, -26.7f, -26.7f) + horizontalLineTo(61.9f) + close() + } + }.build() + + return _KomojuIcRakutenPay!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcRakutenPay: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcSeicoMart.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcSeicoMart.kt new file mode 100644 index 0000000..eb9ae1d --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcSeicoMart.kt @@ -0,0 +1,205 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.group +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp + +val KomojuIcon.SeicoMart: ImageVector + get() { + if (_KomojuIcSeicoMart != null) { + return _KomojuIcSeicoMart!! + } + _KomojuIcSeicoMart = ImageVector.Builder( + name = "KomojuIcSeicoMart", + defaultWidth = 32.dp, + defaultHeight = 32.dp, + viewportWidth = 32f, + viewportHeight = 32f, + ).apply { + path(fill = SolidColor(Color(0xFFFFE9EA))) { + moveTo(5.333f, 0f) + lineTo(26.667f, 0f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 32f, 5.333f) + lineTo(32f, 26.667f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 26.667f, 32f) + lineTo(5.333f, 32f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 0f, 26.667f) + lineTo(0f, 5.333f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 5.333f, 0f) + close() + } + group { + path(fill = SolidColor(Color(0xFFF08300))) { + moveTo(8.941f, 16.772f) + curveTo(9.006f, 17.241f, 9.365f, 17.424f, 9.94f, 17.424f) + curveTo(10.259f, 17.424f, 10.55f, 17.353f, 10.937f, 17.169f) + lineTo(11.09f, 17.967f) + curveTo(10.679f, 18.133f, 10.168f, 18.206f, 9.731f, 18.206f) + curveTo(8.609f, 18.206f, 7.754f, 17.548f, 7.754f, 16.426f) + curveTo(7.754f, 15.303f, 8.517f, 14.651f, 9.574f, 14.651f) + curveTo(10.833f, 14.651f, 11.29f, 15.545f, 11.29f, 16.556f) + verticalLineTo(16.772f) + horizontalLineTo(8.941f) + moveTo(10.233f, 16.106f) + curveTo(10.233f, 15.715f, 10.05f, 15.395f, 9.58f, 15.395f) + curveTo(9.156f, 15.395f, 8.954f, 15.715f, 8.928f, 16.106f) + horizontalLineTo(10.233f) + close() + } + path(fill = SolidColor(Color(0xFFF08300))) { + moveTo(4.048f, 18.022f) + curveTo(4.483f, 18.151f, 4.944f, 18.207f, 5.565f, 18.207f) + curveTo(6.473f, 18.207f, 7.556f, 17.965f, 7.556f, 16.813f) + curveTo(7.556f, 15.857f, 6.786f, 15.677f, 6.106f, 15.518f) + curveTo(5.659f, 15.413f, 5.237f, 15.315f, 5.237f, 14.953f) + curveTo(5.237f, 14.76f, 5.381f, 14.531f, 6.066f, 14.531f) + curveTo(6.452f, 14.531f, 6.809f, 14.622f, 7.123f, 14.77f) + lineTo(7.278f, 13.936f) + curveTo(6.869f, 13.788f, 6.388f, 13.715f, 5.815f, 13.715f) + curveTo(4.915f, 13.715f, 4.006f, 14.132f, 4.006f, 15.066f) + curveTo(4.006f, 15.945f, 4.714f, 16.13f, 5.338f, 16.292f) + curveTo(5.793f, 16.41f, 6.221f, 16.522f, 6.221f, 16.917f) + curveTo(6.221f, 17.391f, 5.662f, 17.391f, 5.478f, 17.391f) + curveTo(4.964f, 17.391f, 4.501f, 17.265f, 4.205f, 17.161f) + lineTo(4.048f, 18.022f) + close() + } + path(fill = SolidColor(Color(0xFFF08300))) { + moveTo(13.689f, 17.346f) + curveTo(13.187f, 17.346f, 12.799f, 17.003f, 12.789f, 16.429f) + curveTo(12.799f, 15.856f, 13.187f, 15.513f, 13.689f, 15.513f) + curveTo(13.97f, 15.513f, 14.111f, 15.572f, 14.326f, 15.702f) + lineTo(14.485f, 14.84f) + curveTo(14.218f, 14.71f, 13.904f, 14.652f, 13.552f, 14.652f) + curveTo(12.432f, 14.652f, 11.579f, 15.302f, 11.575f, 16.426f) + verticalLineTo(16.433f) + curveTo(11.579f, 17.557f, 12.432f, 18.207f, 13.552f, 18.207f) + curveTo(13.904f, 18.207f, 14.218f, 18.149f, 14.485f, 18.018f) + lineTo(14.326f, 17.157f) + curveTo(14.111f, 17.287f, 13.97f, 17.346f, 13.689f, 17.346f) + close() + } + path(fill = SolidColor(Color(0xFFF08300))) { + moveTo(15.241f, 15.542f) + lineTo(15.192f, 15.594f) + lineTo(15.241f, 15.643f) + lineTo(15.293f, 15.594f) + lineTo(15.241f, 15.542f) + close() + } + path(fill = SolidColor(Color(0xFFF08300))) { + moveTo(17.019f, 17.424f) + lineTo(17.036f, 17.426f) + curveTo(17.148f, 17.454f, 17.254f, 17.474f, 17.349f, 17.474f) + curveTo(17.672f, 17.473f, 17.918f, 17.324f, 18.067f, 17.115f) + lineTo(18.086f, 17.109f) + lineTo(18.091f, 17.127f) + curveTo(17.984f, 17.402f, 17.787f, 17.651f, 17.714f, 17.707f) + curveTo(17.666f, 17.748f, 17.584f, 17.748f, 17.584f, 17.748f) + curveTo(17.316f, 17.748f, 17.144f, 17.638f, 17.004f, 17.489f) + lineTo(16.991f, 17.47f) + lineTo(16.989f, 17.445f) + lineTo(17.019f, 17.424f) + close() + } + path(fill = SolidColor(Color(0xFFF08300))) { + moveTo(17.054f, 16.963f) + curveTo(17.593f, 16.963f, 17.68f, 16.657f, 17.808f, 16.405f) + curveTo(17.808f, 16.405f, 17.946f, 16.11f, 18.177f, 16.05f) + lineTo(18.186f, 16.032f) + curveTo(18.107f, 15.668f, 17.922f, 15.346f, 17.664f, 15.096f) + lineTo(17.652f, 15.091f) + lineTo(17.641f, 15.099f) + curveTo(17.641f, 15.099f, 17.539f, 15.237f, 17.535f, 15.494f) + curveTo(17.532f, 15.681f, 17.589f, 15.846f, 17.588f, 16.032f) + curveTo(17.588f, 16.141f, 17.571f, 16.257f, 17.516f, 16.393f) + curveTo(17.436f, 16.591f, 17.299f, 16.717f, 17.178f, 16.786f) + curveTo(17.178f, 16.786f, 17.102f, 16.837f, 16.934f, 16.877f) + lineTo(16.907f, 16.923f) + lineTo(16.933f, 16.95f) + curveTo(16.933f, 16.95f, 16.969f, 16.963f, 17.054f, 16.963f) + close() + } + path(fill = SolidColor(Color(0xFFF08300))) { + moveTo(15.674f, 15.538f) + lineTo(15.681f, 15.54f) + lineTo(15.679f, 15.548f) + curveTo(15.315f, 15.989f, 15.499f, 16.445f, 15.807f, 16.57f) + curveTo(15.869f, 16.596f, 16.184f, 16.701f, 16.357f, 16.276f) + curveTo(16.452f, 16.042f, 16.429f, 15.828f, 16.529f, 15.582f) + curveTo(16.706f, 15.144f, 17.045f, 14.94f, 17.356f, 14.883f) + lineTo(17.366f, 14.875f) + lineTo(17.359f, 14.856f) + curveTo(17.073f, 14.676f, 16.734f, 14.571f, 16.37f, 14.571f) + curveTo(15.344f, 14.571f, 14.513f, 15.402f, 14.513f, 16.428f) + curveTo(14.513f, 17.454f, 15.344f, 18.286f, 16.37f, 18.286f) + curveTo(16.758f, 18.286f, 17.118f, 18.167f, 17.416f, 17.963f) + lineTo(17.42f, 17.955f) + lineTo(17.411f, 17.952f) + curveTo(17.411f, 17.952f, 16.719f, 18.142f, 16.011f, 17.886f) + curveTo(14.747f, 17.405f, 15.161f, 16.228f, 15.16f, 15.865f) + curveTo(15.159f, 15.744f, 15.111f, 15.681f, 15.069f, 15.638f) + curveTo(15.026f, 15.593f, 14.959f, 15.545f, 14.969f, 15.516f) + curveTo(14.981f, 15.485f, 15.097f, 15.479f, 15.205f, 15.492f) + curveTo(15.331f, 15.505f, 15.409f, 15.533f, 15.48f, 15.544f) + curveTo(15.547f, 15.554f, 15.636f, 15.543f, 15.674f, 15.538f) + close() + } + path(fill = SolidColor(Color(0xFFF08300))) { + moveTo(19.536f, 14.732f) + curveTo(19.238f, 14.72f, 18.467f, 14.769f, 18.467f, 15.62f) + curveTo(18.467f, 16.022f, 18.467f, 18.128f, 18.467f, 18.128f) + horizontalLineTo(19.641f) + verticalLineTo(16.693f) + curveTo(19.641f, 15.962f, 19.889f, 15.63f, 20.307f, 15.63f) + curveTo(20.639f, 15.63f, 20.776f, 15.916f, 20.776f, 16.301f) + verticalLineTo(18.128f) + horizontalLineTo(21.951f) + verticalLineTo(16.693f) + curveTo(21.951f, 15.962f, 22.198f, 15.63f, 22.615f, 15.63f) + curveTo(22.949f, 15.63f, 23.086f, 15.916f, 23.086f, 16.301f) + verticalLineTo(18.128f) + horizontalLineTo(24.26f) + verticalLineTo(16.126f) + curveTo(24.26f, 15.205f, 24.039f, 14.651f, 23.06f, 14.651f) + curveTo(22.577f, 14.651f, 22.126f, 14.847f, 21.853f, 15.303f) + curveTo(21.67f, 14.859f, 21.272f, 14.651f, 20.789f, 14.651f) + curveTo(20.254f, 14.651f, 19.785f, 14.866f, 19.55f, 15.355f) + horizontalLineTo(19.537f) + lineTo(19.536f, 14.732f) + close() + } + path(fill = SolidColor(Color(0xFFF08300))) { + moveTo(27.994f, 18.125f) + curveTo(27.941f, 17.858f, 27.927f, 17.594f, 27.927f, 17.327f) + verticalLineTo(16.061f) + curveTo(27.927f, 15.023f, 27.178f, 14.652f, 26.31f, 14.652f) + curveTo(25.808f, 14.652f, 25.39f, 14.723f, 24.972f, 14.893f) + verticalLineTo(15.689f) + curveTo(25.299f, 15.506f, 25.677f, 15.434f, 26.055f, 15.434f) + curveTo(26.479f, 15.434f, 26.825f, 15.558f, 26.832f, 16.021f) + curveTo(26.681f, 15.995f, 26.473f, 15.976f, 26.283f, 15.976f) + curveTo(25.657f, 15.976f, 24.528f, 16.1f, 24.528f, 17.137f) + curveTo(24.528f, 17.874f, 25.128f, 18.207f, 25.801f, 18.207f) + curveTo(26.283f, 18.207f, 26.609f, 18.018f, 26.877f, 17.594f) + horizontalLineTo(26.889f) + curveTo(27.113f, 18.245f, 27.971f, 18.128f, 27.994f, 18.125f) + close() + moveTo(26.108f, 17.424f) + curveTo(25.834f, 17.424f, 25.625f, 17.288f, 25.625f, 17.053f) + curveTo(25.625f, 16.726f, 25.937f, 16.603f, 26.336f, 16.603f) + curveTo(26.512f, 16.603f, 26.681f, 16.615f, 26.832f, 16.622f) + curveTo(26.832f, 17.02f, 26.551f, 17.424f, 26.108f, 17.424f) + close() + } + } + }.build() + + return _KomojuIcSeicoMart!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcSeicoMart: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcSevenEleven.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcSevenEleven.kt new file mode 100644 index 0000000..e3f0555 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcSevenEleven.kt @@ -0,0 +1,165 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp +import kotlin.Suppress + +val KomojuIcon.SevenEleven: ImageVector + get() { + if (_KomojuIcSevenEleven != null) { + return _KomojuIcSevenEleven!! + } + _KomojuIcSevenEleven = ImageVector.Builder( + name = "KomojuIcSevenEleven", + defaultWidth = 32.dp, + defaultHeight = 32.dp, + viewportWidth = 32f, + viewportHeight = 32f, + ).apply { + path(fill = SolidColor(Color(0xFFDBF0EA))) { + moveTo(5.333f, 0f) + horizontalLineToRelative(21.334f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 32f, 5.333f) + verticalLineToRelative(21.334f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 26.667f, 32f) + horizontalLineTo(5.333f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 0f, 26.667f) + verticalLineTo(5.333f) + arcTo(5.333f, 5.333f, 0f, isMoreThanHalf = false, isPositiveArc = true, 5.333f, 0f) + close() + } + path(fill = SolidColor(Color(0xFF008160))) { + moveTo(16f, 26.667f) + curveToRelative(5.891f, 0f, 10.667f, -4.776f, 10.667f, -10.667f) + reflectiveCurveTo(21.891f, 5.333f, 16f, 5.333f) + reflectiveCurveTo(5.333f, 10.109f, 5.333f, 16f) + reflectiveCurveTo(10.109f, 26.667f, 16f, 26.667f) + close() + } + path(fill = SolidColor(Color(0xFFFFFFFF))) { + moveTo(17.994f, 24.052f) + lineToRelative(0.009f, 0.639f) + horizontalLineToRelative(-4.296f) + lineToRelative(0.01f, -0.628f) + lineToRelative(-3.145f, -0.014f) + curveToRelative(-0.32f, 0f, -0.682f, -0.225f, -0.682f, -0.642f) + lineTo(8.639f, 9.08f) + curveTo(8.631f, 8.609f, 8.85f, 8.374f, 9.378f, 8.382f) + lineTo(22.6f, 8.391f) + curveToRelative(0.488f, 0.016f, 0.812f, 0.17f, 0.771f, 0.893f) + lineToRelative(-1.477f, 14.099f) + curveToRelative(0f, 0.417f, -0.289f, 0.666f, -0.609f, 0.666f) + lineToRelative(-3.291f, 0.003f) + close() + } + path(fill = SolidColor(Color(0xFFFF8300))) { + moveTo(10.986f, 10.519f) + lineToRelative(8.84f, -0.005f) + curveToRelative(-0.88f, 0.33f, -3.35f, 2.198f, -4.021f, 3.414f) + lineToRelative(-4.807f, -0.01f) + lineToRelative(-0.012f, -3.399f) + close() + } + path(fill = SolidColor(Color(0xFFFF142B))) { + moveTo(17.945f, 20.361f) + curveToRelative(-0.128f, 1.221f, -0.128f, 2.614f, -0.128f, 4.176f) + lineToRelative(-3.942f, 0.011f) + curveToRelative(0f, -1.556f, 0.084f, -2.966f, 0.211f, -4.187f) + horizontalLineToRelative(3.859f) + close() + } + path(fill = SolidColor(Color(0xFF008061))) { + moveTo(12.044f, 18.619f) + verticalLineToRelative(0.474f) + horizontalLineToRelative(-0.62f) + verticalLineToRelative(0.472f) + horizontalLineToRelative(0.62f) + verticalLineToRelative(0.539f) + horizontalLineToRelative(-1.419f) + verticalLineToRelative(-2.517f) + horizontalLineToRelative(1.419f) + verticalLineToRelative(0.564f) + horizontalLineToRelative(-0.62f) + verticalLineToRelative(0.468f) + horizontalLineToRelative(0.62f) + close() + moveToRelative(3.134f, 0f) + verticalLineToRelative(0.474f) + horizontalLineToRelative(-0.62f) + verticalLineToRelative(0.472f) + horizontalLineToRelative(0.62f) + verticalLineToRelative(0.539f) + horizontalLineToRelative(-1.414f) + verticalLineToRelative(-2.517f) + horizontalLineToRelative(1.414f) + verticalLineToRelative(0.564f) + horizontalLineToRelative(-0.62f) + verticalLineToRelative(0.468f) + horizontalLineToRelative(0.62f) + close() + moveToRelative(3.754f, -0.017f) + verticalLineToRelative(0.473f) + horizontalLineToRelative(-0.62f) + verticalLineToRelative(0.474f) + horizontalLineToRelative(0.62f) + verticalLineToRelative(0.538f) + horizontalLineToRelative(-1.418f) + verticalLineToRelative(-2.518f) + horizontalLineToRelative(1.418f) + verticalLineToRelative(0.565f) + horizontalLineToRelative(-0.62f) + verticalLineToRelative(0.468f) + horizontalLineToRelative(0.62f) + close() + moveToRelative(-5.856f, -0.998f) + verticalLineToRelative(1.978f) + lineToRelative(0.478f, -0.007f) + lineToRelative(0.006f, 0.546f) + lineToRelative(-1.282f, 0.001f) + verticalLineToRelative(-2.518f) + horizontalLineToRelative(0.798f) + close() + moveToRelative(3.35f, 1.692f) + lineToRelative(-0.292f, -1.71f) + horizontalLineToRelative(-0.815f) + lineToRelative(0.357f, 2.52f) + lineToRelative(1.172f, 0.004f) + lineToRelative(0.479f, -2.529f) + lineToRelative(-0.584f, -0.002f) + lineToRelative(-0.317f, 1.717f) + close() + moveToRelative(2.824f, -1.727f) + horizontalLineToRelative(0.763f) + verticalLineToRelative(2.518f) + horizontalLineTo(19.25f) + verticalLineToRelative(-2.518f) + close() + } + path(fill = SolidColor(Color(0xFF008160))) { + moveTo(20.014f, 18.316f) + curveToRelative(0.04f, -0.274f, 0.433f, -0.203f, 0.433f, -0.045f) + verticalLineToRelative(1.816f) + horizontalLineToRelative(0.768f) + verticalLineToRelative(-2.136f) + curveToRelative(0f, -0.453f, -0.636f, -0.636f, -1.195f, -0.234f) + lineToRelative(-0.006f, 0.599f) + close() + } + path(fill = SolidColor(Color(0xFFFF142B))) { + moveTo(18.247f, 17.347f) + curveToRelative(0.06f, -1.008f, 1.149f, -2.739f, 2.849f, -3.314f) + lineToRelative(0.001f, -3.779f) + curveToRelative(-3.521f, 1.572f, -5.981f, 4.249f, -6.472f, 7.089f) + lineToRelative(3.622f, 0.004f) + close() + } + }.build() + + return _KomojuIcSevenEleven!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcSevenEleven: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcVisa.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcVisa.kt new file mode 100644 index 0000000..ce54def --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcVisa.kt @@ -0,0 +1,116 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.group +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp +import kotlin.Suppress + +val KomojuIcon.Visa: ImageVector + get() { + if (_KomojuIcVisa != null) { + return _KomojuIcVisa!! + } + _KomojuIcVisa = ImageVector.Builder( + name = "KomojuIcVisa", + defaultWidth = 24.dp, + defaultHeight = 17.dp, + viewportWidth = 24f, + viewportHeight = 17f, + ).apply { + group { + path(fill = SolidColor(Color(0xFFFFFFFF))) { + moveTo(21.96f, 0.5f) + horizontalLineTo(2.04f) + curveTo(0.91f, 0.5f, 0f, 1.42f, 0f, 2.56f) + verticalLineToRelative(11.88f) + curveToRelative(0f, 1.14f, 0.91f, 2.06f, 2.04f, 2.06f) + horizontalLineToRelative(19.92f) + curveToRelative(1.13f, 0f, 2.04f, -0.92f, 2.04f, -2.06f) + verticalLineTo(2.56f) + curveToRelative(0f, -1.14f, -0.91f, -2.06f, -2.04f, -2.06f) + close() + } + path( + stroke = SolidColor(Color(0xFF000000)), + strokeAlpha = 0.2f, + strokeLineWidth = 0.5f, + ) { + moveTo(2.04f, 0.75f) + horizontalLineToRelative(19.92f) + curveToRelative(0.98f, 0f, 1.79f, 0.81f, 1.79f, 1.81f) + verticalLineToRelative(11.88f) + curveToRelative(0f, 1f, -0.8f, 1.81f, -1.8f, 1.81f) + horizontalLineTo(2.06f) + arcToRelative(1.8f, 1.8f, 0f, isMoreThanHalf = false, isPositiveArc = true, -1.8f, -1.81f) + verticalLineTo(2.56f) + curveToRelative(0f, -1f, 0.8f, -1.81f, 1.8f, -1.81f) + close() + } + path(fill = SolidColor(Color(0xFF1434CB))) { + moveTo(2.6f, 6.35f) + arcToRelative(7.3f, 7.3f, 0f, isMoreThanHalf = false, isPositiveArc = false, -1.83f, -0.7f) + lineToRelative(0.02f, -0.13f) + horizontalLineToRelative(2.8f) + curveToRelative(0.38f, 0.01f, 0.69f, 0.13f, 0.79f, 0.53f) + lineToRelative(0.6f, 2.93f) + lineToRelative(0.19f, 0.88f) + lineToRelative(1.7f, -4.34f) + horizontalLineToRelative(1.84f) + lineToRelative(-2.73f, 6.36f) + horizontalLineTo(4.14f) + lineTo(2.59f, 6.35f) + close() + moveToRelative(7.46f, 5.54f) + horizontalLineTo(8.32f) + lineToRelative(1.09f, -6.37f) + horizontalLineToRelative(1.74f) + lineToRelative(-1.1f, 6.37f) + close() + moveToRelative(6.3f, -6.22f) + lineToRelative(-0.24f, 1.38f) + lineToRelative(-0.16f, -0.07f) + arcToRelative(3.09f, 3.09f, 0f, isMoreThanHalf = false, isPositiveArc = false, -1.29f, -0.24f) + curveToRelative(-0.69f, 0f, -1f, 0.28f, -1f, 0.55f) + curveToRelative(0f, 0.3f, 0.37f, 0.5f, 0.98f, 0.78f) + curveToRelative(1f, 0.46f, 1.46f, 1.01f, 1.46f, 1.74f) + curveToRelative(-0.02f, 1.32f, -1.2f, 2.17f, -3.03f, 2.17f) + curveToRelative(-0.78f, 0f, -1.53f, -0.16f, -1.93f, -0.33f) + lineToRelative(0.24f, -1.43f) + lineToRelative(0.23f, 0.1f) + curveToRelative(0.56f, 0.23f, 0.93f, 0.34f, 1.63f, 0.34f) + curveToRelative(0.5f, 0f, 1.03f, -0.2f, 1.04f, -0.63f) + curveToRelative(0f, -0.28f, -0.23f, -0.48f, -0.9f, -0.79f) + curveToRelative(-0.66f, -0.3f, -1.54f, -0.81f, -1.52f, -1.73f) + curveToRelative(0f, -1.24f, 1.21f, -2.1f, 2.93f, -2.1f) + curveToRelative(0.67f, 0f, 1.21f, 0.14f, 1.56f, 0.26f) + close() + moveToRelative(2.3f, 3.96f) + horizontalLineToRelative(1.45f) + lineToRelative(-0.4f, -1.84f) + lineToRelative(-0.12f, -0.55f) + lineToRelative(-0.23f, 0.61f) + lineToRelative(-0.7f, 1.78f) + close() + moveToRelative(2.15f, -4.11f) + lineToRelative(1.4f, 6.37f) + horizontalLineToRelative(-1.6f) + lineToRelative(-0.21f, -0.96f) + horizontalLineToRelative(-2.23f) + lineToRelative(-0.37f, 0.96f) + horizontalLineToRelative(-1.82f) + lineToRelative(2.58f, -5.84f) + curveToRelative(0.18f, -0.42f, 0.5f, -0.53f, 0.9f, -0.53f) + horizontalLineToRelative(1.35f) + close() + } + } + }.build() + + return _KomojuIcVisa!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcVisa: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcWebMoney.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcWebMoney.kt new file mode 100644 index 0000000..ad85d0e --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcWebMoney.kt @@ -0,0 +1,105 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.graphics.Brush +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp +import kotlin.Suppress + +val KomojuIcon.WebMoney: ImageVector + get() { + if (_KomojuIcWebMoney != null) { + return _KomojuIcWebMoney!! + } + _KomojuIcWebMoney = ImageVector.Builder( + name = "KomojuIcWebMoney", + defaultWidth = 26.dp, + defaultHeight = 16.dp, + viewportWidth = 26f, + viewportHeight = 16f, + ).apply { + path( + fill = Brush.linearGradient( + colorStops = arrayOf( + 0.14f to Color(0xFF0A3289), + 0.16f to Color(0xFF173B82), + 0.18f to Color(0xFF395170), + 0.22f to Color(0xFF717653), + 0.26f to Color(0xFFBDA82B), + 0.29f to Color(0xFFF3CC0F), + 0.31f to Color(0xFFF1C20F), + 0.36f to Color(0xFFECA911), + 0.42f to Color(0xFFE37F13), + 0.49f to Color(0xFFD74516), + 0.55f to Color(0xFFCD1318), + 0.64f to Color(0xFFCB1319), + 0.67f to Color(0xFFC4141D), + 0.69f to Color(0xFFB81624), + 0.71f to Color(0xFFA7192E), + 0.73f to Color(0xFF911C3B), + 0.75f to Color(0xFF75204C), + 0.76f to Color(0xFF54255F), + 0.77f to Color(0xFF2F2A75), + 0.78f to Color(0xFF09308B), + 0.86f to Color(0xFF2CA53B), + 0.87f to Color(0xFF35A739), + 0.89f to Color(0xFF4FAC34), + 0.91f to Color(0xFF79B32C), + 0.94f to Color(0xFFB2BE21), + 0.97f to Color(0xFFF1CA15), + ), + start = Offset(1.67f, 10.85f), + end = Offset(24.31f, 5.2f), + ), + ) { + moveTo(2.26f, 0.78f) + curveTo(2.26f, 0.78f, 1.16f, 0.6f, 0.71f, 2.37f) + curveTo(0.26f, 4.14f, 1.59f, 11.91f, 2.48f, 13.28f) + curveTo(3.37f, 14.65f, 3.19f, 14.6f, 3.58f, 14.91f) + curveTo(3.837f, 15.147f, 4.153f, 15.309f, 4.495f, 15.38f) + curveTo(4.836f, 15.45f, 5.191f, 15.426f, 5.52f, 15.31f) + curveTo(6.62f, 15.05f, 7.29f, 12.53f, 7.46f, 11.87f) + lineTo(7.56f, 11.69f) + curveTo(7.56f, 11.69f, 9.11f, 15.64f, 10.63f, 15.41f) + curveTo(12.15f, 15.18f, 12.48f, 14.41f, 12.95f, 13.33f) + curveTo(13.42f, 12.25f, 15.2f, 4f, 15.2f, 4f) + curveTo(15.688f, 4.657f, 16.029f, 5.41f, 16.2f, 6.21f) + curveTo(16.55f, 7.65f, 16.38f, 9.21f, 17.2f, 9.21f) + curveTo(18.02f, 9.21f, 18.2f, 9.21f, 18.79f, 8f) + curveTo(19.38f, 6.79f, 20.58f, 4.1f, 20.58f, 4.1f) + curveTo(20.998f, 5.107f, 21.202f, 6.19f, 21.18f, 7.28f) + curveTo(21.36f, 9.82f, 21.73f, 14.21f, 22.62f, 14.81f) + curveTo(22.872f, 15.036f, 23.183f, 15.183f, 23.517f, 15.235f) + curveTo(23.851f, 15.286f, 24.192f, 15.239f, 24.5f, 15.1f) + curveTo(24.96f, 14.9f, 25.74f, 13.97f, 25.21f, 10.2f) + curveTo(24.68f, 6.43f, 24.14f, 4f, 23.48f, 2.71f) + curveTo(22.82f, 1.42f, 22.22f, 0.66f, 21.07f, 0.59f) + curveTo(19.92f, 0.52f, 19.26f, 1.91f, 19f, 2.48f) + curveTo(18.774f, 3.047f, 18.583f, 3.629f, 18.43f, 4.22f) + curveTo(17.972f, 3.139f, 17.363f, 2.129f, 16.62f, 1.22f) + curveTo(16.348f, 0.931f, 15.985f, 0.745f, 15.592f, 0.692f) + curveTo(15.198f, 0.639f, 14.799f, 0.723f, 14.46f, 0.93f) + curveTo(13.756f, 1.438f, 13.242f, 2.166f, 13f, 3f) + curveTo(12.5f, 4.46f, 10.87f, 11.9f, 10.87f, 11.9f) + curveTo(10.87f, 11.9f, 10.05f, 11.44f, 9.87f, 9.74f) + curveTo(9.859f, 8.89f, 9.717f, 8.047f, 9.45f, 7.24f) + curveTo(9.25f, 6.86f, 9.19f, 6.73f, 8.74f, 6.75f) + curveTo(8.489f, 6.739f, 8.24f, 6.81f, 8.033f, 6.953f) + curveTo(7.826f, 7.095f, 7.67f, 7.301f, 7.59f, 7.54f) + curveTo(7.3f, 8.2f, 6.27f, 10.19f, 6.18f, 10.48f) + curveTo(6.09f, 10.77f, 5.48f, 12f, 5.48f, 12f) + curveTo(5.156f, 10.723f, 4.935f, 9.422f, 4.82f, 8.11f) + curveTo(4.699f, 6.092f, 4.424f, 4.086f, 4f, 2.11f) + curveTo(3.67f, 1f, 3.25f, 0.92f, 2.87f, 0.85f) + curveTo(2.669f, 0.811f, 2.465f, 0.787f, 2.26f, 0.78f) + close() + } + }.build() + + return _KomojuIcWebMoney!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuIcWebMoney: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcon.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcon.kt new file mode 100644 index 0000000..3c136d3 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuIcon.kt @@ -0,0 +1,3 @@ +package com.komoju.mobile.sdk.ui.icon + +object KomojuIcon diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuImgPaymentFooter.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuImgPaymentFooter.kt new file mode 100644 index 0000000..ea8f58d --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/icon/KomojuImgPaymentFooter.kt @@ -0,0 +1,637 @@ +package com.komoju.mobile.sdk.ui.icon + +import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.graphics.Brush +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.PathFillType +import androidx.compose.ui.graphics.SolidColor +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.graphics.vector.path +import androidx.compose.ui.unit.dp +import kotlin.Suppress + +val KomojuIcon.KomojuImgPaymentFooter: ImageVector + get() { + if (_KomojuImgPaymentFooter != null) { + return _KomojuImgPaymentFooter!! + } + _KomojuImgPaymentFooter = ImageVector.Builder( + name = "KomojuImgPaymentFooter", + defaultWidth = 364.dp, + defaultHeight = 29.dp, + viewportWidth = 364f, + viewportHeight = 29f, + ).apply { + path( + fill = Brush.linearGradient( + colorStops = arrayOf( + 0f to Color(0xFF172E44), + 1f to Color(0xFF3A73AA), + ), + start = Offset(0f, 14.5f), + end = Offset(159f, 14.5f), + ), + ) { + moveTo(14f, 0.5f) + horizontalLineToRelative(131f) + arcToRelative(14f, 14f, 0f, isMoreThanHalf = false, isPositiveArc = true, 14f, 14f) + arcToRelative(14f, 14f, 0f, isMoreThanHalf = false, isPositiveArc = true, -14f, 14f) + horizontalLineTo(14f) + arcToRelative(14f, 14f, 0f, isMoreThanHalf = false, isPositiveArc = true, -14f, -14f) + arcToRelative(14f, 14f, 0f, isMoreThanHalf = false, isPositiveArc = true, 14f, -14f) + close() + } + path(fill = SolidColor(Color(0xFF7DE5FC))) { + moveTo(20f, 11.5f) + curveToRelative(-0.55f, 0f, -1f, 0.45f, -1f, 1f) + verticalLineTo(14f) + horizontalLineToRelative(2f) + verticalLineToRelative(-1.5f) + curveToRelative(0f, -0.55f, -0.45f, -1f, -1f, -1f) + close() + } + path( + fill = SolidColor(Color(0xFF7DE5FC)), + pathFillType = PathFillType.EvenOdd, + ) { + moveTo(19.71f, 21.9f) + curveToRelative(0.19f, 0.07f, 0.39f, 0.07f, 0.58f, 0f) + curveToRelative(1.26f, -0.45f, 6.21f, -2.47f, 6.21f, -6.4f) + verticalLineTo(9.74f) + curveToRelative(0f, -0.44f, -0.29f, -0.83f, -0.71f, -0.96f) + lineToRelative(-5.5f, -1.69f) + curveToRelative(-0.19f, -0.06f, -0.39f, -0.06f, -0.58f, 0f) + lineToRelative(-5.5f, 1.69f) + curveTo(13.79f, 8.91f, 13.5f, 9.3f, 13.5f, 9.74f) + verticalLineToRelative(5.76f) + curveToRelative(0f, 3.93f, 4.95f, 5.95f, 6.21f, 6.4f) + close() + moveTo(18f, 12.5f) + verticalLineTo(14f) + horizontalLineToRelative(-0.5f) + verticalLineToRelative(3f) + horizontalLineToRelative(5f) + verticalLineToRelative(-3f) + horizontalLineTo(22f) + verticalLineToRelative(-1.5f) + curveToRelative(0f, -1.1f, -0.9f, -2f, -2f, -2f) + reflectiveCurveToRelative(-2f, 0.9f, -2f, 2f) + close() + } + path(fill = SolidColor(Color(0xFFFFFFFF))) { + moveTo(40.34f, 19.61f) + curveToRelative(-2.22f, 0f, -3.68f, -1.34f, -3.78f, -3.4f) + horizontalLineToRelative(1.78f) + curveToRelative(0.1f, 1.09f, 0.83f, 1.79f, 2f, 1.79f) + curveToRelative(1.05f, 0f, 1.78f, -0.42f, 1.78f, -1.29f) + curveToRelative(0f, -2.1f, -5.26f, -0.64f, -5.26f, -4.39f) + curveToRelative(0f, -1.61f, 1.38f, -2.73f, 3.37f, -2.73f) + curveToRelative(2.07f, 0f, 3.47f, 1.19f, 3.56f, 3.02f) + horizontalLineToRelative(-1.77f) + curveToRelative(-0.08f, -0.85f, -0.75f, -1.43f, -1.79f, -1.43f) + curveToRelative(-0.97f, 0f, -1.57f, 0.45f, -1.57f, 1.14f) + curveToRelative(0f, 2.17f, 5.34f, 0.54f, 5.34f, 4.37f) + curveToRelative(0f, 1.82f, -1.5f, 2.92f, -3.66f, 2.92f) + close() + moveToRelative(4.44f, -3.67f) + curveToRelative(0f, -1.86f, 1.15f, -3.61f, 3.46f, -3.61f) + curveToRelative(2.36f, 0f, 3.43f, 1.72f, 3.43f, 3.4f) + curveToRelative(0f, 0.24f, -0.02f, 0.45f, -0.03f, 0.59f) + horizontalLineToRelative(-5.21f) + curveToRelative(0.13f, 1.14f, 0.85f, 1.86f, 1.95f, 1.86f) + curveToRelative(0.88f, 0f, 1.45f, -0.36f, 1.63f, -1.03f) + horizontalLineToRelative(1.68f) + curveToRelative(-0.26f, 1.5f, -1.58f, 2.46f, -3.31f, 2.46f) + curveToRelative(-2.31f, 0f, -3.6f, -1.82f, -3.6f, -3.67f) + close() + moveToRelative(1.69f, -0.75f) + horizontalLineToRelative(3.47f) + curveToRelative(-0.07f, -0.9f, -0.68f, -1.57f, -1.7f, -1.57f) + curveToRelative(-0.97f, 0f, -1.59f, 0.5f, -1.77f, 1.57f) + close() + moveToRelative(9.59f, 4.42f) + curveToRelative(-2.2f, 0f, -3.58f, -1.62f, -3.58f, -3.64f) + curveToRelative(0f, -2.01f, 1.38f, -3.64f, 3.58f, -3.64f) + curveToRelative(1.78f, 0f, 3.22f, 1.07f, 3.37f, 2.69f) + horizontalLineToRelative(-1.7f) + curveToRelative(-0.13f, -0.7f, -0.82f, -1.2f, -1.63f, -1.2f) + curveToRelative(-1.19f, 0f, -1.83f, 0.92f, -1.83f, 2.15f) + reflectiveCurveToRelative(0.66f, 2.16f, 1.86f, 2.16f) + curveToRelative(0.81f, 0f, 1.44f, -0.46f, 1.61f, -1.16f) + horizontalLineToRelative(1.74f) + curveToRelative(-0.23f, 1.54f, -1.6f, 2.64f, -3.42f, 2.64f) + close() + moveToRelative(11.07f, -7.17f) + verticalLineToRelative(7.06f) + horizontalLineToRelative(-1.72f) + verticalLineToRelative(-1.09f) + curveToRelative(-0.39f, 0.77f, -1.19f, 1.2f, -2.2f, 1.2f) + curveToRelative(-1.6f, 0f, -2.63f, -1.15f, -2.63f, -2.8f) + verticalLineToRelative(-4.37f) + horizontalLineToRelative(1.72f) + verticalLineToRelative(4.01f) + curveToRelative(0f, 0.96f, 0.59f, 1.64f, 1.47f, 1.64f) + curveToRelative(0.97f, 0f, 1.64f, -0.76f, 1.64f, -1.8f) + verticalLineToRelative(-3.85f) + horizontalLineToRelative(1.72f) + close() + moveToRelative(4.79f, 1.45f) + curveToRelative(-1.09f, 0f, -1.53f, 0.93f, -1.53f, 2.28f) + verticalLineToRelative(3.33f) + horizontalLineToRelative(-1.72f) + verticalLineToRelative(-7.06f) + horizontalLineToRelative(1.72f) + verticalLineToRelative(1.25f) + curveToRelative(0.35f, -0.9f, 0.9f, -1.25f, 1.81f, -1.25f) + horizontalLineToRelative(0.83f) + verticalLineToRelative(1.45f) + horizontalLineToRelative(-1.11f) + close() + moveToRelative(1.46f, 2.05f) + curveToRelative(0f, -1.86f, 1.15f, -3.61f, 3.46f, -3.61f) + curveToRelative(2.36f, 0f, 3.43f, 1.72f, 3.43f, 3.4f) + curveToRelative(0f, 0.24f, -0.02f, 0.45f, -0.03f, 0.59f) + horizontalLineToRelative(-5.21f) + curveToRelative(0.13f, 1.14f, 0.86f, 1.86f, 1.95f, 1.86f) + curveToRelative(0.88f, 0f, 1.45f, -0.36f, 1.64f, -1.03f) + horizontalLineToRelative(1.68f) + curveToRelative(-0.27f, 1.5f, -1.59f, 2.46f, -3.32f, 2.46f) + curveToRelative(-2.31f, 0f, -3.6f, -1.82f, -3.6f, -3.67f) + close() + moveToRelative(1.69f, -0.75f) + horizontalLineToRelative(3.48f) + curveToRelative(-0.07f, -0.9f, -0.69f, -1.57f, -1.71f, -1.57f) + curveToRelative(-0.97f, 0f, -1.58f, 0.5f, -1.77f, 1.57f) + close() + moveToRelative(14.04f, 4.42f) + curveToRelative(-2.6f, 0f, -4.86f, -1.68f, -4.86f, -5.01f) + reflectiveCurveToRelative(2.3f, -5.01f, 4.86f, -5.01f) + curveToRelative(2.37f, 0f, 4.16f, 1.38f, 4.42f, 3.41f) + horizontalLineTo(91.6f) + curveToRelative(-0.14f, -1.07f, -1.17f, -1.82f, -2.49f, -1.82f) + curveToRelative(-1.71f, 0f, -3f, 1.19f, -3f, 3.42f) + reflectiveCurveToRelative(1.29f, 3.4f, 3f, 3.4f) + curveToRelative(1.34f, 0f, 2.38f, -0.74f, 2.55f, -1.8f) + horizontalLineToRelative(1.85f) + curveToRelative(-0.2f, 2.03f, -1.99f, 3.41f, -4.4f, 3.41f) + close() + moveToRelative(5.68f, -0.11f) + verticalLineTo(9.42f) + horizontalLineToRelative(1.71f) + verticalLineToRelative(4.12f) + curveToRelative(0.39f, -0.77f, 1.2f, -1.21f, 2.21f, -1.21f) + curveToRelative(1.58f, 0f, 2.62f, 1.15f, 2.62f, 2.8f) + verticalLineToRelative(4.37f) + horizontalLineToRelative(-1.71f) + verticalLineToRelative(-4f) + curveToRelative(0f, -0.97f, -0.6f, -1.64f, -1.49f, -1.64f) + curveToRelative(-0.95f, 0f, -1.63f, 0.75f, -1.63f, 1.79f) + verticalLineToRelative(3.85f) + horizontalLineToRelative(-1.71f) + close() + moveToRelative(7.7f, -3.56f) + curveToRelative(0f, -1.86f, 1.15f, -3.61f, 3.46f, -3.61f) + curveToRelative(2.36f, 0f, 3.43f, 1.72f, 3.43f, 3.4f) + curveToRelative(0f, 0.24f, -0.02f, 0.45f, -0.03f, 0.59f) + horizontalLineToRelative(-5.21f) + curveToRelative(0.13f, 1.14f, 0.85f, 1.86f, 1.95f, 1.86f) + curveToRelative(0.88f, 0f, 1.45f, -0.36f, 1.63f, -1.03f) + horizontalLineToRelative(1.68f) + curveToRelative(-0.26f, 1.5f, -1.58f, 2.46f, -3.31f, 2.46f) + curveToRelative(-2.31f, 0f, -3.6f, -1.82f, -3.6f, -3.67f) + close() + moveToRelative(1.69f, -0.75f) + horizontalLineToRelative(3.47f) + curveToRelative(-0.07f, -0.9f, -0.68f, -1.57f, -1.7f, -1.57f) + curveToRelative(-0.97f, 0f, -1.59f, 0.5f, -1.77f, 1.57f) + close() + moveToRelative(9.59f, 4.42f) + curveToRelative(-2.2f, 0f, -3.59f, -1.62f, -3.59f, -3.64f) + curveToRelative(0f, -2.01f, 1.39f, -3.64f, 3.59f, -3.64f) + curveToRelative(1.78f, 0f, 3.22f, 1.07f, 3.37f, 2.69f) + horizontalLineToRelative(-1.71f) + curveToRelative(-0.12f, -0.7f, -0.81f, -1.2f, -1.62f, -1.2f) + curveToRelative(-1.19f, 0f, -1.83f, 0.92f, -1.83f, 2.15f) + reflectiveCurveToRelative(0.66f, 2.16f, 1.86f, 2.16f) + curveToRelative(0.81f, 0f, 1.44f, -0.46f, 1.61f, -1.16f) + horizontalLineToRelative(1.73f) + curveToRelative(-0.22f, 1.54f, -1.59f, 2.64f, -3.41f, 2.64f) + close() + moveToRelative(6.34f, -0.11f) + horizontalLineToRelative(-1.72f) + verticalLineTo(9.42f) + horizontalLineToRelative(1.72f) + verticalLineToRelative(5.6f) + lineToRelative(2.7f, -2.58f) + horizontalLineToRelative(2.18f) + lineToRelative(-2.87f, 2.78f) + lineToRelative(3.11f, 4.28f) + horizontalLineToRelative(-2.08f) + lineToRelative(-2.2f, -3.15f) + lineToRelative(-0.84f, 0.81f) + verticalLineToRelative(2.34f) + close() + moveToRelative(8.89f, 0.11f) + curveToRelative(-2.15f, 0f, -3.69f, -1.54f, -3.69f, -3.64f) + reflectiveCurveToRelative(1.54f, -3.64f, 3.69f, -3.64f) + curveToRelative(2.14f, 0f, 3.68f, 1.54f, 3.68f, 3.64f) + reflectiveCurveToRelative(-1.54f, 3.64f, -3.68f, 3.64f) + close() + moveToRelative(-1.96f, -3.64f) + curveToRelative(0f, 1.28f, 0.79f, 2.16f, 1.96f, 2.16f) + curveToRelative(1.16f, 0f, 1.95f, -0.88f, 1.95f, -2.16f) + curveToRelative(0f, -1.27f, -0.79f, -2.15f, -1.95f, -2.15f) + curveToRelative(-1.17f, 0f, -1.96f, 0.88f, -1.96f, 2.15f) + close() + moveToRelative(13.36f, -3.53f) + verticalLineToRelative(7.06f) + horizontalLineToRelative(-1.72f) + verticalLineToRelative(-1.09f) + curveToRelative(-0.4f, 0.77f, -1.19f, 1.2f, -2.2f, 1.2f) + curveToRelative(-1.6f, 0f, -2.63f, -1.15f, -2.63f, -2.8f) + verticalLineToRelative(-4.37f) + horizontalLineToRelative(1.72f) + verticalLineToRelative(4.01f) + curveToRelative(0f, 0.96f, 0.59f, 1.64f, 1.47f, 1.64f) + curveToRelative(0.96f, 0f, 1.64f, -0.76f, 1.64f, -1.8f) + verticalLineToRelative(-3.85f) + horizontalLineToRelative(1.72f) + close() + moveToRelative(2.41f, -2.12f) + horizontalLineToRelative(1.72f) + verticalLineToRelative(2.12f) + horizontalLineToRelative(1.96f) + verticalLineToRelative(1.45f) + horizontalLineToRelative(-1.96f) + verticalLineToRelative(3.08f) + curveToRelative(0f, 0.71f, 0.38f, 1.07f, 1.02f, 1.07f) + horizontalLineToRelative(0.94f) + verticalLineToRelative(1.46f) + horizontalLineToRelative(-1.13f) + curveToRelative(-1.54f, 0f, -2.55f, -0.9f, -2.55f, -2.46f) + verticalLineToRelative(-3.15f) + horizontalLineToRelative(-1.39f) + verticalLineToRelative(-1.45f) + horizontalLineToRelative(1.39f) + verticalLineToRelative(-2.12f) + close() + } + path( + fill = SolidColor(Color(0xFF0F1C29)), + fillAlpha = 0.5f, + strokeAlpha = 0.5f, + ) { + moveTo(214.99f, 9.7f) + horizontalLineToRelative(3.8f) + curveToRelative(0.64f, 0f, 1.2f, 0.13f, 1.68f, 0.38f) + curveToRelative(0.47f, 0.24f, 0.84f, 0.59f, 1.09f, 1.03f) + curveToRelative(0.26f, 0.45f, 0.39f, 0.97f, 0.39f, 1.54f) + curveToRelative(0f, 0.58f, -0.13f, 1.1f, -0.39f, 1.54f) + curveToRelative(-0.25f, 0.45f, -0.62f, 0.8f, -1.09f, 1.05f) + curveToRelative(-0.48f, 0.25f, -1.04f, 0.37f, -1.68f, 0.37f) + horizontalLineToRelative(-2.34f) + verticalLineToRelative(3.89f) + horizontalLineToRelative(-1.46f) + verticalLineTo(9.7f) + close() + moveToRelative(3.76f, 4.65f) + curveToRelative(0.58f, 0f, 1.02f, -0.16f, 1.31f, -0.48f) + curveToRelative(0.29f, -0.32f, 0.44f, -0.72f, 0.44f, -1.22f) + curveToRelative(0f, -0.49f, -0.15f, -0.9f, -0.44f, -1.21f) + curveToRelative(-0.29f, -0.32f, -0.73f, -0.48f, -1.31f, -0.48f) + horizontalLineToRelative(-2.3f) + verticalLineToRelative(3.39f) + horizontalLineToRelative(2.3f) + close() + moveToRelative(7.36f, 5.26f) + curveToRelative(-0.7f, 0f, -1.32f, -0.15f, -1.87f, -0.46f) + curveToRelative(-0.55f, -0.32f, -0.99f, -0.75f, -1.3f, -1.3f) + curveToRelative(-0.31f, -0.55f, -0.47f, -1.18f, -0.47f, -1.88f) + reflectiveCurveToRelative(0.16f, -1.32f, 0.47f, -1.87f) + curveToRelative(0.31f, -0.55f, 0.75f, -0.98f, 1.3f, -1.29f) + curveToRelative(0.55f, -0.32f, 1.17f, -0.48f, 1.87f, -0.48f) + curveToRelative(0.7f, 0f, 1.33f, 0.16f, 1.88f, 0.48f) + curveToRelative(0.55f, 0.31f, 0.98f, 0.74f, 1.29f, 1.29f) + curveToRelative(0.31f, 0.55f, 0.46f, 1.17f, 0.46f, 1.87f) + curveToRelative(0f, 0.7f, -0.15f, 1.33f, -0.46f, 1.88f) + curveToRelative(-0.31f, 0.55f, -0.74f, 0.98f, -1.29f, 1.3f) + curveToRelative(-0.55f, 0.31f, -1.18f, 0.46f, -1.88f, 0.46f) + close() + moveToRelative(-2.25f, -3.64f) + curveToRelative(0f, 0.72f, 0.21f, 1.31f, 0.62f, 1.77f) + curveToRelative(0.42f, 0.45f, 0.96f, 0.68f, 1.63f, 0.68f) + curveToRelative(0.67f, 0f, 1.2f, -0.23f, 1.61f, -0.68f) + curveToRelative(0.42f, -0.46f, 0.63f, -1.05f, 0.63f, -1.77f) + reflectiveCurveToRelative(-0.21f, -1.3f, -0.63f, -1.76f) + curveToRelative(-0.41f, -0.46f, -0.94f, -0.69f, -1.61f, -0.69f) + curveToRelative(-0.67f, 0f, -1.21f, 0.23f, -1.63f, 0.69f) + curveToRelative(-0.41f, 0.46f, -0.62f, 1.04f, -0.62f, 1.76f) + close() + moveToRelative(6.36f, -3.53f) + horizontalLineToRelative(1.36f) + lineToRelative(1.45f, 5.25f) + lineToRelative(1.6f, -5.25f) + horizontalLineToRelative(1.29f) + lineToRelative(1.58f, 5.25f) + lineToRelative(1.44f, -5.25f) + horizontalLineToRelative(1.37f) + lineToRelative(-2.18f, 7.06f) + horizontalLineToRelative(-1.26f) + lineToRelative(-1.61f, -5.26f) + lineToRelative(-1.6f, 5.26f) + horizontalLineToRelative(-1.26f) + lineToRelative(-2.18f, -7.06f) + close() + moveToRelative(10.57f, 3.49f) + curveToRelative(0f, -0.66f, 0.14f, -1.26f, 0.41f, -1.81f) + curveToRelative(0.27f, -0.55f, 0.66f, -0.98f, 1.18f, -1.3f) + curveToRelative(0.51f, -0.32f, 1.12f, -0.49f, 1.82f, -0.49f) + reflectiveCurveToRelative(1.3f, 0.16f, 1.8f, 0.46f) + curveToRelative(0.51f, 0.3f, 0.89f, 0.71f, 1.15f, 1.22f) + curveToRelative(0.26f, 0.51f, 0.39f, 1.06f, 0.39f, 1.67f) + curveToRelative(0f, 0.18f, -0.01f, 0.36f, -0.03f, 0.53f) + horizontalLineToRelative(-5.39f) + curveToRelative(0.06f, 0.67f, 0.29f, 1.21f, 0.69f, 1.62f) + curveToRelative(0.4f, 0.41f, 0.91f, 0.62f, 1.53f, 0.62f) + curveToRelative(0.51f, 0f, 0.93f, -0.11f, 1.26f, -0.32f) + curveToRelative(0.32f, -0.22f, 0.54f, -0.52f, 0.64f, -0.93f) + horizontalLineToRelative(1.36f) + curveToRelative(-0.13f, 0.73f, -0.49f, 1.32f, -1.08f, 1.75f) + curveToRelative(-0.59f, 0.44f, -1.32f, 0.66f, -2.18f, 0.66f) + curveToRelative(-0.71f, 0f, -1.34f, -0.17f, -1.88f, -0.5f) + curveToRelative(-0.53f, -0.34f, -0.94f, -0.79f, -1.23f, -1.35f) + curveToRelative(-0.29f, -0.56f, -0.44f, -1.17f, -0.44f, -1.83f) + close() + moveToRelative(5.38f, -0.71f) + curveToRelative(-0.05f, -0.55f, -0.24f, -0.98f, -0.59f, -1.31f) + curveToRelative(-0.34f, -0.32f, -0.81f, -0.49f, -1.38f, -0.49f) + curveToRelative(-0.55f, 0f, -1.01f, 0.16f, -1.36f, 0.47f) + curveToRelative(-0.35f, 0.29f, -0.57f, 0.74f, -0.67f, 1.33f) + horizontalLineToRelative(4f) + close() + moveToRelative(5.82f, -1.6f) + curveToRelative(-1.14f, 0f, -1.71f, 0.9f, -1.71f, 2.69f) + verticalLineToRelative(3.19f) + horizontalLineToRelative(-1.35f) + verticalLineToRelative(-7.06f) + horizontalLineToRelative(1.35f) + verticalLineToRelative(1.36f) + curveToRelative(0.16f, -0.47f, 0.39f, -0.82f, 0.69f, -1.03f) + curveToRelative(0.3f, -0.22f, 0.69f, -0.33f, 1.19f, -0.33f) + horizontalLineToRelative(0.85f) + verticalLineToRelative(1.18f) + horizontalLineToRelative(-1.02f) + close() + moveToRelative(1.44f, 2.31f) + curveToRelative(0f, -0.66f, 0.13f, -1.26f, 0.4f, -1.81f) + reflectiveCurveToRelative(0.67f, -0.98f, 1.18f, -1.3f) + curveToRelative(0.51f, -0.32f, 1.12f, -0.49f, 1.82f, -0.49f) + reflectiveCurveToRelative(1.3f, 0.16f, 1.81f, 0.46f) + curveToRelative(0.5f, 0.3f, 0.88f, 0.71f, 1.14f, 1.22f) + curveToRelative(0.26f, 0.51f, 0.39f, 1.06f, 0.39f, 1.67f) + curveToRelative(0f, 0.18f, 0f, 0.36f, -0.02f, 0.53f) + horizontalLineToRelative(-5.39f) + curveToRelative(0.05f, 0.67f, 0.28f, 1.21f, 0.68f, 1.62f) + curveToRelative(0.4f, 0.41f, 0.91f, 0.62f, 1.53f, 0.62f) + curveToRelative(0.51f, 0f, 0.93f, -0.11f, 1.26f, -0.32f) + curveToRelative(0.33f, -0.22f, 0.54f, -0.52f, 0.64f, -0.93f) + horizontalLineToRelative(1.36f) + curveToRelative(-0.13f, 0.73f, -0.49f, 1.32f, -1.08f, 1.75f) + curveToRelative(-0.58f, 0.44f, -1.31f, 0.66f, -2.18f, 0.66f) + curveToRelative(-0.71f, 0f, -1.34f, -0.17f, -1.88f, -0.5f) + curveToRelative(-0.53f, -0.34f, -0.94f, -0.79f, -1.23f, -1.35f) + curveToRelative(-0.29f, -0.56f, -0.43f, -1.17f, -0.43f, -1.83f) + close() + moveToRelative(5.37f, -0.71f) + curveToRelative(-0.04f, -0.55f, -0.24f, -0.98f, -0.59f, -1.31f) + curveToRelative(-0.34f, -0.32f, -0.8f, -0.49f, -1.38f, -0.49f) + curveToRelative(-0.55f, 0f, -1f, 0.16f, -1.36f, 0.47f) + curveToRelative(-0.34f, 0.29f, -0.57f, 0.74f, -0.67f, 1.33f) + horizontalLineToRelative(4f) + close() + moveToRelative(5.74f, 4.39f) + curveToRelative(-0.71f, 0f, -1.32f, -0.15f, -1.84f, -0.46f) + curveToRelative(-0.5f, -0.32f, -0.89f, -0.75f, -1.16f, -1.29f) + curveToRelative(-0.26f, -0.55f, -0.39f, -1.18f, -0.39f, -1.89f) + reflectiveCurveToRelative(0.13f, -1.33f, 0.39f, -1.87f) + curveToRelative(0.27f, -0.55f, 0.66f, -0.98f, 1.16f, -1.29f) + curveToRelative(0.52f, -0.32f, 1.13f, -0.48f, 1.82f, -0.48f) + curveToRelative(0.48f, 0f, 0.92f, 0.11f, 1.32f, 0.32f) + curveToRelative(0.4f, 0.21f, 0.71f, 0.48f, 0.93f, 0.83f) + verticalLineTo(9.49f) + horizontalLineToRelative(1.35f) + verticalLineTo(19.5f) + horizontalLineToRelative(-1.35f) + verticalLineToRelative(-1.05f) + curveToRelative(-0.22f, 0.35f, -0.53f, 0.64f, -0.93f, 0.85f) + curveToRelative(-0.4f, 0.21f, -0.83f, 0.31f, -1.3f, 0.31f) + close() + moveToRelative(-2f, -3.64f) + curveToRelative(0f, 0.74f, 0.19f, 1.33f, 0.59f, 1.78f) + curveToRelative(0.39f, 0.45f, 0.91f, 0.67f, 1.56f, 0.67f) + curveToRelative(0.66f, 0f, 1.18f, -0.22f, 1.57f, -0.67f) + curveToRelative(0.4f, -0.45f, 0.6f, -1.04f, 0.6f, -1.78f) + reflectiveCurveToRelative(-0.2f, -1.33f, -0.6f, -1.78f) + curveToRelative(-0.39f, -0.44f, -0.91f, -0.67f, -1.57f, -0.67f) + curveToRelative(-0.65f, 0f, -1.17f, 0.23f, -1.56f, 0.67f) + curveToRelative(-0.4f, 0.45f, -0.59f, 1.04f, -0.59f, 1.78f) + close() + moveToRelative(14.24f, 3.64f) + curveToRelative(-0.47f, 0f, -0.9f, -0.1f, -1.3f, -0.31f) + curveToRelative(-0.41f, -0.21f, -0.71f, -0.5f, -0.93f, -0.85f) + verticalLineToRelative(1.05f) + horizontalLineToRelative(-1.36f) + verticalLineTo(9.49f) + horizontalLineToRelative(1.36f) + verticalLineToRelative(3.99f) + curveToRelative(0.22f, -0.35f, 0.52f, -0.62f, 0.93f, -0.83f) + curveToRelative(0.4f, -0.21f, 0.84f, -0.32f, 1.31f, -0.32f) + curveToRelative(0.7f, 0f, 1.3f, 0.16f, 1.81f, 0.48f) + curveToRelative(0.51f, 0.31f, 0.9f, 0.74f, 1.16f, 1.29f) + curveToRelative(0.27f, 0.54f, 0.41f, 1.16f, 0.41f, 1.87f) + curveToRelative(0f, 0.71f, -0.14f, 1.34f, -0.41f, 1.89f) + curveToRelative(-0.26f, 0.54f, -0.65f, 0.97f, -1.16f, 1.29f) + curveToRelative(-0.51f, 0.31f, -1.11f, 0.46f, -1.82f, 0.46f) + close() + moveToRelative(-2.33f, -3.64f) + curveToRelative(0f, 0.74f, 0.2f, 1.33f, 0.59f, 1.78f) + curveToRelative(0.4f, 0.45f, 0.93f, 0.67f, 1.58f, 0.67f) + curveToRelative(0.66f, 0f, 1.18f, -0.22f, 1.57f, -0.67f) + curveToRelative(0.39f, -0.45f, 0.59f, -1.04f, 0.59f, -1.78f) + reflectiveCurveToRelative(-0.2f, -1.33f, -0.59f, -1.78f) + curveToRelative(-0.39f, -0.44f, -0.91f, -0.67f, -1.57f, -0.67f) + curveToRelative(-0.65f, 0f, -1.18f, 0.23f, -1.58f, 0.67f) + curveToRelative(-0.39f, 0.45f, -0.59f, 1.04f, -0.59f, 1.78f) + close() + moveToRelative(8.7f, 3.6f) + lineToRelative(-2.62f, -7.13f) + horizontalLineToRelative(1.4f) + lineToRelative(1.85f, 5.3f) + lineToRelative(1.86f, -5.3f) + horizontalLineToRelative(1.4f) + lineToRelative(-2.48f, 6.81f) + lineToRelative(-1.06f, 3.11f) + horizontalLineToRelative(-1.3f) + lineToRelative(0.95f, -2.79f) + close() + } + path( + fill = SolidColor(Color(0xFF0F1C29)), + fillAlpha = 0.5f, + strokeAlpha = 0.5f, + ) { + moveTo(305.25f, 10.57f) + curveToRelative(-1.06f, 1.04f, -1.58f, 2.33f, -1.58f, 3.84f) + curveToRelative(0f, 1.52f, 0.52f, 2.8f, 1.58f, 3.86f) + curveToRelative(1.05f, 1.04f, 2.37f, 1.56f, 3.93f, 1.56f) + reflectiveCurveToRelative(2.86f, -0.52f, 3.91f, -1.56f) + curveToRelative(1.06f, -1.06f, 1.59f, -2.34f, 1.59f, -3.86f) + curveToRelative(0f, -1.51f, -0.53f, -2.8f, -1.59f, -3.84f) + curveToRelative(-1.05f, -1.05f, -2.35f, -1.57f, -3.91f, -1.57f) + reflectiveCurveToRelative(-2.88f, 0.52f, -3.93f, 1.57f) + close() + moveToRelative(1.86f, 5.98f) + curveToRelative(-0.55f, -0.59f, -0.82f, -1.3f, -0.82f, -2.14f) + curveToRelative(0f, -0.84f, 0.27f, -1.54f, 0.82f, -2.12f) + curveToRelative(0.55f, -0.6f, 1.24f, -0.89f, 2.07f, -0.89f) + curveToRelative(0.82f, 0f, 1.51f, 0.29f, 2.06f, 0.89f) + curveToRelative(0.55f, 0.58f, 0.83f, 1.28f, 0.83f, 2.12f) + curveToRelative(0f, 0.84f, -0.28f, 1.55f, -0.83f, 2.14f) + curveToRelative(-0.55f, 0.58f, -1.24f, 0.88f, -2.06f, 0.88f) + curveToRelative(-0.83f, 0f, -1.52f, -0.3f, -2.07f, -0.88f) + close() + moveToRelative(20.38f, -7.34f) + horizontalLineToRelative(-1.93f) + lineToRelative(-3.68f, 5.55f) + lineToRelative(-3.69f, -5.55f) + horizontalLineToRelative(-1.92f) + verticalLineToRelative(10.4f) + horizontalLineToRelative(2.58f) + lineToRelative(-0.02f, -5.24f) + lineToRelative(2.33f, 3.59f) + verticalLineToRelative(0.02f) + horizontalLineToRelative(1.44f) + verticalLineToRelative(-0.02f) + lineToRelative(2.3f, -3.56f) + verticalLineToRelative(5.21f) + horizontalLineToRelative(2.59f) + verticalLineTo(9.21f) + close() + moveToRelative(3.16f, 1.36f) + curveToRelative(-1.06f, 1.04f, -1.58f, 2.33f, -1.58f, 3.84f) + curveToRelative(0f, 1.52f, 0.52f, 2.8f, 1.58f, 3.86f) + curveToRelative(1.05f, 1.04f, 2.37f, 1.56f, 3.93f, 1.56f) + reflectiveCurveToRelative(2.86f, -0.52f, 3.91f, -1.56f) + curveToRelative(1.06f, -1.06f, 1.59f, -2.34f, 1.59f, -3.86f) + curveToRelative(0f, -1.51f, -0.53f, -2.8f, -1.59f, -3.84f) + curveToRelative(-1.05f, -1.05f, -2.35f, -1.57f, -3.91f, -1.57f) + reflectiveCurveToRelative(-2.88f, 0.52f, -3.93f, 1.57f) + close() + moveToRelative(1.86f, 5.98f) + curveToRelative(-0.55f, -0.59f, -0.82f, -1.3f, -0.82f, -2.14f) + curveToRelative(0f, -0.84f, 0.27f, -1.54f, 0.82f, -2.12f) + curveToRelative(0.55f, -0.6f, 1.24f, -0.89f, 2.07f, -0.89f) + curveToRelative(0.82f, 0f, 1.51f, 0.29f, 2.06f, 0.89f) + curveToRelative(0.55f, 0.58f, 0.83f, 1.28f, 0.83f, 2.12f) + curveToRelative(0f, 0.84f, -0.28f, 1.55f, -0.83f, 2.14f) + curveToRelative(-0.55f, 0.58f, -1.24f, 0.88f, -2.06f, 0.88f) + curveToRelative(-0.83f, 0f, -1.52f, -0.3f, -2.07f, -0.88f) + close() + moveToRelative(16.67f, -7.34f) + horizontalLineToRelative(-2.63f) + verticalLineToRelative(6.24f) + curveToRelative(0f, 1.29f, -0.63f, 2.04f, -1.59f, 2.04f) + curveToRelative(-0.98f, 0f, -1.63f, -0.58f, -1.7f, -1.56f) + horizontalLineToRelative(-2.56f) + curveToRelative(0.04f, 1.24f, 0.45f, 2.2f, 1.2f, 2.89f) + curveToRelative(0.75f, 0.68f, 1.75f, 1.02f, 2.99f, 1.02f) + curveToRelative(2.7f, 0f, 4.29f, -1.57f, 4.29f, -4.39f) + verticalLineTo(9.21f) + close() + moveToRelative(11.21f, 0f) + horizontalLineToRelative(-2.6f) + verticalLineToRelative(5.6f) + curveToRelative(0f, 1.59f, -0.89f, 2.62f, -2.25f, 2.62f) + curveToRelative(-1.36f, 0f, -2.23f, -1.03f, -2.23f, -2.62f) + verticalLineToRelative(-5.6f) + horizontalLineToRelative(-2.6f) + verticalLineToRelative(5.55f) + curveToRelative(0f, 1.61f, 0.41f, 2.85f, 1.29f, 3.75f) + curveToRelative(0.85f, 0.89f, 2.05f, 1.33f, 3.54f, 1.33f) + curveToRelative(1.5f, 0f, 2.68f, -0.44f, 3.55f, -1.33f) + curveToRelative(0.87f, -0.9f, 1.3f, -2.14f, 1.3f, -3.75f) + verticalLineTo(9.21f) + close() + moveTo(300.8f, 9.22f) + horizontalLineToRelative(3.04f) + lineToRelative(-4.1f, 5.18f) + horizontalLineToRelative(-3.05f) + lineToRelative(4.11f, -5.18f) + close() + } + path( + fill = SolidColor(Color(0xFF0F1C29)), + fillAlpha = 0.5f, + strokeAlpha = 0.5f, + ) { + moveTo(300.8f, 19.57f) + horizontalLineToRelative(3.04f) + lineToRelative(-4.1f, -5.17f) + horizontalLineToRelative(-3.05f) + lineToRelative(4.11f, 5.17f) + close() + moveToRelative(-4.2f, -10.35f) + horizontalLineToRelative(-2.54f) + verticalLineToRelative(10.35f) + horizontalLineToRelative(2.54f) + verticalLineTo(9.22f) + close() + } + path( + fill = SolidColor(Color(0xFF0F1C29)), + fillAlpha = 0.5f, + strokeAlpha = 0.5f, + ) { + moveTo(362.14f, 9.51f) + curveToRelative(-0.21f, 0.2f, -0.32f, 0.45f, -0.32f, 0.74f) + curveToRelative(0f, 0.3f, 0.11f, 0.55f, 0.32f, 0.74f) + curveToRelative(0.2f, 0.2f, 0.46f, 0.3f, 0.75f, 0.3f) + reflectiveCurveToRelative(0.55f, -0.1f, 0.75f, -0.3f) + curveToRelative(0.21f, -0.19f, 0.32f, -0.44f, 0.32f, -0.74f) + curveToRelative(0f, -0.29f, -0.11f, -0.54f, -0.32f, -0.74f) + curveToRelative(-0.2f, -0.2f, -0.46f, -0.3f, -0.75f, -0.3f) + reflectiveCurveToRelative(-0.55f, 0.1f, -0.75f, 0.3f) + close() + moveToRelative(0.75f, 1.52f) + curveToRelative(-0.22f, 0f, -0.4f, -0.08f, -0.56f, -0.23f) + curveToRelative(-0.15f, -0.15f, -0.23f, -0.33f, -0.23f, -0.55f) + curveToRelative(0f, -0.22f, 0.08f, -0.4f, 0.23f, -0.55f) + curveToRelative(0.16f, -0.15f, 0.34f, -0.23f, 0.56f, -0.23f) + curveToRelative(0.21f, 0f, 0.4f, 0.08f, 0.56f, 0.23f) + curveToRelative(0.15f, 0.15f, 0.23f, 0.33f, 0.23f, 0.55f) + curveToRelative(0f, 0.22f, -0.08f, 0.4f, -0.23f, 0.55f) + curveToRelative(-0.16f, 0.15f, -0.35f, 0.23f, -0.56f, 0.23f) + close() + moveToRelative(0f, -0.97f) + curveToRelative(0.09f, 0f, 0.14f, 0.04f, 0.17f, 0.11f) + horizontalLineToRelative(0.31f) + curveToRelative(-0.03f, -0.23f, -0.22f, -0.39f, -0.48f, -0.39f) + curveToRelative(-0.14f, 0f, -0.26f, 0.04f, -0.35f, 0.13f) + curveToRelative(-0.09f, 0.1f, -0.14f, 0.21f, -0.14f, 0.34f) + curveToRelative(0f, 0.14f, 0.05f, 0.25f, 0.14f, 0.34f) + curveToRelative(0.09f, 0.09f, 0.21f, 0.14f, 0.35f, 0.14f) + curveToRelative(0.13f, 0f, 0.24f, -0.04f, 0.32f, -0.11f) + curveToRelative(0.09f, -0.07f, 0.15f, -0.17f, 0.16f, -0.28f) + horizontalLineToRelative(-0.31f) + curveToRelative(-0.02f, 0.06f, -0.09f, 0.11f, -0.17f, 0.11f) + curveToRelative(-0.11f, 0f, -0.19f, -0.09f, -0.19f, -0.2f) + curveToRelative(0f, -0.1f, 0.08f, -0.19f, 0.19f, -0.19f) + close() + } + }.build() + + return _KomojuImgPaymentFooter!! + } + +@Suppress("ObjectPropertyName") +private var _KomojuImgPaymentFooter: ImageVector? = null diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/KomojuPaymentEntryPoint.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/KomojuPaymentEntryPoint.kt new file mode 100644 index 0000000..63e1aa7 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/KomojuPaymentEntryPoint.kt @@ -0,0 +1,34 @@ +package com.komoju.mobile.sdk.ui.screens + +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import cafe.adriel.voyager.navigator.Navigator +import cafe.adriel.voyager.transitions.SlideTransition +import com.komoju.mobile.sdk.KomojuMobileSDKConfiguration +import com.komoju.mobile.sdk.ui.screens.payment.KomojuPaymentScreen +import com.komoju.mobile.sdk.ui.theme.KomojuMobileSdkTheme +import com.komoju.mobile.sdk.utils.Logger + +@Composable +fun KomojuPaymentEntryPoint(configuration: KomojuMobileSDKConfiguration, onCreated: @Composable (Navigator) -> Unit) { + Logger.setDebugMode(configuration.isDebugMode) + KomojuMobileSdkTheme(configuration) { + Box( + modifier = Modifier + .fillMaxWidth() + .fillMaxHeight(MAX_HEIGHT_FRACTION), + ) { + Navigator( + KomojuPaymentScreen(configuration), + ) { navigator -> + onCreated(navigator) + SlideTransition(navigator) + } + } + } +} + +internal expect val MAX_HEIGHT_FRACTION: Float diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/KomojuPaymentRoutes.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/KomojuPaymentRoutes.kt similarity index 57% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/KomojuPaymentRoutes.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/KomojuPaymentRoutes.kt index f47b37e..d6c371c 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/KomojuPaymentRoutes.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/KomojuPaymentRoutes.kt @@ -1,39 +1,45 @@ -package com.komoju.android.sdk.ui.screens +package com.komoju.mobile.sdk.ui.screens -import androidx.activity.compose.LocalOnBackPressedDispatcherOwner import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.State import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.currentOrThrow -import com.komoju.android.sdk.KomojuSDK -import com.komoju.android.sdk.navigation.paymentResultScreenModel -import com.komoju.android.sdk.ui.screens.awating.KonbiniAwaitingPaymentScreen -import com.komoju.android.sdk.ui.screens.failed.PaymentFailedScreen -import com.komoju.android.sdk.ui.screens.failed.Reason -import com.komoju.android.sdk.ui.screens.success.PaymentSuccessScreen -import com.komoju.android.sdk.ui.screens.verify.ProcessPaymentScreen -import com.komoju.android.sdk.ui.screens.webview.WebViewScreen +import com.komoju.mobile.sdk.KomojuMobileSDKConfiguration +import com.komoju.mobile.sdk.KomojuMobileSDKPaymentResult import com.komoju.mobile.sdk.entities.Payment +import com.komoju.mobile.sdk.navigation.paymentResultScreenModel +import com.komoju.mobile.sdk.navigation.rememberPlatformBackPressDispatcher +import com.komoju.mobile.sdk.ui.screens.awating.KonbiniAwaitingPaymentScreen +import com.komoju.mobile.sdk.ui.screens.failed.PaymentFailedScreen +import com.komoju.mobile.sdk.ui.screens.failed.Reason +import com.komoju.mobile.sdk.ui.screens.success.PaymentSuccessScreen +import com.komoju.mobile.sdk.ui.screens.verify.ProcessPaymentScreen +import com.komoju.mobile.sdk.ui.screens.webview.WebViewScreen -internal sealed class Router { +sealed class Router { data object Pop : Router() data object PopAll : Router() data object PopToRoot : Router() data class Push(val route: KomojuPaymentRoute) : Router() data class Replace(val route: KomojuPaymentRoute) : Router() data class ReplaceAll(val route: KomojuPaymentRoute) : Router() - data class SetPaymentResultAndPop(val result: KomojuSDK.PaymentResult = KomojuSDK.PaymentResult(false)) : Router() + data class SetPaymentResultAndPop(val result: KomojuMobileSDKPaymentResult = KomojuMobileSDKPaymentResult(false)) : Router() } -internal sealed interface KomojuPaymentRoute { - data class KonbiniAwaitingPayment(val configuration: KomojuSDK.Configuration, val payment: Payment) : KomojuPaymentRoute +sealed interface KomojuPaymentRoute { + data class KonbiniAwaitingPayment(val configuration: KomojuMobileSDKConfiguration, val payment: Payment) : KomojuPaymentRoute - data class WebView(val url: String, val canComeBack: Boolean = false, val isJavaScriptEnabled: Boolean = false) : KomojuPaymentRoute + data class WebView( + val configuration: KomojuMobileSDKConfiguration, + val url: String, + val canComeBack: Boolean = false, + val isJavaScriptEnabled: Boolean = false, + ) : KomojuPaymentRoute data object PaymentSuccess : KomojuPaymentRoute data class PaymentFailed(val reason: Reason) : KomojuPaymentRoute - data class ProcessPayment(val configuration: KomojuSDK.Configuration, val processType: ProcessType) : KomojuPaymentRoute { + data class ProcessPayment(val configuration: KomojuMobileSDKConfiguration, val processType: ProcessType) : KomojuPaymentRoute { sealed interface ProcessType { data object Session : ProcessType data class VerifyTokenAndPay(val token: String, val amount: String, val currency: String) : ProcessType @@ -53,14 +59,14 @@ internal sealed interface KomojuPaymentRoute { } @Composable -internal fun RouterEffect(routerState: State, onHandled: () -> Unit) { +fun RouterEffect(routerState: State, onHandled: () -> Unit) { val navigator = LocalNavigator.currentOrThrow val router = routerState.value - val backPressDispatcher = LocalOnBackPressedDispatcherOwner.current?.onBackPressedDispatcher + val backPressDispatcher = rememberPlatformBackPressDispatcher() val resultScreenModel = navigator.paymentResultScreenModel() LaunchedEffect(router) { when (router) { - is Router.Pop -> if (navigator.pop().not()) backPressDispatcher?.onBackPressed() + is Router.Pop -> if (navigator.pop().not()) backPressDispatcher.onBackPressed() is Router.PopAll -> navigator.popAll() is Router.PopToRoot -> navigator.popUntilRoot() is Router.Push -> navigator.push(router.route.screen) @@ -70,7 +76,7 @@ internal fun RouterEffect(routerState: State, onHandled: () -> Unit) { null -> Unit is Router.SetPaymentResultAndPop -> { resultScreenModel.setResult(router.result) - if (navigator.pop().not()) backPressDispatcher?.onBackPressed() + if (navigator.pop().not()) backPressDispatcher.onBackPressed() } } onHandled() diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/awating/KonbiniAwaitingPaymentScreen.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/awating/KonbiniAwaitingPaymentScreen.kt similarity index 63% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/awating/KonbiniAwaitingPaymentScreen.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/awating/KonbiniAwaitingPaymentScreen.kt index 5d45a79..e099184 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/awating/KonbiniAwaitingPaymentScreen.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/awating/KonbiniAwaitingPaymentScreen.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.screens.awating +package com.komoju.mobile.sdk.ui.screens.awating import androidx.compose.foundation.Image import androidx.compose.foundation.background @@ -21,8 +21,6 @@ import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign @@ -32,19 +30,24 @@ import androidx.compose.ui.unit.sp import androidx.lifecycle.compose.collectAsStateWithLifecycle import cafe.adriel.voyager.core.model.rememberScreenModel import cafe.adriel.voyager.core.screen.Screen -import com.komoju.android.sdk.R -import com.komoju.android.sdk.types.Currency -import com.komoju.android.sdk.ui.composables.PrimaryButton -import com.komoju.android.sdk.ui.composables.TextButton -import com.komoju.android.sdk.ui.composables.ThemedCircularProgressIndicator -import com.komoju.android.sdk.ui.screens.KomojuPaymentRoute -import com.komoju.android.sdk.ui.screens.RouterEffect -import com.komoju.android.sdk.ui.theme.Gray200 -import com.komoju.android.sdk.ui.theme.Gray50 -import com.komoju.android.sdk.ui.theme.Gray700 -import com.komoju.android.sdk.utils.AmountUtils import com.komoju.mobile.sdk.entities.Payment import com.komoju.mobile.sdk.entities.PaymentStatus +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.i18n.i18nStringResource +import com.komoju.mobile.sdk.ui.composables.PrimaryButton +import com.komoju.mobile.sdk.ui.composables.TextButton +import com.komoju.mobile.sdk.ui.composables.ThemedCircularProgressIndicator +import com.komoju.mobile.sdk.ui.icon.KomojuIcon +import com.komoju.mobile.sdk.ui.icon.PaymentStatusCompleted +import com.komoju.mobile.sdk.ui.icon.PaymentStatusFailed +import com.komoju.mobile.sdk.ui.icon.PaymentStatusKonbiniPending +import com.komoju.mobile.sdk.ui.icon.PaymentStatusPending +import com.komoju.mobile.sdk.ui.screens.KomojuPaymentRoute +import com.komoju.mobile.sdk.ui.screens.RouterEffect +import com.komoju.mobile.sdk.ui.theme.Gray200 +import com.komoju.mobile.sdk.ui.theme.Gray50 +import com.komoju.mobile.sdk.ui.theme.Gray700 +import com.komoju.mobile.sdk.utils.AmountUtils internal data class KonbiniAwaitingPaymentScreen(val route: KomojuPaymentRoute.KonbiniAwaitingPayment) : Screen { @Composable @@ -53,9 +56,11 @@ internal data class KonbiniAwaitingPaymentScreen(val route: KomojuPaymentRoute.K val uiState by screenModel.state.collectAsStateWithLifecycle() RouterEffect(screenModel.router.collectAsStateWithLifecycle(), screenModel::onRouteConsumed) uiState.payment?.let { - PaymentStatus( + ProcessForPaymentStatus( payment = it, - onPrimaryButtonClicked = screenModel::onPrimaryButtonClicked, + onPrimaryButtonClicked = { + screenModel.onPrimaryButtonClicked(route.configuration) + }, onSecondaryButtonClicked = screenModel::onSecondaryButtonClicked, ) } @@ -74,10 +79,10 @@ internal data class KonbiniAwaitingPaymentScreen(val route: KomojuPaymentRoute.K } @Composable -private fun PaymentStatus(payment: Payment, onPrimaryButtonClicked: () -> Unit, onSecondaryButtonClicked: () -> Unit) { +private fun ProcessForPaymentStatus(payment: Payment, onPrimaryButtonClicked: () -> Unit, onSecondaryButtonClicked: () -> Unit) { val displayPayableAmount by remember(payment.amount) { derivedStateOf { - AmountUtils.formatToDecimal(Currency.parse(payment.currency), payment.amount) + AmountUtils.formatToDecimal(payment.currency, payment.amount) } } Column( @@ -86,7 +91,7 @@ private fun PaymentStatus(payment: Payment, onPrimaryButtonClicked: () -> Unit, .padding(horizontal = 16.dp, vertical = 32.dp), horizontalAlignment = Alignment.CenterHorizontally, ) { - Image(painterResource(payment.icon), "status_icon") + Image(payment.icon, "status_icon") Spacer(modifier = Modifier.padding(16.dp)) Text(payment.title, fontSize = 32.sp, style = TextStyle(fontWeight = FontWeight.Medium)) Spacer(modifier = Modifier.padding(8.dp)) @@ -102,7 +107,7 @@ private fun PaymentStatus(payment: Payment, onPrimaryButtonClicked: () -> Unit, .padding(vertical = 16.dp), ) { Column(modifier = Modifier.background(Gray50, RoundedCornerShape(8.dp))) { - InformationItem(title = stringResource(R.string.komoju_total_payment), displayPayableAmount) + InformationItem(title = i18nStringResource(I18nStringKey.total_payment), displayPayableAmount) payment.additionalInformation.forEach { HorizontalDivider(color = Gray200, modifier = Modifier.padding(horizontal = 16.dp)) InformationItem(it.first, it.second) @@ -137,37 +142,37 @@ private fun InformationItem(title: String, description: String) { private val Payment.icon get() = when { - status == PaymentStatus.COMPLETED -> R.drawable.komoju_ic_payment_status_completed - status == PaymentStatus.FAILED -> R.drawable.komoju_ic_payment_status_failed - this is Payment.Konbini && status == PaymentStatus.AUTHORIZED -> R.drawable.komoju_ic_payment_status_konbini_pending - else -> R.drawable.komoju_ic_payment_status_prenidng + status == PaymentStatus.COMPLETED -> KomojuIcon.PaymentStatusCompleted + status == PaymentStatus.FAILED -> KomojuIcon.PaymentStatusFailed + this is Payment.Konbini && status == PaymentStatus.AUTHORIZED -> KomojuIcon.PaymentStatusKonbiniPending + else -> KomojuIcon.PaymentStatusPending } private val Payment.title @Composable get() = when (status) { - PaymentStatus.COMPLETED -> stringResource(R.string.komoju_payment_successful) - PaymentStatus.FAILED -> stringResource(R.string.komoju_payment_failed) - else -> stringResource(R.string.komoju_awaiting_payment) + PaymentStatus.COMPLETED -> i18nStringResource(I18nStringKey.payment_successful) + PaymentStatus.FAILED -> i18nStringResource(I18nStringKey.payment_failed) + else -> i18nStringResource(I18nStringKey.awaiting_payment) } private val Payment.description @Composable get() = when { - status == PaymentStatus.COMPLETED -> stringResource(R.string.komoju_your_payment_has_been_processed_successfully) - status == PaymentStatus.FAILED -> stringResource(R.string.komoju_your_payment_has_failed) + status == PaymentStatus.COMPLETED -> i18nStringResource(I18nStringKey.your_payment_has_been_processed_successfully) + status == PaymentStatus.FAILED -> i18nStringResource(I18nStringKey.your_payment_has_failed) this is Payment.Konbini && status == PaymentStatus.AUTHORIZED -> - stringResource(R.string.komoju_awaiting_payment_instruction, this.konbiniStoreKey) - else -> stringResource(R.string.komoju_your_payment_is_awaiting_processing) + i18nStringResource(I18nStringKey.awaiting_payment_instruction, this.konbiniStoreKey) + else -> i18nStringResource(I18nStringKey.your_payment_is_awaiting_processing) } private val Payment.additionalInformation @Composable get() = when { - this is Payment.Error -> listOf(stringResource(R.string.komoju_error) to code + message) + this is Payment.Error -> listOf(i18nStringResource(I18nStringKey.error) to code + message) this is Payment.Konbini && status == PaymentStatus.AUTHORIZED -> listOfNotNull( - receiptNumber?.let { stringResource(R.string.komoju_receipt_number) to it }, - confirmationCode?.let { stringResource(R.string.komoju_confirmation_code) to it }, + receiptNumber?.let { i18nStringResource(I18nStringKey.receipt_number) to it }, + confirmationCode?.let { i18nStringResource(I18nStringKey.confirmation_code) to it }, ) else -> emptyList() @@ -176,16 +181,16 @@ private val Payment.additionalInformation private val Payment.primaryButtonText @Composable get() = when { - status == PaymentStatus.COMPLETED -> stringResource(R.string.komoju_done) - status == PaymentStatus.FAILED -> stringResource(R.string.komoju_update_payment_method) - this is Payment.Konbini && status == PaymentStatus.AUTHORIZED -> stringResource(R.string.komoju_view_instructions) - else -> stringResource(R.string.komoju_okay) + status == PaymentStatus.COMPLETED -> i18nStringResource(I18nStringKey.done) + status == PaymentStatus.FAILED -> i18nStringResource(I18nStringKey.update_payment_method) + this is Payment.Konbini && status == PaymentStatus.AUTHORIZED -> i18nStringResource(I18nStringKey.view_instructions) + else -> i18nStringResource(I18nStringKey.okay) } private val Payment.secondaryButtonText @Composable get() = when { - status == PaymentStatus.FAILED -> stringResource(R.string.komoju_have_a_question_contact_us) - this is Payment.Konbini && status == PaymentStatus.AUTHORIZED -> stringResource(R.string.komoju_i_will_do_it_later) + status == PaymentStatus.FAILED -> i18nStringResource(I18nStringKey.have_a_question_contact_us) + this is Payment.Konbini && status == PaymentStatus.AUTHORIZED -> i18nStringResource(I18nStringKey.i_will_do_it_later) else -> null } diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/awating/KonbiniAwaitingPaymentScreenModel.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/awating/KonbiniAwaitingPaymentScreenModel.kt new file mode 100644 index 0000000..12c4a70 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/awating/KonbiniAwaitingPaymentScreenModel.kt @@ -0,0 +1,26 @@ +package com.komoju.mobile.sdk.ui.screens.awating + +import com.komoju.mobile.sdk.KomojuMobileSDKConfiguration +import com.komoju.mobile.sdk.entities.Payment +import com.komoju.mobile.sdk.navigation.RouterStateScreenModel +import com.komoju.mobile.sdk.ui.screens.KomojuPaymentRoute +import com.komoju.mobile.sdk.ui.screens.Router + +internal class KonbiniAwaitingPaymentScreenModel(payment: Payment? = null) : + RouterStateScreenModel( + KonbiniAwaitingPaymentUiState(payment), + ) { + + fun onPrimaryButtonClicked(configuration: KomojuMobileSDKConfiguration) { + when (val payment = state.value.payment) { + is Payment.Konbini -> + mutableRouter.value = + Router.Push(KomojuPaymentRoute.WebView(configuration, payment.instructionURL, canComeBack = true)) + else -> Unit + } + } + + fun onSecondaryButtonClicked() { + mutableRouter.value = Router.Pop + } +} diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/awating/KonbiniAwaitingPaymentUiState.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/awating/KonbiniAwaitingPaymentUiState.kt similarity index 75% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/awating/KonbiniAwaitingPaymentUiState.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/awating/KonbiniAwaitingPaymentUiState.kt index c56f7c6..671daa5 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/awating/KonbiniAwaitingPaymentUiState.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/awating/KonbiniAwaitingPaymentUiState.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.screens.awating +package com.komoju.mobile.sdk.ui.screens.awating import com.komoju.mobile.sdk.entities.Payment diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/failed/PaymentFailedScreen.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/failed/PaymentFailedScreen.kt similarity index 71% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/failed/PaymentFailedScreen.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/failed/PaymentFailedScreen.kt index d7c2477..fa67861 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/failed/PaymentFailedScreen.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/failed/PaymentFailedScreen.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.screens.failed +package com.komoju.mobile.sdk.ui.screens.failed import androidx.compose.foundation.Image import androidx.compose.foundation.clickable @@ -15,8 +15,6 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp @@ -24,10 +22,13 @@ import androidx.compose.ui.unit.sp import androidx.lifecycle.compose.collectAsStateWithLifecycle import cafe.adriel.voyager.core.model.rememberScreenModel import cafe.adriel.voyager.core.screen.Screen -import com.komoju.android.sdk.R -import com.komoju.android.sdk.ui.composables.PrimaryButton -import com.komoju.android.sdk.ui.screens.KomojuPaymentRoute -import com.komoju.android.sdk.ui.screens.RouterEffect +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.i18n.i18nStringResource +import com.komoju.mobile.sdk.ui.composables.PrimaryButton +import com.komoju.mobile.sdk.ui.icon.KomojuIcon +import com.komoju.mobile.sdk.ui.icon.PaymentStatusFailed +import com.komoju.mobile.sdk.ui.screens.KomojuPaymentRoute +import com.komoju.mobile.sdk.ui.screens.RouterEffect internal class PaymentFailedScreen(private val route: KomojuPaymentRoute.PaymentFailed) : Screen { @Composable @@ -50,14 +51,14 @@ private fun Screen.PaymentFailedScreenContent(route: KomojuPaymentRoute.PaymentF .clickable(onClick = screenModel::onCloseButtonClicked), ) } - Image(painterResource(R.drawable.komoju_ic_payment_status_failed), "status_icon") + Image(KomojuIcon.PaymentStatusFailed, "status_icon") Spacer(Modifier.height(16.dp)) - Text(stringResource(R.string.komoju_payment_failed), fontSize = 24.sp, fontWeight = FontWeight.Bold) + Text(i18nStringResource(I18nStringKey.payment_failed), fontSize = 24.sp, fontWeight = FontWeight.Bold) Text( text = when (route.reason) { - Reason.USER_CANCEL -> stringResource(R.string.komoju_error_user_cancel) - Reason.OTHER -> stringResource(R.string.komoju_error_other) - Reason.CREDIT_CARD_ERROR -> stringResource(R.string.komoju_credit_card_error) + Reason.USER_CANCEL -> i18nStringResource(I18nStringKey.error_user_cancel) + Reason.OTHER -> i18nStringResource(I18nStringKey.error_other) + Reason.CREDIT_CARD_ERROR -> i18nStringResource(I18nStringKey.credit_card_error) }, modifier = Modifier.padding(16.dp), textAlign = TextAlign.Center, @@ -67,7 +68,7 @@ private fun Screen.PaymentFailedScreenContent(route: KomojuPaymentRoute.PaymentF modifier = Modifier .fillMaxWidth() .padding(16.dp), - text = stringResource(R.string.komoju_back_to_store), + text = i18nStringResource(I18nStringKey.back_to_store), ) { screenModel.onBackToStoreButtonClicked() } diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/failed/PaymentFailedScreenModel.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/failed/PaymentFailedScreenModel.kt similarity index 66% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/failed/PaymentFailedScreenModel.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/failed/PaymentFailedScreenModel.kt index 8f1fdcc..f212801 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/failed/PaymentFailedScreenModel.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/failed/PaymentFailedScreenModel.kt @@ -1,6 +1,6 @@ -package com.komoju.android.sdk.ui.screens.failed +package com.komoju.mobile.sdk.ui.screens.failed -import com.komoju.android.sdk.navigation.RouterStateScreenModel +import com.komoju.mobile.sdk.navigation.RouterStateScreenModel internal class PaymentFailedScreenModel : RouterStateScreenModel(Unit) { fun onCloseButtonClicked() { diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/failed/Reason.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/failed/Reason.kt similarity index 95% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/failed/Reason.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/failed/Reason.kt index cdc9fb3..0b97d7f 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/failed/Reason.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/failed/Reason.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.screens.failed +package com.komoju.mobile.sdk.ui.screens.failed /** * Enum class representing the reasons for a payment failure. diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/KomojuPaymentScreen.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/KomojuPaymentScreen.kt similarity index 85% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/payment/KomojuPaymentScreen.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/KomojuPaymentScreen.kt index 7f58185..b398475 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/KomojuPaymentScreen.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/KomojuPaymentScreen.kt @@ -1,7 +1,5 @@ -package com.komoju.android.sdk.ui.screens.payment +package com.komoju.mobile.sdk.ui.screens.payment -import android.os.Parcelable -import androidx.activity.compose.rememberLauncherForActivityResult import androidx.compose.animation.animateContentSize import androidx.compose.foundation.Image import androidx.compose.foundation.background @@ -26,35 +24,33 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.res.stringResource +import androidx.compose.ui.graphics.vector.rememberVectorPainter import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import androidx.lifecycle.compose.collectAsStateWithLifecycle import cafe.adriel.voyager.core.model.rememberScreenModel import cafe.adriel.voyager.core.screen.Screen -import com.komoju.android.sdk.KomojuSDK -import com.komoju.android.sdk.R -import com.komoju.android.sdk.ui.composables.InlinedWebView -import com.komoju.android.sdk.ui.composables.ThemedCircularProgressIndicator -import com.komoju.android.sdk.ui.screens.RouterEffect -import com.komoju.android.sdk.ui.screens.payment.composables.PaymentMethodForm -import com.komoju.android.sdk.ui.screens.payment.composables.PaymentMethodsRow -import com.komoju.android.sdk.ui.screens.payment.composables.PaymentSheetHandle -import com.komoju.android.sdk.utils.OffsiteCustomTabResultContract +import com.komoju.mobile.sdk.KomojuMobileSDKConfiguration import com.komoju.mobile.sdk.entities.PaymentMethod -import kotlinx.parcelize.Parcelize +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.i18n.i18nStringResource +import com.komoju.mobile.sdk.ui.composables.InlinedWebView +import com.komoju.mobile.sdk.ui.composables.ThemedCircularProgressIndicator +import com.komoju.mobile.sdk.ui.composables.launchCustomTab +import com.komoju.mobile.sdk.ui.icon.KomojuIcon +import com.komoju.mobile.sdk.ui.icon.KomojuImgPaymentFooter +import com.komoju.mobile.sdk.ui.screens.RouterEffect +import com.komoju.mobile.sdk.ui.screens.payment.composables.PaymentMethodForm +import com.komoju.mobile.sdk.ui.screens.payment.composables.PaymentMethodsRow +import com.komoju.mobile.sdk.ui.screens.payment.composables.PaymentSheetHandle -@Parcelize -internal data class KomojuPaymentScreen(private val sdkConfiguration: KomojuSDK.Configuration) : - Screen, - Parcelable { +internal data class KomojuPaymentScreen(private val sdkConfiguration: KomojuMobileSDKConfiguration) : Screen { @Composable override fun Content() { val screenViewModel = rememberScreenModel { KomojuPaymentScreenModel(sdkConfiguration) } val uiState by screenViewModel.state.collectAsStateWithLifecycle() val offSitePaymentURL by screenViewModel.offSitePaymentURL.collectAsStateWithLifecycle() - val offsitePaymentLauncher = rememberLauncherForActivityResult(OffsiteCustomTabResultContract()) { + val offsitePaymentLauncher = launchCustomTab { screenViewModel.onOffsitePaymentResult() } LaunchedEffect(sdkConfiguration.sessionId) { @@ -74,7 +70,7 @@ internal data class KomojuPaymentScreen(private val sdkConfiguration: KomojuSDK. if (uiState.session != null) { Column { PaymentSheetHandle( - stringResource(R.string.komoju_payment_options), + i18nStringResource(I18nStringKey.payment_options), onCloseClicked = { screenViewModel.onCloseClicked() }, @@ -109,7 +105,7 @@ internal data class KomojuPaymentScreen(private val sdkConfiguration: KomojuSDK. } Image( modifier = Modifier.fillMaxWidth().height(54.dp).padding(horizontal = 16.dp), - painter = painterResource(R.drawable.komoju_img_payment_footer), + painter = rememberVectorPainter(KomojuIcon.KomojuImgPaymentFooter), contentDescription = "payment footer", ) } @@ -146,6 +142,7 @@ internal data class KomojuPaymentScreen(private val sdkConfiguration: KomojuSDK. }, ), url = inlineWebViewURL, + appScheme = sdkConfiguration.appScheme, onDone = { screenViewModel.onInlinedDeeplinkCaptured(it) }, diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/KomojuPaymentScreenModel.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/KomojuPaymentScreenModel.kt similarity index 71% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/payment/KomojuPaymentScreenModel.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/KomojuPaymentScreenModel.kt index cc84d37..6529a51 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/KomojuPaymentScreenModel.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/KomojuPaymentScreenModel.kt @@ -1,22 +1,8 @@ -package com.komoju.android.sdk.ui.screens.payment +package com.komoju.mobile.sdk.ui.screens.payment -import androidx.core.text.isDigitsOnly import cafe.adriel.voyager.core.model.screenModelScope -import com.komoju.android.sdk.KomojuSDK -import com.komoju.android.sdk.R -import com.komoju.android.sdk.navigation.RouterStateScreenModel -import com.komoju.android.sdk.ui.composables.InlinedPaymentPrimaryButtonState -import com.komoju.android.sdk.ui.screens.KomojuPaymentRoute -import com.komoju.android.sdk.ui.screens.Router -import com.komoju.android.sdk.ui.screens.failed.Reason -import com.komoju.android.sdk.utils.CreditCardUtils.isValidCVV -import com.komoju.android.sdk.utils.CreditCardUtils.isValidCardHolderNameChar -import com.komoju.android.sdk.utils.CreditCardUtils.isValidCardNumber -import com.komoju.android.sdk.utils.CreditCardUtils.isValidExpiryDate -import com.komoju.android.sdk.utils.DeeplinkEntity -import com.komoju.android.sdk.utils.isKatakanaOnly -import com.komoju.android.sdk.utils.isValidEmail -import com.komoju.android.sdk.utils.verifyTokenAndProcessPayment +import com.komoju.mobile.sdk.KomojuMobileSDKConfiguration +import com.komoju.mobile.sdk.KomojuMobileSDKPaymentResult import com.komoju.mobile.sdk.entities.Payment import com.komoju.mobile.sdk.entities.PaymentMethod import com.komoju.mobile.sdk.entities.PaymentRequest @@ -28,7 +14,25 @@ import com.komoju.mobile.sdk.entities.SecureTokenResponse.Status.NEEDS_VERIFY import com.komoju.mobile.sdk.entities.SecureTokenResponse.Status.OK import com.komoju.mobile.sdk.entities.SecureTokenResponse.Status.SKIPPED import com.komoju.mobile.sdk.entities.SecureTokenResponse.Status.UNKNOWN +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.navigation.RouterStateScreenModel import com.komoju.mobile.sdk.remote.apis.KomojuRemoteApi +import com.komoju.mobile.sdk.ui.composables.InlinedPaymentPrimaryButtonState +import com.komoju.mobile.sdk.ui.screens.KomojuPaymentRoute +import com.komoju.mobile.sdk.ui.screens.Router +import com.komoju.mobile.sdk.ui.screens.failed.Reason +import com.komoju.mobile.sdk.utils.CreditCardUtils.isValidCVV +import com.komoju.mobile.sdk.utils.CreditCardUtils.isValidCardHolderNameChar +import com.komoju.mobile.sdk.utils.CreditCardUtils.isValidCardNumber +import com.komoju.mobile.sdk.utils.CreditCardUtils.isValidExpiryDate +import com.komoju.mobile.sdk.utils.DeeplinkEntity +import com.komoju.mobile.sdk.utils.Logger +import com.komoju.mobile.sdk.utils.Platform +import com.komoju.mobile.sdk.utils.currentPlatform +import com.komoju.mobile.sdk.utils.isDigitsOnly +import com.komoju.mobile.sdk.utils.isKanaOnly +import com.komoju.mobile.sdk.utils.isValidEmail +import com.komoju.mobile.sdk.utils.verifyTokenAndProcessPayment import kotlin.time.Duration.Companion.milliseconds import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableStateFlow @@ -36,9 +40,9 @@ import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch -internal class KomojuPaymentScreenModel(private val config: KomojuSDK.Configuration) : +internal class KomojuPaymentScreenModel(private val config: KomojuMobileSDKConfiguration) : RouterStateScreenModel(KomojuPaymentUIState()) { - private val komojuApi: KomojuRemoteApi = KomojuRemoteApi.create(config.publishableKey) + private val komojuApi: KomojuRemoteApi = KomojuRemoteApi.create(config) private val _offSitePaymentURL = MutableStateFlow(null) val offSitePaymentURL = _offSitePaymentURL.asStateFlow() @@ -78,8 +82,8 @@ internal class KomojuPaymentScreenModel(private val config: KomojuSDK.Configurat mutableState.update { it.copy( creditCardDisplayData = creditCardDisplayData.copy( - creditCardErrorStringResource = null, - fullNameOnCardErrorStringResource = null, + creditCardErrorI18nStringKey = null, + fullNameOnCardErrorI18nStringKey = null, ), ) } @@ -160,13 +164,17 @@ internal class KomojuPaymentScreenModel(private val config: KomojuSDK.Configurat mutableState.update { it.copy(inlinedCreditCardProcessingURL = tokens.authURL) } } else { mutableRouter.value = - Router.ReplaceAll(KomojuPaymentRoute.WebView(url = tokens.authURL, isJavaScriptEnabled = true)) + Router.ReplaceAll(KomojuPaymentRoute.WebView(config, url = tokens.authURL, isJavaScriptEnabled = true)) } } - ERRORED, UNKNOWN -> mutableRouter.value = Router.ReplaceAll(KomojuPaymentRoute.PaymentFailed(Reason.CREDIT_CARD_ERROR)) + ERRORED, UNKNOWN -> { + Logger.d("Error creating secure tokens status ${tokens.status}") + mutableRouter.value = Router.ReplaceAll(KomojuPaymentRoute.PaymentFailed(Reason.CREDIT_CARD_ERROR)) + } } }.onFailure { + Logger.e(it) mutableRouter.value = Router.ReplaceAll(KomojuPaymentRoute.PaymentFailed(Reason.CREDIT_CARD_ERROR)) } } @@ -196,8 +204,8 @@ internal class KomojuPaymentScreenModel(private val config: KomojuSDK.Configurat }, onSuccess = { changeInlinePaymentState(InlinedPaymentPrimaryButtonState.SUCCESS) - delay(400.milliseconds) - mutableRouter.value = Router.SetPaymentResultAndPop(KomojuSDK.PaymentResult(isSuccessFul = it.isSuccessful())) + delay(400.milliseconds) // Wait till Check icon is at-least visible to the User + mutableRouter.value = Router.SetPaymentResultAndPop(KomojuMobileSDKPaymentResult(isSuccessFul = it.isSuccessful())) }, ) } @@ -214,12 +222,23 @@ internal class KomojuPaymentScreenModel(private val config: KomojuSDK.Configurat private fun Payment.handle() { when (this) { is Payment.Konbini -> mutableRouter.value = Router.Replace(KomojuPaymentRoute.KonbiniAwaitingPayment(config, payment = this)) - is Payment.OffSitePayment -> _offSitePaymentURL.value = redirectURL + is Payment.OffSitePayment -> when (currentPlatform) { + // we will use WebView in IOS first. + Platform.IOS -> + mutableRouter.value = + Router.Replace( + KomojuPaymentRoute.WebView(config, url = redirectURL, isJavaScriptEnabled = true, canComeBack = false), + ) + + else -> _offSitePaymentURL.value = redirectURL + } + is Payment.Completed -> mutableRouter.value = - Router.SetPaymentResultAndPop(KomojuSDK.PaymentResult(isSuccessFul = status == PaymentStatus.CAPTURED)) - is Payment.BankTransfer -> mutableRouter.value = Router.ReplaceAll(KomojuPaymentRoute.WebView(url = instructionURL)) - is Payment.PayEasy -> mutableRouter.value = Router.ReplaceAll(KomojuPaymentRoute.WebView(url = instructionURL)) + Router.SetPaymentResultAndPop(KomojuMobileSDKPaymentResult(isSuccessFul = status == PaymentStatus.CAPTURED)) + + is Payment.BankTransfer -> mutableRouter.value = Router.ReplaceAll(KomojuPaymentRoute.WebView(config, url = instructionURL)) + is Payment.PayEasy -> mutableRouter.value = Router.ReplaceAll(KomojuPaymentRoute.WebView(config, url = instructionURL)) else -> Unit } } @@ -240,34 +259,34 @@ internal class KomojuPaymentScreenModel(private val config: KomojuSDK.Configurat } private fun CommonDisplayData.validate(): Boolean { - val lastNameError = if (lastName.isBlank()) R.string.komoju_the_entered_last_name_cannot_be_empty else null - val firstNameError = if (firstName.isBlank()) R.string.komoju_the_entered_first_name_cannot_be_empty else null + val lastNameError = if (lastName.isBlank()) I18nStringKey.the_entered_last_name_cannot_be_empty else null + val firstNameError = if (firstName.isBlank()) I18nStringKey.the_entered_first_name_cannot_be_empty else null val firstNamePhoneticError = when { - firstNamePhonetic.isBlank() -> R.string.komoju_the_entered_first_name_phonetic_cannot_be_empty - firstNamePhonetic.isKatakanaOnly.not() -> R.string.komoju_the_entered_first_name_phonetic_must_be_a_kana + firstNamePhonetic.isBlank() -> I18nStringKey.the_entered_first_name_phonetic_cannot_be_empty + firstNamePhonetic.isKanaOnly.not() -> I18nStringKey.the_entered_first_name_phonetic_must_be_a_kana else -> null } val lastNamePhoneticError = when { - lastNamePhonetic.isBlank() -> R.string.komoju_the_entered_last_name_phonetic_cannot_be_empty - lastNamePhonetic.isKatakanaOnly.not() -> R.string.komoju_the_entered_last_name_phonetic_must_be_a_kana + lastNamePhonetic.isBlank() -> I18nStringKey.the_entered_last_name_phonetic_cannot_be_empty + lastNamePhonetic.isKanaOnly.not() -> I18nStringKey.the_entered_last_name_phonetic_must_be_a_kana else -> null } - val emailError = if (email.isValidEmail.not()) R.string.komoju_the_entered_email_is_not_valid else null + val emailError = if (email.isValidEmail.not()) I18nStringKey.the_entered_email_is_not_valid else null val phoneNumberError = when { - phoneNumber.isBlank() -> R.string.komoju_the_entered_phone_number_cannot_be_empty - phoneNumber.length < 7 -> R.string.komoju_the_entered_phone_number_is_not_valid - phoneNumber.isDigitsOnly().not() -> R.string.komoju_the_entered_phone_number_is_not_valid + phoneNumber.isBlank() -> I18nStringKey.the_entered_phone_number_cannot_be_empty + phoneNumber.length < 7 -> I18nStringKey.the_entered_phone_number_is_not_valid + phoneNumber.isDigitsOnly.not() -> I18nStringKey.the_entered_phone_number_is_not_valid else -> null } mutableState.update { it.copy( commonDisplayData = it.commonDisplayData.copy( - lastNameErrorStringResource = lastNameError, - firstNameErrorStringResource = firstNameError, - firstNamePhoneticErrorStringResource = firstNamePhoneticError, - lastNamePhoneticErrorStringResource = lastNamePhoneticError, - emailErrorStringResource = emailError, - phoneNumberErrorStringResource = phoneNumberError, + lastNameErrorI18nStringKey = lastNameError, + firstNameErrorI18nStringKey = firstNameError, + firstNamePhoneticErrorI18nStringKey = firstNamePhoneticError, + lastNamePhoneticErrorI18nStringKey = lastNamePhoneticError, + emailErrorI18nStringKey = emailError, + phoneNumberErrorI18nStringKey = phoneNumberError, ), ) } @@ -281,14 +300,14 @@ internal class KomojuPaymentScreenModel(private val config: KomojuSDK.Configurat private fun WebMoneyDisplayData.validate(): Boolean { val prepaidNumberError = when { - prepaidNumber.isBlank() -> R.string.komoju_the_entered_prepaid_number_cannot_be_empty - prepaidNumber.length != 16 -> R.string.komoju_the_entered_prepaid_number_is_not_valid + prepaidNumber.isBlank() -> I18nStringKey.the_entered_prepaid_number_cannot_be_empty + prepaidNumber.length != 16 -> I18nStringKey.the_entered_prepaid_number_is_not_valid else -> null } mutableState.update { it.copy( webMoneyDisplayData = it.webMoneyDisplayData.copy( - prepaidNumberErrorStringResource = prepaidNumberError, + prepaidNumberErrorI18nStringKey = prepaidNumberError, ), ) } @@ -297,14 +316,14 @@ internal class KomojuPaymentScreenModel(private val config: KomojuSDK.Configurat private fun BitCashDisplayData.validate(): Boolean { val idError = when { - bitCashId.isBlank() -> R.string.komoju_the_entered_bit_cash_id_cannot_be_empty - bitCashId.length != 16 -> R.string.komoju_the_entered_bit_cash_id_is_not_valid + bitCashId.isBlank() -> I18nStringKey.the_entered_bit_cash_id_cannot_be_empty + bitCashId.length != 16 -> I18nStringKey.the_entered_bit_cash_id_is_not_valid else -> null } mutableState.update { it.copy( bitCashDisplayData = it.bitCashDisplayData.copy( - bitCashErrorStringResource = idError, + bitCashErrorI18nStringKey = idError, ), ) } @@ -313,14 +332,14 @@ internal class KomojuPaymentScreenModel(private val config: KomojuSDK.Configurat private fun NetCashDisplayData.validate(): Boolean { val idError = when { - netCashId.isBlank() -> R.string.komoju_the_entered_net_cash_id_cannot_be_empty - netCashId.length !in 16..20 -> R.string.komoju_the_entered_net_cash_id_is_not_valid + netCashId.isBlank() -> I18nStringKey.the_entered_net_cash_id_cannot_be_empty + netCashId.length !in 16..20 -> I18nStringKey.the_entered_net_cash_id_is_not_valid else -> null } mutableState.update { it.copy( netCashDisplayData = it.netCashDisplayData.copy( - netCashErrorStringResource = idError, + netCashErrorI18nStringKey = idError, ), ) } @@ -329,20 +348,20 @@ internal class KomojuPaymentScreenModel(private val config: KomojuSDK.Configurat private fun PaidyDisplayData.validate(): Boolean { val fullNameError = when { - fullName.isBlank() -> R.string.komoju_the_entered_name_cannot_be_empty + fullName.isBlank() -> I18nStringKey.the_entered_name_cannot_be_empty else -> null } val phoneNumberError = when { - phoneNumber.isBlank() -> R.string.komoju_the_entered_phone_number_cannot_be_empty - phoneNumber.length < 7 -> R.string.komoju_the_entered_phone_number_is_not_valid - phoneNumber.isDigitsOnly().not() -> R.string.komoju_the_entered_phone_number_is_not_valid + phoneNumber.isBlank() -> I18nStringKey.the_entered_phone_number_cannot_be_empty + phoneNumber.length < 7 -> I18nStringKey.the_entered_phone_number_is_not_valid + phoneNumber.isDigitsOnly.not() -> I18nStringKey.the_entered_phone_number_is_not_valid else -> null } mutableState.update { it.copy( paidyDisplayData = it.paidyDisplayData.copy( - fullNameErrorStringResource = fullNameError, - phoneNumberErrorStringResource = phoneNumberError, + fullNameErrorI18nStringKey = fullNameError, + phoneNumberErrorI18nStringKey = phoneNumberError, ), ) } @@ -351,23 +370,23 @@ internal class KomojuPaymentScreenModel(private val config: KomojuSDK.Configurat private fun CreditCardDisplayData.validate(): Boolean { val fullNameOnCardError = when { - fullNameOnCard.isBlank() -> R.string.komoju_cadrholder_name_cannot_be_empty + fullNameOnCard.isBlank() -> I18nStringKey.cardholder_name_cannot_be_empty fullNameOnCard.all { char -> char.isValidCardHolderNameChar() } -> null - else -> R.string.komoju_the_entered_cardholder_name_is_not_valid + else -> I18nStringKey.the_entered_cardholder_name_is_not_valid } val creditCardError = run { when { - creditCardNumber.isValidCardNumber().not() -> R.string.komoju_the_entered_card_number_is_not_valid - creditCardExpiryDate.isValidExpiryDate().not() -> R.string.komoju_the_entered_expiry_date_is_not_valid - creditCardCvv.isValidCVV().not() -> R.string.komoju_the_entered_cvv_is_not_valid + creditCardNumber.isValidCardNumber().not() -> I18nStringKey.the_entered_card_number_is_not_valid + creditCardExpiryDate.isValidExpiryDate().not() -> I18nStringKey.the_entered_expiry_date_is_not_valid + creditCardCvv.isValidCVV().not() -> I18nStringKey.the_entered_cvv_is_not_valid else -> null } } mutableState.update { it.copy( creditCardDisplayData = it.creditCardDisplayData.copy( - fullNameOnCardErrorStringResource = fullNameOnCardError, - creditCardErrorStringResource = creditCardError, + fullNameOnCardErrorI18nStringKey = fullNameOnCardError, + creditCardErrorI18nStringKey = creditCardError, ), ) } @@ -375,15 +394,15 @@ internal class KomojuPaymentScreenModel(private val config: KomojuSDK.Configurat } private fun KonbiniDisplayData.validate(commonDisplayData: CommonDisplayData): Boolean { - val nameError = if (receiptName.trim().isEmpty()) R.string.komoju_the_entered_name_cannot_be_empty else null - val emailError = if (commonDisplayData.email.isValidEmail.not()) R.string.komoju_the_entered_email_is_not_valid else null - val konbiniBrandNullError = if (selectedKonbiniBrand == null) R.string.komoju_please_select_a_konbini_brand else null + val nameError = if (receiptName.trim().isEmpty()) I18nStringKey.the_entered_name_cannot_be_empty else null + val emailError = if (commonDisplayData.email.isValidEmail.not()) I18nStringKey.the_entered_email_is_not_valid else null + val konbiniBrandNullError = if (selectedKonbiniBrand == null) I18nStringKey.please_select_a_konbini_brand else null mutableState.update { it.copy( konbiniDisplayData = it.konbiniDisplayData.copy( - receiptNameErrorStringResource = nameError, - receiptEmailErrorStringResource = emailError, - konbiniBrandNullErrorStringResource = konbiniBrandNullError, + receiptNameErrorI18nStringKey = nameError, + receiptEmailErrorI18nStringKey = emailError, + konbiniBrandNullErrorI18nStringKey = konbiniBrandNullError, ), ) } @@ -443,6 +462,7 @@ internal class KomojuPaymentScreenModel(private val config: KomojuSDK.Configurat email = state.value.commonDisplayData.email, phoneNumber = state.value.commonDisplayData.phoneNumber, ) + is PaymentMethod.WebMoney -> PaymentRequest.WebMoney( paymentMethod = this, prepaidNumber = state.value.webMoneyDisplayData.prepaidNumber, diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/KomojuPaymentUIState.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/KomojuPaymentUIState.kt similarity index 60% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/payment/KomojuPaymentUIState.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/KomojuPaymentUIState.kt index 89f8f2b..26679f6 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/KomojuPaymentUIState.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/KomojuPaymentUIState.kt @@ -1,9 +1,10 @@ -package com.komoju.android.sdk.ui.screens.payment +package com.komoju.mobile.sdk.ui.screens.payment -import com.komoju.android.sdk.ui.composables.InlinedPaymentPrimaryButtonState -import com.komoju.android.sdk.utils.empty import com.komoju.mobile.sdk.entities.PaymentMethod import com.komoju.mobile.sdk.entities.Session +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.ui.composables.InlinedPaymentPrimaryButtonState +import com.komoju.mobile.sdk.utils.empty internal data class KomojuPaymentUIState( val isLoading: Boolean = true, @@ -28,22 +29,22 @@ internal data class CommonDisplayData( val firstNamePhonetic: String = String.empty, val email: String = String.empty, val phoneNumber: String = String.empty, - val fullNameErrorStringResource: Int? = null, - val lastNameErrorStringResource: Int? = null, - val firstNameErrorStringResource: Int? = null, - val lastNamePhoneticErrorStringResource: Int? = null, - val firstNamePhoneticErrorStringResource: Int? = null, - val emailErrorStringResource: Int? = null, - val phoneNumberErrorStringResource: Int? = null, + val fullNameErrorI18nStringKey: I18nStringKey? = null, + val lastNameErrorI18nStringKey: I18nStringKey? = null, + val firstNameErrorI18nStringKey: I18nStringKey? = null, + val lastNamePhoneticErrorI18nStringKey: I18nStringKey? = null, + val firstNamePhoneticErrorI18nStringKey: I18nStringKey? = null, + val emailErrorI18nStringKey: I18nStringKey? = null, + val phoneNumberErrorI18nStringKey: I18nStringKey? = null, ) internal data class CreditCardDisplayData( val fullNameOnCard: String = String.empty, - val fullNameOnCardErrorStringResource: Int? = null, + val fullNameOnCardErrorI18nStringKey: I18nStringKey? = null, val creditCardNumber: String = String.empty, val creditCardExpiryDate: String = String.empty, val creditCardCvv: String = String.empty, - val creditCardErrorStringResource: Int? = null, + val creditCardErrorI18nStringKey: I18nStringKey? = null, val canSaveCard: Boolean = false, val saveCard: Boolean = false, val inlinePaymentEnabled: Boolean = false, @@ -52,21 +53,24 @@ internal data class CreditCardDisplayData( internal data class KonbiniDisplayData( val receiptName: String = String.empty, - val receiptNameErrorStringResource: Int? = null, - val receiptEmailErrorStringResource: Int? = null, + val receiptNameErrorI18nStringKey: I18nStringKey? = null, + val receiptEmailErrorI18nStringKey: I18nStringKey? = null, val selectedKonbiniBrand: PaymentMethod.Konbini.KonbiniBrand? = null, - val konbiniBrandNullErrorStringResource: Int? = null, + val konbiniBrandNullErrorI18nStringKey: I18nStringKey? = null, ) -internal data class BitCashDisplayData(val bitCashId: String = String.empty, val bitCashErrorStringResource: Int? = null) +internal data class BitCashDisplayData(val bitCashId: String = String.empty, val bitCashErrorI18nStringKey: I18nStringKey? = null) -internal data class NetCashDisplayData(val netCashId: String = String.empty, val netCashErrorStringResource: Int? = null) +internal data class NetCashDisplayData(val netCashId: String = String.empty, val netCashErrorI18nStringKey: I18nStringKey? = null) -internal data class WebMoneyDisplayData(val prepaidNumber: String = String.empty, val prepaidNumberErrorStringResource: Int? = null) +internal data class WebMoneyDisplayData( + val prepaidNumber: String = String.empty, + val prepaidNumberErrorI18nStringKey: I18nStringKey? = null, +) internal data class PaidyDisplayData( val fullName: String = String.empty, - val fullNameErrorStringResource: Int? = null, + val fullNameErrorI18nStringKey: I18nStringKey? = null, val phoneNumber: String = String.empty, - val phoneNumberErrorStringResource: Int? = null, + val phoneNumberErrorI18nStringKey: I18nStringKey? = null, ) diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/BankForm.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/BankForm.kt similarity index 69% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/BankForm.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/BankForm.kt index 6f2d165..d591fdd 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/BankForm.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/BankForm.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.screens.payment.composables +package com.komoju.mobile.sdk.ui.screens.payment.composables import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer @@ -12,19 +12,18 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier -import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.intl.Locale -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import com.komoju.android.sdk.R -import com.komoju.android.sdk.types.Currency -import com.komoju.android.sdk.ui.composables.PrimaryButton -import com.komoju.android.sdk.ui.screens.payment.CommonDisplayData -import com.komoju.android.sdk.ui.theme.KomojuMobileSdkTheme -import com.komoju.android.sdk.utils.AmountUtils import com.komoju.mobile.sdk.entities.PaymentMethod +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.i18n.i18nStringResource +import com.komoju.mobile.sdk.ui.composables.PrimaryButton +import com.komoju.mobile.sdk.ui.screens.payment.CommonDisplayData +import com.komoju.mobile.sdk.ui.theme.KomojuMobileSdkTheme +import com.komoju.mobile.sdk.utils.AmountUtils +import org.jetbrains.compose.ui.tooling.preview.Preview internal val JAPANESE_LOCALE = Locale("ja") @@ -37,7 +36,7 @@ internal fun BankForm( ) { val displayPayableAmount by remember(bankTransfer.amount) { derivedStateOf { - AmountUtils.formatToDecimal(Currency.parse(bankTransfer.currency), bankTransfer.amount) + AmountUtils.formatToDecimal(bankTransfer.currency, bankTransfer.amount) } } Column { @@ -46,38 +45,38 @@ internal fun BankForm( .fillMaxWidth() .padding(horizontal = 16.dp), value = commonDisplayData.lastName, - title = stringResource(R.string.komoju_last_name), - placeholder = stringResource(R.string.komoju_last_name), + title = i18nStringResource(I18nStringKey.last_name), + placeholder = i18nStringResource(I18nStringKey.last_name), onValueChange = { onCommonDisplayDataChange(commonDisplayData.copy(lastName = it)) }, keyboardType = KeyboardType.Text, imeActions = ImeAction.Next, singleLine = true, - error = commonDisplayData.lastNameErrorStringResource?.let { stringResource(it) }, + error = commonDisplayData.lastNameErrorI18nStringKey, ) CompatTextField( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), value = commonDisplayData.firstName, - title = stringResource(R.string.komoju_first_name), - placeholder = stringResource(R.string.komoju_first_name), + title = i18nStringResource(I18nStringKey.first_name), + placeholder = i18nStringResource(I18nStringKey.first_name), onValueChange = { onCommonDisplayDataChange(commonDisplayData.copy(firstName = it)) }, keyboardType = KeyboardType.Text, imeActions = ImeAction.Next, singleLine = true, - error = commonDisplayData.firstNameErrorStringResource?.let { stringResource(it) }, + error = commonDisplayData.firstNameErrorI18nStringKey, ) CompatTextField( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), value = commonDisplayData.lastNamePhonetic, - title = stringResource(R.string.komoju_last_name_phonetic), - placeholder = stringResource(R.string.komoju_last_name_phonetic), + title = i18nStringResource(I18nStringKey.last_name_phonetic), + placeholder = i18nStringResource(I18nStringKey.last_name_phonetic), onValueChange = { onCommonDisplayDataChange(commonDisplayData.copy(lastNamePhonetic = it)) }, @@ -85,15 +84,15 @@ internal fun BankForm( keyBoardLocale = JAPANESE_LOCALE, imeActions = ImeAction.Next, singleLine = true, - error = commonDisplayData.lastNamePhoneticErrorStringResource?.let { stringResource(it) }, + error = commonDisplayData.lastNamePhoneticErrorI18nStringKey, ) CompatTextField( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), value = commonDisplayData.firstNamePhonetic, - title = stringResource(R.string.komoju_first_name_phonetic), - placeholder = stringResource(R.string.komoju_first_name_phonetic), + title = i18nStringResource(I18nStringKey.first_name_phonetic), + placeholder = i18nStringResource(I18nStringKey.first_name_phonetic), onValueChange = { onCommonDisplayDataChange(commonDisplayData.copy(firstNamePhonetic = it)) }, @@ -101,51 +100,51 @@ internal fun BankForm( keyBoardLocale = JAPANESE_LOCALE, imeActions = ImeAction.Next, singleLine = true, - error = commonDisplayData.firstNamePhoneticErrorStringResource?.let { stringResource(it) }, + error = commonDisplayData.firstNamePhoneticErrorI18nStringKey, ) CompatTextField( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), value = commonDisplayData.email, - title = stringResource(R.string.komoju_email), - placeholder = stringResource(R.string.komoju_enter_your_email_address), + title = i18nStringResource(I18nStringKey.email), + placeholder = i18nStringResource(I18nStringKey.enter_your_email_address), onValueChange = { onCommonDisplayDataChange(commonDisplayData.copy(email = it)) }, keyboardType = KeyboardType.Email, imeActions = ImeAction.Next, singleLine = true, - error = commonDisplayData.emailErrorStringResource?.let { stringResource(it) }, + error = commonDisplayData.emailErrorI18nStringKey, ) CompatTextField( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), value = commonDisplayData.phoneNumber, - title = stringResource(R.string.komoju_phone_number), - placeholder = stringResource(R.string.komoju_enter_your_phone_number), + title = i18nStringResource(I18nStringKey.phone_number), + placeholder = i18nStringResource(I18nStringKey.enter_your_phone_number), onValueChange = { onCommonDisplayDataChange(commonDisplayData.copy(phoneNumber = it)) }, keyboardType = KeyboardType.Number, imeActions = ImeAction.Done, singleLine = true, - error = commonDisplayData.phoneNumberErrorStringResource?.let { stringResource(it) }, + error = commonDisplayData.phoneNumberErrorI18nStringKey, ) Spacer(modifier = Modifier.height(16.dp)) PrimaryButton( modifier = Modifier .padding(16.dp) .fillMaxWidth(), - text = stringResource(R.string.komoju_pay, displayPayableAmount), + text = i18nStringResource(I18nStringKey.pay, displayPayableAmount), onClick = onPayButtonClicked, ) } } @Composable -@Preview(showBackground = true) +@Preview private fun BankFormPreview() { val bankTransfer = PaymentMethod.BankTransfer( hashedGateway = "hashedGateway", diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/BitCashForm.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/BitCashForm.kt similarity index 63% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/BitCashForm.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/BitCashForm.kt index a3f66b3..578be78 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/BitCashForm.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/BitCashForm.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.screens.payment.composables +package com.komoju.mobile.sdk.ui.screens.payment.composables import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer @@ -10,14 +10,13 @@ import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue import androidx.compose.runtime.remember import androidx.compose.ui.Modifier -import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp -import com.komoju.android.sdk.R -import com.komoju.android.sdk.types.Currency -import com.komoju.android.sdk.ui.composables.PrimaryButton -import com.komoju.android.sdk.ui.screens.payment.BitCashDisplayData -import com.komoju.android.sdk.utils.AmountUtils import com.komoju.mobile.sdk.entities.PaymentMethod +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.i18n.i18nStringResource +import com.komoju.mobile.sdk.ui.composables.PrimaryButton +import com.komoju.mobile.sdk.ui.screens.payment.BitCashDisplayData +import com.komoju.mobile.sdk.utils.AmountUtils @Composable internal fun BitCashForm( @@ -28,25 +27,25 @@ internal fun BitCashForm( ) { val displayPayableAmount by remember(bitCash.amount) { derivedStateOf { - AmountUtils.formatToDecimal(Currency.parse(bitCash.currency), bitCash.amount) + AmountUtils.formatToDecimal(bitCash.currency, bitCash.amount) } } Column { TextField( value = bitCashDisplayData.bitCashId, - title = stringResource(R.string.komoju_bitcash_information), - placeholder = stringResource(R.string.komoju_hiragana_id), + title = i18nStringResource(I18nStringKey.bit_cash_information), + placeholder = i18nStringResource(I18nStringKey.hiragana_id), onValueChange = { onBitCashDisplayDataChange(bitCashDisplayData.copy(bitCashId = it)) }, - error = bitCashDisplayData.bitCashErrorStringResource?.let { stringResource(it) }, + error = bitCashDisplayData.bitCashErrorI18nStringKey?.let { i18nStringResource(it) }, ) Spacer(modifier = Modifier.height(16.dp)) PrimaryButton( modifier = Modifier .padding(16.dp) .fillMaxWidth(), - text = stringResource(R.string.komoju_pay, displayPayableAmount), + text = i18nStringResource(I18nStringKey.pay, displayPayableAmount), onClick = onPayButtonClicked, ) } diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/CompatTextField.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/CompatTextField.kt new file mode 100644 index 0000000..1c4ec10 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/CompatTextField.kt @@ -0,0 +1,69 @@ +package com.komoju.mobile.sdk.ui.screens.payment.composables + +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.text.KeyboardOptions +import androidx.compose.material3.OutlinedTextField +import androidx.compose.material3.OutlinedTextFieldDefaults +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.text.input.ImeAction +import androidx.compose.ui.text.input.KeyboardCapitalization +import androidx.compose.ui.text.input.KeyboardType +import androidx.compose.ui.text.intl.Locale +import androidx.compose.ui.text.intl.LocaleList +import androidx.compose.ui.unit.dp +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.i18n.i18nStringResource +import com.komoju.mobile.sdk.ui.theme.Gray200 +import com.komoju.mobile.sdk.ui.theme.LocalConfigurableTheme +import com.komoju.mobile.sdk.ui.theme.Red600 +import com.komoju.mobile.sdk.ui.theme.toColor + +@Composable +internal fun CompatTextField( + modifier: Modifier = Modifier, + value: String, + title: String, + placeholder: String, + onValueChange: (String) -> Unit, + error: I18nStringKey? = null, + keyboardType: KeyboardType = KeyboardType.Unspecified, + capitalization: KeyboardCapitalization = KeyboardCapitalization.Unspecified, + keyBoardLocale: Locale = Locale.current, + imeActions: ImeAction = ImeAction.Unspecified, + singleLine: Boolean = false, +) { + val configurableTheme = LocalConfigurableTheme.current + OutlinedTextField( + modifier = modifier, + value = value, + onValueChange = onValueChange, + shape = RoundedCornerShape(8.dp), + label = { + Text(text = title) + }, + placeholder = { + Text(text = placeholder) + }, + isError = error != null, + singleLine = singleLine, + supportingText = { + if (error != null) { + Text(text = i18nStringResource(error), color = Red600) + } + }, + keyboardOptions = KeyboardOptions( + keyboardType = keyboardType, + capitalization = capitalization, + hintLocales = LocaleList(keyBoardLocale), + imeAction = imeActions, + ), + colors = OutlinedTextFieldDefaults.colors() + .copy( + focusedLabelColor = configurableTheme.primaryColor.toColor(), + focusedIndicatorColor = configurableTheme.primaryColor.toColor(), + unfocusedIndicatorColor = Gray200, + ), + ) +} diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/CreditCardForm.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/CreditCardForm.kt similarity index 81% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/CreditCardForm.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/CreditCardForm.kt index e939935..3c7615b 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/CreditCardForm.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/CreditCardForm.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.screens.payment.composables +package com.komoju.mobile.sdk.ui.screens.payment.composables import androidx.compose.foundation.Image import androidx.compose.foundation.border @@ -27,36 +27,37 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.vector.rememberVectorPainter import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.platform.LocalDensity -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.input.KeyboardCapitalization import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.intl.Locale import androidx.compose.ui.text.toUpperCase -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import com.komoju.android.sdk.R -import com.komoju.android.sdk.types.Currency -import com.komoju.android.sdk.ui.composables.InlinedPaymentPrimaryButton -import com.komoju.android.sdk.ui.composables.PrimaryButton -import com.komoju.android.sdk.ui.screens.payment.CreditCardDisplayData -import com.komoju.android.sdk.ui.theme.Gray200 -import com.komoju.android.sdk.ui.theme.Gray500 -import com.komoju.android.sdk.ui.theme.KomojuMobileSdkTheme -import com.komoju.android.sdk.ui.theme.Red600 -import com.komoju.android.sdk.utils.AmountUtils -import com.komoju.android.sdk.utils.CardScheme -import com.komoju.android.sdk.utils.CreditCardUtils.formatAmex -import com.komoju.android.sdk.utils.CreditCardUtils.formatDinnersClub -import com.komoju.android.sdk.utils.CreditCardUtils.formatOtherCardNumbers -import com.komoju.android.sdk.utils.CreditCardUtils.identifyCardScheme -import com.komoju.android.sdk.utils.CreditCardUtils.makeExpirationFilter -import com.komoju.android.sdk.utils.testID import com.komoju.mobile.sdk.entities.PaymentMethod +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.i18n.i18nStringResource +import com.komoju.mobile.sdk.ui.composables.InlinedPaymentPrimaryButton +import com.komoju.mobile.sdk.ui.composables.PrimaryButton +import com.komoju.mobile.sdk.ui.icon.Cvv +import com.komoju.mobile.sdk.ui.icon.KomojuIcon +import com.komoju.mobile.sdk.ui.screens.payment.CreditCardDisplayData +import com.komoju.mobile.sdk.ui.theme.Gray200 +import com.komoju.mobile.sdk.ui.theme.Gray500 +import com.komoju.mobile.sdk.ui.theme.KomojuMobileSdkTheme +import com.komoju.mobile.sdk.ui.theme.Red600 +import com.komoju.mobile.sdk.utils.AmountUtils +import com.komoju.mobile.sdk.utils.CardScheme +import com.komoju.mobile.sdk.utils.CreditCardUtils.formatAmex +import com.komoju.mobile.sdk.utils.CreditCardUtils.formatDinnersClub +import com.komoju.mobile.sdk.utils.CreditCardUtils.formatOtherCardNumbers +import com.komoju.mobile.sdk.utils.CreditCardUtils.identifyCardScheme +import com.komoju.mobile.sdk.utils.CreditCardUtils.makeExpirationFilter +import com.komoju.mobile.sdk.utils.testID +import org.jetbrains.compose.ui.tooling.preview.Preview @Composable internal fun CreditCardForm( @@ -70,17 +71,17 @@ internal fun CreditCardForm( val localDensity = LocalDensity.current val displayPayableAmount by remember(creditCard.amount) { derivedStateOf { - AmountUtils.formatToDecimal(Currency.parse(creditCard.currency), creditCard.amount) + AmountUtils.formatToDecimal(creditCard.currency, creditCard.amount) } } - val dividerColor = if (creditCardDisplayData.creditCardErrorStringResource == null) Gray200 else Red600 + val dividerColor = if (creditCardDisplayData.creditCardErrorI18nStringKey == null) Gray200 else Red600 Column { TextField( creditCardDisplayData.fullNameOnCard, - title = stringResource(R.string.komoju_cardholder_name), - placeholder = stringResource(R.string.komoju_full_name_on_card), + title = i18nStringResource(I18nStringKey.cardholder_name), + placeholder = i18nStringResource(I18nStringKey.full_name_on_card), capitalization = KeyboardCapitalization.Characters, - error = creditCardDisplayData.fullNameOnCardErrorStringResource?.let { stringResource(it) }, + error = creditCardDisplayData.fullNameOnCardErrorI18nStringKey?.let { i18nStringResource(it) }, onValueChange = { onCreditCardDisplayDataChange(creditCardDisplayData.copy(fullNameOnCard = it.toUpperCase(Locale.current))) }, @@ -90,7 +91,7 @@ internal fun CreditCardForm( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), - text = stringResource(R.string.komoju_card_number), + text = i18nStringResource(I18nStringKey.card_number), ) Box( @@ -165,7 +166,7 @@ internal fun CreditCardForm( ) if (creditCardDisplayData.creditCardExpiryDate.isEmpty()) { Text( - text = stringResource(R.string.komoju_mm_yy), + text = i18nStringResource(I18nStringKey.mm_yy), style = TextStyle(fontSize = 16.sp, color = Gray500), ) } @@ -185,14 +186,14 @@ internal fun CreditCardForm( ) if (creditCardDisplayData.creditCardCvv.isEmpty()) { Text( - text = stringResource(R.string.komoju_cvv), + text = i18nStringResource(I18nStringKey.cvv), style = TextStyle(fontSize = 16.sp, color = Gray500), ) } } Image( - painter = painterResource(R.drawable.komoju_ic_cvv), + painter = rememberVectorPainter(KomojuIcon.Cvv), contentDescription = null, modifier = Modifier.padding(start = 16.dp), ) @@ -205,7 +206,7 @@ internal fun CreditCardForm( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), - text = creditCardDisplayData.creditCardErrorStringResource?.let { stringResource(it) }.orEmpty(), + text = creditCardDisplayData.creditCardErrorI18nStringKey?.let { i18nStringResource(it) }.orEmpty(), style = TextStyle(fontSize = 16.sp, color = Red600), ) @@ -216,7 +217,7 @@ internal fun CreditCardForm( .testID("credit_card_pay") .padding(horizontal = 16.dp) .fillMaxWidth(), - text = stringResource(R.string.komoju_pay, displayPayableAmount), + text = i18nStringResource(I18nStringKey.pay, displayPayableAmount), onClick = onPayButtonClicked, state = creditCardDisplayData.inlinedPaymentPrimaryButtonState, ) @@ -226,7 +227,7 @@ internal fun CreditCardForm( .testID("credit_card_pay") .padding(horizontal = 16.dp) .fillMaxWidth(), - text = stringResource(R.string.komoju_pay, displayPayableAmount), + text = i18nStringResource(I18nStringKey.pay, displayPayableAmount), onClick = onPayButtonClicked, ) } @@ -240,16 +241,14 @@ internal fun CreditCardForm( }, colors = CheckboxDefaults.colors(checkedColor = Color.Black, uncheckedColor = Color.Black), ) - Text(stringResource(R.string.komoju_save_this_card_for_future_payments)) + Text(i18nStringResource(I18nStringKey.save_this_card_for_future_payments)) } } } } @Composable -@Preview( - showBackground = true, -) +@Preview private fun CreditCardFormPreview() { val creditCard = PaymentMethod.CreditCard( hashedGateway = "", diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/CreditCardSchemeIcons.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/CreditCardSchemeIcons.kt new file mode 100644 index 0000000..ec46780 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/CreditCardSchemeIcons.kt @@ -0,0 +1,55 @@ +package com.komoju.mobile.sdk.ui.screens.payment.composables + +import androidx.compose.animation.AnimatedVisibility +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.width +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.vector.rememberVectorPainter +import androidx.compose.ui.unit.dp +import com.komoju.mobile.sdk.ui.icon.Amex +import com.komoju.mobile.sdk.ui.icon.Diners +import com.komoju.mobile.sdk.ui.icon.Jcb +import com.komoju.mobile.sdk.ui.icon.KomojuIcon +import com.komoju.mobile.sdk.ui.icon.Master +import com.komoju.mobile.sdk.ui.icon.Visa +import com.komoju.mobile.sdk.utils.CardScheme +import org.jetbrains.compose.ui.tooling.preview.Preview + +@Composable +internal fun CreditCardSchemeIcons(cardScheme: CardScheme) { + Row { + AnimatedVisibility(visible = cardScheme == CardScheme.UNKNOWN) { + Row { + Image(painter = rememberVectorPainter(KomojuIcon.Visa), contentDescription = "visa_icon") + Spacer(Modifier.width(8.dp)) + Image(painter = rememberVectorPainter(KomojuIcon.Master), contentDescription = "mastercard_icon") + Spacer(Modifier.width(8.dp)) + Image(painter = rememberVectorPainter(KomojuIcon.Amex), contentDescription = "amex_icon") + } + } + AnimatedVisibility(visible = cardScheme == CardScheme.VISA) { + Image(painter = rememberVectorPainter(KomojuIcon.Visa), contentDescription = "visa_icon") + } + AnimatedVisibility(visible = cardScheme == CardScheme.MASTERCARD) { + Image(painter = rememberVectorPainter(KomojuIcon.Master), contentDescription = "mastercard_icon") + } + AnimatedVisibility(visible = cardScheme == CardScheme.AMEX) { + Image(painter = rememberVectorPainter(KomojuIcon.Amex), contentDescription = "amex_icon") + } + AnimatedVisibility(visible = cardScheme == CardScheme.DINERS_CLUB) { + Image(painter = rememberVectorPainter(KomojuIcon.Diners), contentDescription = "diners_icon") + } + AnimatedVisibility(visible = cardScheme == CardScheme.JCB) { + Image(painter = rememberVectorPainter(KomojuIcon.Jcb), contentDescription = "jcb_icon") + } + } +} + +@Composable +@Preview +private fun CreditCardSchemeIconsPreview() { + CreditCardSchemeIcons(CardScheme.UNKNOWN) +} diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/KonbiniBrandsRow.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/KonbiniBrandsRow.kt similarity index 62% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/KonbiniBrandsRow.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/KonbiniBrandsRow.kt index f151b98..48fb25f 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/KonbiniBrandsRow.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/KonbiniBrandsRow.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.screens.payment.composables +package com.komoju.mobile.sdk.ui.screens.payment.composables import androidx.compose.foundation.Image import androidx.compose.foundation.border @@ -17,16 +17,23 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.res.stringResource -import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.graphics.vector.rememberVectorPainter import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import com.komoju.android.sdk.R -import com.komoju.android.sdk.ui.theme.Gray200 -import com.komoju.android.sdk.ui.theme.KomojuDarkGreen -import com.komoju.android.sdk.ui.theme.KomojuMobileSdkTheme import com.komoju.mobile.sdk.entities.PaymentMethod.Konbini.KonbiniBrand +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.i18n.i18nStringResource +import com.komoju.mobile.sdk.ui.icon.DailyYamazaki +import com.komoju.mobile.sdk.ui.icon.FamilyMart +import com.komoju.mobile.sdk.ui.icon.KomojuIcon +import com.komoju.mobile.sdk.ui.icon.Lawson +import com.komoju.mobile.sdk.ui.icon.Ministop +import com.komoju.mobile.sdk.ui.icon.SeicoMart +import com.komoju.mobile.sdk.ui.icon.SevenEleven +import com.komoju.mobile.sdk.ui.theme.Gray200 +import com.komoju.mobile.sdk.ui.theme.KomojuDarkGreen +import com.komoju.mobile.sdk.ui.theme.KomojuMobileSdkTheme +import org.jetbrains.compose.ui.tooling.preview.Preview @Composable internal fun KonbiniBrandsRow(konbiniBrands: List, selectedKonbiniBrand: KonbiniBrand?, onSelected: (KonbiniBrand) -> Unit) { @@ -55,7 +62,7 @@ private fun KonbiniBrand(konbiniBrand: KonbiniBrand, isSelected: Boolean, onSele .padding(8.dp), ) { Image( - painter = painterResource(konbiniBrand.displayIcon), + painter = rememberVectorPainter(konbiniBrand.displayIcon), contentDescription = "${konbiniBrand.key} icon", modifier = Modifier.size(32.dp), ) @@ -67,22 +74,22 @@ private fun KonbiniBrand(konbiniBrand: KonbiniBrand, isSelected: Boolean, onSele private val KonbiniBrand.displayText @Composable get() = when (this) { - is KonbiniBrand.DailyYamazaki -> stringResource(R.string.komoju_daily_yamazaki) - is KonbiniBrand.FamilyMart -> stringResource(R.string.komoju_family_mart) - is KonbiniBrand.Lawson -> stringResource(R.string.komoju_lawson) - is KonbiniBrand.MiniStop -> stringResource(R.string.komoju_ministop) - is KonbiniBrand.SeicoMart -> stringResource(R.string.komoju_seicomart) - is KonbiniBrand.SevenEleven -> stringResource(R.string.komoju__7_eleven) + is KonbiniBrand.DailyYamazaki -> i18nStringResource(I18nStringKey.daily_yamazaki) + is KonbiniBrand.FamilyMart -> i18nStringResource(I18nStringKey.family_mart) + is KonbiniBrand.Lawson -> i18nStringResource(I18nStringKey.lawson) + is KonbiniBrand.MiniStop -> i18nStringResource(I18nStringKey.mini_stop) + is KonbiniBrand.SeicoMart -> i18nStringResource(I18nStringKey.seico_mart) + is KonbiniBrand.SevenEleven -> i18nStringResource(I18nStringKey.seven_eleven) } private val KonbiniBrand.displayIcon get() = when (this) { - is KonbiniBrand.DailyYamazaki -> R.drawable.komoju_ic_daily_yamazaki - is KonbiniBrand.FamilyMart -> R.drawable.komoju_ic_family_mart - is KonbiniBrand.Lawson -> R.drawable.komoju_ic_lawson - is KonbiniBrand.MiniStop -> R.drawable.komoju_ic_ministop - is KonbiniBrand.SeicoMart -> R.drawable.komoju_ic_seico_mart - is KonbiniBrand.SevenEleven -> R.drawable.komoju_ic_seven_eleven + is KonbiniBrand.DailyYamazaki -> KomojuIcon.DailyYamazaki + is KonbiniBrand.FamilyMart -> KomojuIcon.FamilyMart + is KonbiniBrand.Lawson -> KomojuIcon.Lawson + is KonbiniBrand.MiniStop -> KomojuIcon.Ministop + is KonbiniBrand.SeicoMart -> KomojuIcon.SeicoMart + is KonbiniBrand.SevenEleven -> KomojuIcon.SevenEleven } @Composable diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/KonbiniForm.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/KonbiniForm.kt similarity index 72% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/KonbiniForm.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/KonbiniForm.kt index a380977..001e6e3 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/KonbiniForm.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/KonbiniForm.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.screens.payment.composables +package com.komoju.mobile.sdk.ui.screens.payment.composables import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer @@ -13,22 +13,21 @@ import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier -import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.input.KeyboardType -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import com.komoju.android.sdk.R -import com.komoju.android.sdk.types.Currency -import com.komoju.android.sdk.ui.composables.PrimaryButton -import com.komoju.android.sdk.ui.screens.payment.CommonDisplayData -import com.komoju.android.sdk.ui.screens.payment.KonbiniDisplayData -import com.komoju.android.sdk.ui.theme.KomojuMobileSdkTheme -import com.komoju.android.sdk.ui.theme.Red600 -import com.komoju.android.sdk.utils.AmountUtils import com.komoju.mobile.sdk.entities.PaymentMethod import com.komoju.mobile.sdk.entities.PaymentMethod.Konbini.KonbiniBrand +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.i18n.i18nStringResource +import com.komoju.mobile.sdk.ui.composables.PrimaryButton +import com.komoju.mobile.sdk.ui.screens.payment.CommonDisplayData +import com.komoju.mobile.sdk.ui.screens.payment.KonbiniDisplayData +import com.komoju.mobile.sdk.ui.theme.KomojuMobileSdkTheme +import com.komoju.mobile.sdk.ui.theme.Red600 +import com.komoju.mobile.sdk.utils.AmountUtils +import org.jetbrains.compose.ui.tooling.preview.Preview @Composable internal fun KonbiniForm( @@ -41,24 +40,24 @@ internal fun KonbiniForm( ) { val displayPayableAmount by remember { derivedStateOf { - AmountUtils.formatToDecimal(Currency.parse(konbini.currency), konbini.amount) + AmountUtils.formatToDecimal(konbini.currency, konbini.amount) } } Column { TextField( konbiniDisplayData.receiptName, - title = stringResource(R.string.komoju_name_shown_on_receipt), - placeholder = stringResource(R.string.komoju_full_name_on_receipt), - error = konbiniDisplayData.receiptNameErrorStringResource?.let { stringResource(it) }, + title = i18nStringResource(I18nStringKey.name_shown_on_receipt), + placeholder = i18nStringResource(I18nStringKey.full_name_on_receipt), + error = konbiniDisplayData.receiptNameErrorI18nStringKey?.let { i18nStringResource(it) }, onValueChange = { onKonbiniDisplayDataChange(konbiniDisplayData.copy(receiptName = it)) }, ) TextField( commonDisplayData.email, - title = stringResource(R.string.komoju_email), - placeholder = stringResource(R.string.komoju_enter_your_email_address), - error = konbiniDisplayData.receiptEmailErrorStringResource?.let { stringResource(it) }, + title = i18nStringResource(I18nStringKey.email), + placeholder = i18nStringResource(I18nStringKey.enter_your_email_address), + error = konbiniDisplayData.receiptEmailErrorI18nStringKey?.let { i18nStringResource(it) }, onValueChange = { onCommonDisplayDataChange(commonDisplayData.copy(email = it)) }, @@ -76,21 +75,21 @@ internal fun KonbiniForm( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), - text = konbiniDisplayData.konbiniBrandNullErrorStringResource?.let { stringResource(it) }.orEmpty(), + text = konbiniDisplayData.konbiniBrandNullErrorI18nStringKey?.let { i18nStringResource(it) }.orEmpty(), style = TextStyle(fontSize = 16.sp, color = Red600), ) PrimaryButton( modifier = Modifier .padding(16.dp) .fillMaxWidth(), - text = stringResource(R.string.komoju_pay, displayPayableAmount), + text = i18nStringResource(I18nStringKey.pay, displayPayableAmount), onClick = onPayButtonClicked, ) } } @Composable -@Preview(showBackground = true) +@Preview private fun KonbiniFormPreview() { val konbini = PaymentMethod.Konbini( hashedGateway = "", diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/NetCashForm.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/NetCashForm.kt similarity index 63% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/NetCashForm.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/NetCashForm.kt index f005f57..cd0be4c 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/NetCashForm.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/NetCashForm.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.screens.payment.composables +package com.komoju.mobile.sdk.ui.screens.payment.composables import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer @@ -10,14 +10,13 @@ import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue import androidx.compose.runtime.remember import androidx.compose.ui.Modifier -import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp -import com.komoju.android.sdk.R -import com.komoju.android.sdk.types.Currency -import com.komoju.android.sdk.ui.composables.PrimaryButton -import com.komoju.android.sdk.ui.screens.payment.NetCashDisplayData -import com.komoju.android.sdk.utils.AmountUtils import com.komoju.mobile.sdk.entities.PaymentMethod +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.i18n.i18nStringResource +import com.komoju.mobile.sdk.ui.composables.PrimaryButton +import com.komoju.mobile.sdk.ui.screens.payment.NetCashDisplayData +import com.komoju.mobile.sdk.utils.AmountUtils @Composable internal fun NetCashForm( @@ -28,25 +27,25 @@ internal fun NetCashForm( ) { val displayPayableAmount by remember(netCash.amount) { derivedStateOf { - AmountUtils.formatToDecimal(Currency.parse(netCash.currency), netCash.amount) + AmountUtils.formatToDecimal(netCash.currency, netCash.amount) } } Column { TextField( value = netCashDisplayData.netCashId, - title = stringResource(R.string.komoju_net_cash_information), - placeholder = stringResource(R.string.komoju_net_cash_id), + title = i18nStringResource(I18nStringKey.net_cash_information), + placeholder = i18nStringResource(I18nStringKey.net_cash_id), onValueChange = { onNetCashDisplayDataChange(netCashDisplayData.copy(netCashId = it)) }, - error = netCashDisplayData.netCashErrorStringResource?.let { stringResource(it) }, + error = netCashDisplayData.netCashErrorI18nStringKey?.let { i18nStringResource(it) }, ) Spacer(modifier = Modifier.height(16.dp)) PrimaryButton( modifier = Modifier .padding(16.dp) .fillMaxWidth(), - text = stringResource(R.string.komoju_pay, displayPayableAmount), + text = i18nStringResource(I18nStringKey.pay, displayPayableAmount), onClick = onPayButtonClicked, ) } diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/OffSitePayForm.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/OffSitePayForm.kt similarity index 53% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/OffSitePayForm.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/OffSitePayForm.kt index 1f66d91..6ab12db 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/OffSitePayForm.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/OffSitePayForm.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.screens.payment.composables +package com.komoju.mobile.sdk.ui.screens.payment.composables import androidx.compose.foundation.Image import androidx.compose.foundation.background @@ -17,62 +17,64 @@ import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.res.stringResource +import androidx.compose.ui.graphics.vector.rememberVectorPainter import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import com.komoju.android.sdk.R -import com.komoju.android.sdk.ui.composables.PrimaryButton -import com.komoju.android.sdk.ui.theme.KomojuMobileSdkTheme import com.komoju.mobile.sdk.entities.PaymentMethod +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.i18n.i18nStringResource import com.komoju.mobile.sdk.types.OffSitePaymentType +import com.komoju.mobile.sdk.ui.composables.PrimaryButton +import com.komoju.mobile.sdk.ui.icon.AppOpensInfo +import com.komoju.mobile.sdk.ui.icon.KomojuIcon +import com.komoju.mobile.sdk.ui.theme.KomojuMobileSdkTheme +import org.jetbrains.compose.ui.tooling.preview.Preview @Composable internal fun OffSitePayForm(paymentMethod: PaymentMethod.OffSitePayment, onPayButtonClicked: () -> Unit) { val titleKey = remember(paymentMethod) { when (paymentMethod.type) { - OffSitePaymentType.ALI_PAY -> R.string.komoju_payment_via_alipay - OffSitePaymentType.AU_PAY -> R.string.komoju_payment_via_au_pay - OffSitePaymentType.MER_PAY -> R.string.komoju_payment_via_mer_pay - OffSitePaymentType.PAY_PAY -> R.string.komoju_payment_via_paypay - OffSitePaymentType.RAKUTEN_PAY -> R.string.komoju_payment_via_rakuten_pay - OffSitePaymentType.LINE_PAY -> R.string.komoju_payment_via_line_pay + OffSitePaymentType.ALI_PAY -> I18nStringKey.payment_via_alipay + OffSitePaymentType.AU_PAY -> I18nStringKey.payment_via_au_pay + OffSitePaymentType.MER_PAY -> I18nStringKey.payment_via_mer_pay + OffSitePaymentType.PAY_PAY -> I18nStringKey.payment_via_paypay + OffSitePaymentType.RAKUTEN_PAY -> I18nStringKey.payment_via_rakuten_pay + OffSitePaymentType.LINE_PAY -> I18nStringKey.payment_via_line_pay else -> null } } val messageKey = remember(paymentMethod) { when (paymentMethod.type) { - OffSitePaymentType.ALI_PAY -> R.string.komoju_you_will_be_redirected_to_alipay - OffSitePaymentType.AU_PAY -> R.string.komoju_you_will_be_redirected_to_au_pay - OffSitePaymentType.MER_PAY -> R.string.komoju_you_will_be_redirected_to_mer_pay - OffSitePaymentType.PAY_PAY -> R.string.komoju_you_will_be_redirected_to_paypay - OffSitePaymentType.RAKUTEN_PAY -> R.string.komoju_you_will_be_redirected_to_rakuten - OffSitePaymentType.LINE_PAY -> R.string.komoju_you_will_be_redirected_to_line_pay + OffSitePaymentType.ALI_PAY -> I18nStringKey.you_will_be_redirected_to_alipay + OffSitePaymentType.AU_PAY -> I18nStringKey.you_will_be_redirected_to_au_pay + OffSitePaymentType.MER_PAY -> I18nStringKey.you_will_be_redirected_to_mer_pay + OffSitePaymentType.PAY_PAY -> I18nStringKey.you_will_be_redirected_to_paypay + OffSitePaymentType.RAKUTEN_PAY -> I18nStringKey.you_will_be_redirected_to_rakuten + OffSitePaymentType.LINE_PAY -> I18nStringKey.you_will_be_redirected_to_line_pay else -> null } } val paymentButtonKey = remember(paymentMethod) { when (paymentMethod.type) { - OffSitePaymentType.ALI_PAY -> R.string.komoju_continue_to_alipay - OffSitePaymentType.AU_PAY -> R.string.komoju_continue_to_aupay - OffSitePaymentType.MER_PAY -> R.string.komoju_continue_to_merpay - OffSitePaymentType.PAY_PAY -> R.string.komoju_continue_to_paypay - OffSitePaymentType.RAKUTEN_PAY -> R.string.komoju_continue_to_rakuten - OffSitePaymentType.LINE_PAY -> R.string.komoju_continue_to_linepay + OffSitePaymentType.ALI_PAY -> I18nStringKey.continue_to_alipay + OffSitePaymentType.AU_PAY -> I18nStringKey.continue_to_au_pay + OffSitePaymentType.MER_PAY -> I18nStringKey.continue_to_mer_pay + OffSitePaymentType.PAY_PAY -> I18nStringKey.continue_to_paypay + OffSitePaymentType.RAKUTEN_PAY -> I18nStringKey.continue_to_rakuten + OffSitePaymentType.LINE_PAY -> I18nStringKey.continue_to_line_pay else -> null } } if (titleKey != null && messageKey != null && paymentButtonKey != null) { Column(modifier = Modifier.padding(all = 16.dp)) { - Text(text = stringResource(titleKey), style = TextStyle(fontWeight = FontWeight.Bold, fontSize = 24.sp)) + Text(text = i18nStringResource(titleKey), style = TextStyle(fontWeight = FontWeight.Bold, fontSize = 24.sp)) Spacer(modifier = Modifier.height(12.dp)) - Text(text = stringResource(messageKey)) + Text(text = i18nStringResource(messageKey)) Spacer(modifier = Modifier.height(24.dp)) Row( modifier = Modifier @@ -81,21 +83,21 @@ internal fun OffSitePayForm(paymentMethod: PaymentMethod.OffSitePayment, onPayBu verticalAlignment = Alignment.CenterVertically, ) { Image( - painter = painterResource(R.drawable.komoju_ic_app_opens_info), + painter = rememberVectorPainter(KomojuIcon.AppOpensInfo), contentDescription = "app_opens_info", modifier = Modifier.size(32.dp), ) Spacer(modifier = Modifier.width(16.dp)) - Text(text = stringResource(R.string.komoju_webview_open_info)) + Text(text = i18nStringResource(I18nStringKey.webview_open_info)) } Spacer(modifier = Modifier.height(32.dp)) - PrimaryButton(stringResource(paymentButtonKey), modifier = Modifier.fillMaxWidth(), onPayButtonClicked) + PrimaryButton(i18nStringResource(paymentButtonKey), modifier = Modifier.fillMaxWidth(), onPayButtonClicked) } } } @Composable -@Preview(showBackground = true) +@Preview private fun AppPayFormPreview() { KomojuMobileSdkTheme { OffSitePayForm( diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/PaidyForm.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PaidyForm.kt similarity index 59% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/PaidyForm.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PaidyForm.kt index 2a311a9..f58fd6b 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/PaidyForm.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PaidyForm.kt @@ -1,23 +1,25 @@ -package com.komoju.android.sdk.ui.screens.payment.composables +package com.komoju.mobile.sdk.ui.screens.payment.composables import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable +import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier -import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.KeyboardType -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import com.komoju.android.sdk.R -import com.komoju.android.sdk.ui.composables.PrimaryButton -import com.komoju.android.sdk.ui.screens.payment.PaidyDisplayData -import com.komoju.android.sdk.ui.theme.KomojuMobileSdkTheme import com.komoju.mobile.sdk.entities.PaymentMethod +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.i18n.i18nStringResource +import com.komoju.mobile.sdk.ui.composables.PrimaryButton +import com.komoju.mobile.sdk.ui.screens.payment.PaidyDisplayData +import com.komoju.mobile.sdk.ui.theme.KomojuMobileSdkTheme +import com.komoju.mobile.sdk.utils.AmountUtils +import org.jetbrains.compose.ui.tooling.preview.Preview @Composable internal fun PaidyForm( @@ -26,38 +28,43 @@ internal fun PaidyForm( onPaidyDisplayDataChange: (PaidyDisplayData) -> Unit, onPayButtonClicked: () -> Unit, ) { + val displayPayableAmount by remember(paidy.amount) { + derivedStateOf { + AmountUtils.formatToDecimal(paidy.currency, paidy.amount) + } + } Column { TextField( value = paidyDisplayData.fullName, - title = stringResource(R.string.komoju_full_name), - placeholder = stringResource(R.string.komoju_enter_your_name), + title = i18nStringResource(I18nStringKey.full_name), + placeholder = i18nStringResource(I18nStringKey.enter_your_name), onValueChange = { onPaidyDisplayDataChange(paidyDisplayData.copy(fullName = it)) }, - error = paidyDisplayData.fullNameErrorStringResource?.let { stringResource(it) }, + error = paidyDisplayData.fullNameErrorI18nStringKey?.let { i18nStringResource(it) }, ) TextField( value = paidyDisplayData.phoneNumber, - title = stringResource(R.string.komoju_phone_number), - placeholder = stringResource(R.string.komoju_enter_your_phone_number), + title = i18nStringResource(I18nStringKey.phone_number), + placeholder = i18nStringResource(I18nStringKey.enter_your_phone_number), keyboardType = KeyboardType.Phone, onValueChange = { onPaidyDisplayDataChange(paidyDisplayData.copy(phoneNumber = it)) }, - error = paidyDisplayData.phoneNumberErrorStringResource?.let { stringResource(it) }, + error = paidyDisplayData.phoneNumberErrorI18nStringKey?.let { i18nStringResource(it) }, ) PrimaryButton( - stringResource(R.string.komoju_continue_to_paidy), modifier = Modifier - .fillMaxWidth() - .padding(all = 16.dp), - onPayButtonClicked, + .padding(16.dp) + .fillMaxWidth(), + text = i18nStringResource(I18nStringKey.pay, displayPayableAmount), + onClick = onPayButtonClicked, ) } } @Composable -@Preview(showBackground = true) +@Preview private fun PaidyFormPreview() { val paidy = PaymentMethod.Paidy( hashedGateway = "hashedGateway", diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/PayEasyForm.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PayEasyForm.kt similarity index 66% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/PayEasyForm.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PayEasyForm.kt index e3ec888..1ace041 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/PayEasyForm.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PayEasyForm.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.screens.payment.composables +package com.komoju.mobile.sdk.ui.screens.payment.composables import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer @@ -9,18 +9,16 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue import androidx.compose.runtime.remember -import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier -import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.unit.dp -import com.komoju.android.sdk.R -import com.komoju.android.sdk.types.Currency -import com.komoju.android.sdk.ui.composables.PrimaryButton -import com.komoju.android.sdk.ui.screens.payment.CommonDisplayData -import com.komoju.android.sdk.utils.AmountUtils import com.komoju.mobile.sdk.entities.PaymentMethod +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.i18n.i18nStringResource +import com.komoju.mobile.sdk.ui.composables.PrimaryButton +import com.komoju.mobile.sdk.ui.screens.payment.CommonDisplayData +import com.komoju.mobile.sdk.utils.AmountUtils @Composable internal fun PayEasyForm( @@ -31,7 +29,7 @@ internal fun PayEasyForm( ) { val displayPayableAmount by remember(payEasy.amount) { derivedStateOf { - AmountUtils.formatToDecimal(Currency.parse(payEasy.currency), payEasy.amount) + AmountUtils.formatToDecimal(payEasy.currency, payEasy.amount) } } Column { @@ -40,38 +38,38 @@ internal fun PayEasyForm( .fillMaxWidth() .padding(horizontal = 16.dp), value = commonDisplayData.lastName, - title = stringResource(R.string.komoju_last_name), - placeholder = stringResource(R.string.komoju_last_name), + title = i18nStringResource(I18nStringKey.last_name), + placeholder = i18nStringResource(I18nStringKey.last_name), onValueChange = { onCommonDisplayDataChange(commonDisplayData.copy(lastName = it)) }, keyboardType = KeyboardType.Text, imeActions = ImeAction.Next, singleLine = true, - error = commonDisplayData.lastNameErrorStringResource?.let { stringResource(it) }, + error = commonDisplayData.lastNameErrorI18nStringKey, ) CompatTextField( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), value = commonDisplayData.firstName, - title = stringResource(R.string.komoju_first_name), - placeholder = stringResource(R.string.komoju_first_name), + title = i18nStringResource(I18nStringKey.first_name), + placeholder = i18nStringResource(I18nStringKey.first_name), onValueChange = { onCommonDisplayDataChange(commonDisplayData.copy(firstName = it)) }, keyboardType = KeyboardType.Text, imeActions = ImeAction.Next, singleLine = true, - error = commonDisplayData.firstNameErrorStringResource?.let { stringResource(it) }, + error = commonDisplayData.firstNameErrorI18nStringKey, ) CompatTextField( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), value = commonDisplayData.lastNamePhonetic, - title = stringResource(R.string.komoju_last_name_phonetic), - placeholder = stringResource(R.string.komoju_last_name_phonetic), + title = i18nStringResource(I18nStringKey.last_name_phonetic), + placeholder = i18nStringResource(I18nStringKey.last_name_phonetic), onValueChange = { onCommonDisplayDataChange(commonDisplayData.copy(lastNamePhonetic = it)) }, @@ -79,15 +77,15 @@ internal fun PayEasyForm( keyBoardLocale = JAPANESE_LOCALE, imeActions = ImeAction.Next, singleLine = true, - error = commonDisplayData.lastNamePhoneticErrorStringResource?.let { stringResource(it) }, + error = commonDisplayData.lastNamePhoneticErrorI18nStringKey, ) CompatTextField( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), value = commonDisplayData.firstNamePhonetic, - title = stringResource(R.string.komoju_first_name_phonetic), - placeholder = stringResource(R.string.komoju_first_name_phonetic), + title = i18nStringResource(I18nStringKey.first_name_phonetic), + placeholder = i18nStringResource(I18nStringKey.first_name_phonetic), onValueChange = { onCommonDisplayDataChange(commonDisplayData.copy(firstNamePhonetic = it)) }, @@ -95,44 +93,44 @@ internal fun PayEasyForm( keyBoardLocale = JAPANESE_LOCALE, imeActions = ImeAction.Next, singleLine = true, - error = commonDisplayData.firstNamePhoneticErrorStringResource?.let { stringResource(it) }, + error = commonDisplayData.firstNamePhoneticErrorI18nStringKey, ) CompatTextField( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), value = commonDisplayData.email, - title = stringResource(R.string.komoju_email), - placeholder = stringResource(R.string.komoju_enter_your_email_address), + title = i18nStringResource(I18nStringKey.email), + placeholder = i18nStringResource(I18nStringKey.enter_your_email_address), onValueChange = { onCommonDisplayDataChange(commonDisplayData.copy(email = it)) }, keyboardType = KeyboardType.Email, imeActions = ImeAction.Next, singleLine = true, - error = commonDisplayData.emailErrorStringResource?.let { stringResource(it) }, + error = commonDisplayData.emailErrorI18nStringKey, ) CompatTextField( modifier = Modifier .fillMaxWidth() .padding(horizontal = 16.dp), value = commonDisplayData.phoneNumber, - title = stringResource(R.string.komoju_phone_number), - placeholder = stringResource(R.string.komoju_enter_your_phone_number), + title = i18nStringResource(I18nStringKey.phone_number), + placeholder = i18nStringResource(I18nStringKey.enter_your_phone_number), onValueChange = { onCommonDisplayDataChange(commonDisplayData.copy(phoneNumber = it)) }, keyboardType = KeyboardType.Number, imeActions = ImeAction.Done, singleLine = true, - error = commonDisplayData.phoneNumberErrorStringResource?.let { stringResource(it) }, + error = commonDisplayData.phoneNumberErrorI18nStringKey, ) Spacer(modifier = Modifier.height(16.dp)) PrimaryButton( modifier = Modifier .padding(16.dp) .fillMaxWidth(), - text = stringResource(R.string.komoju_pay, displayPayableAmount), + text = i18nStringResource(I18nStringKey.pay, displayPayableAmount), onClick = onPayButtonClicked, ) } diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/PaymentMethodForm.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PaymentMethodForm.kt similarity index 88% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/PaymentMethodForm.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PaymentMethodForm.kt index 5dfea37..18e81c4 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/PaymentMethodForm.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PaymentMethodForm.kt @@ -1,14 +1,14 @@ -package com.komoju.android.sdk.ui.screens.payment.composables +package com.komoju.mobile.sdk.ui.screens.payment.composables import androidx.compose.runtime.Composable -import com.komoju.android.sdk.ui.screens.payment.BitCashDisplayData -import com.komoju.android.sdk.ui.screens.payment.CommonDisplayData -import com.komoju.android.sdk.ui.screens.payment.CreditCardDisplayData -import com.komoju.android.sdk.ui.screens.payment.KonbiniDisplayData -import com.komoju.android.sdk.ui.screens.payment.NetCashDisplayData -import com.komoju.android.sdk.ui.screens.payment.PaidyDisplayData -import com.komoju.android.sdk.ui.screens.payment.WebMoneyDisplayData import com.komoju.mobile.sdk.entities.PaymentMethod +import com.komoju.mobile.sdk.ui.screens.payment.BitCashDisplayData +import com.komoju.mobile.sdk.ui.screens.payment.CommonDisplayData +import com.komoju.mobile.sdk.ui.screens.payment.CreditCardDisplayData +import com.komoju.mobile.sdk.ui.screens.payment.KonbiniDisplayData +import com.komoju.mobile.sdk.ui.screens.payment.NetCashDisplayData +import com.komoju.mobile.sdk.ui.screens.payment.PaidyDisplayData +import com.komoju.mobile.sdk.ui.screens.payment.WebMoneyDisplayData @Composable internal fun PaymentMethodForm( diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/PaymentMethodsRow.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PaymentMethodsRow.kt similarity index 51% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/PaymentMethodsRow.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PaymentMethodsRow.kt index 97c41c7..7728ab6 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/PaymentMethodsRow.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PaymentMethodsRow.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.screens.payment.composables +package com.komoju.mobile.sdk.ui.screens.payment.composables import androidx.compose.foundation.Image import androidx.compose.foundation.border @@ -17,17 +17,32 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.res.stringResource +import androidx.compose.ui.graphics.vector.rememberVectorPainter import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import com.komoju.android.sdk.R -import com.komoju.android.sdk.ui.theme.Gray200 -import com.komoju.android.sdk.ui.theme.KomojuDarkGreen import com.komoju.mobile.sdk.entities.PaymentMethod +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.i18n.i18nStringResource import com.komoju.mobile.sdk.types.OffSitePaymentType +import com.komoju.mobile.sdk.ui.icon.Alipay +import com.komoju.mobile.sdk.ui.icon.AuPay +import com.komoju.mobile.sdk.ui.icon.BankTransfer +import com.komoju.mobile.sdk.ui.icon.Bitcash +import com.komoju.mobile.sdk.ui.icon.CreditCard +import com.komoju.mobile.sdk.ui.icon.KomojuIcon +import com.komoju.mobile.sdk.ui.icon.Konbini +import com.komoju.mobile.sdk.ui.icon.Linepay +import com.komoju.mobile.sdk.ui.icon.Merpay +import com.komoju.mobile.sdk.ui.icon.NetCash +import com.komoju.mobile.sdk.ui.icon.Paidy +import com.komoju.mobile.sdk.ui.icon.PayEasy +import com.komoju.mobile.sdk.ui.icon.Paypay +import com.komoju.mobile.sdk.ui.icon.RakutenPay +import com.komoju.mobile.sdk.ui.icon.WebMoney +import com.komoju.mobile.sdk.ui.theme.Gray200 +import com.komoju.mobile.sdk.ui.theme.KomojuDarkGreen +import org.jetbrains.compose.ui.tooling.preview.Preview @Composable internal fun PaymentMethodsRow( @@ -60,7 +75,7 @@ private fun PaymentMethodComposable(paymentMethod: PaymentMethod, isSelected: Bo .padding(start = 12.dp, end = 12.dp, top = 12.dp, bottom = 8.dp), ) { Image( - painter = painterResource(paymentMethod.displayIcon), + painter = rememberVectorPainter(paymentMethod.displayIcon), contentDescription = "${paymentMethod.displayName} icon", modifier = Modifier.height(32.dp), ) @@ -72,47 +87,47 @@ private fun PaymentMethodComposable(paymentMethod: PaymentMethod, isSelected: Bo private val PaymentMethod.displayName @Composable get() = when (this) { - is PaymentMethod.BankTransfer -> stringResource(R.string.komoju_bank_transfer) - is PaymentMethod.BitCash -> stringResource(R.string.komoju_bitcash) - is PaymentMethod.CreditCard -> stringResource(R.string.komoju_credit_card) - is PaymentMethod.Konbini -> stringResource(R.string.komoju_konbini) - is PaymentMethod.NetCash -> stringResource(R.string.komoju_netcash) + is PaymentMethod.BankTransfer -> i18nStringResource(I18nStringKey.bank_transfer) + is PaymentMethod.BitCash -> i18nStringResource(I18nStringKey.bit_cash) + is PaymentMethod.CreditCard -> i18nStringResource(I18nStringKey.credit_card) + is PaymentMethod.Konbini -> i18nStringResource(I18nStringKey.konbini) + is PaymentMethod.NetCash -> i18nStringResource(I18nStringKey.net_cash) is PaymentMethod.OffSitePayment -> when (type) { - OffSitePaymentType.AU_PAY -> stringResource(R.string.komoju_aupay) - OffSitePaymentType.ALI_PAY -> stringResource(R.string.komoju_alipay) - OffSitePaymentType.MER_PAY -> stringResource(R.string.komoju_merpay) - OffSitePaymentType.PAY_PAY -> stringResource(R.string.komoju_paypay) - OffSitePaymentType.RAKUTEN_PAY -> stringResource(R.string.komoju_rakuten_pay) - OffSitePaymentType.LINE_PAY -> stringResource(R.string.komoju_line_pay) - OffSitePaymentType.UNKNOWN -> stringResource(R.string.komoju_unknown) + OffSitePaymentType.AU_PAY -> i18nStringResource(I18nStringKey.au_pay) + OffSitePaymentType.ALI_PAY -> i18nStringResource(I18nStringKey.alipay) + OffSitePaymentType.MER_PAY -> i18nStringResource(I18nStringKey.mer_pay) + OffSitePaymentType.PAY_PAY -> i18nStringResource(I18nStringKey.paypay) + OffSitePaymentType.RAKUTEN_PAY -> i18nStringResource(I18nStringKey.rakuten_pay) + OffSitePaymentType.LINE_PAY -> i18nStringResource(I18nStringKey.line_pay) + OffSitePaymentType.UNKNOWN -> i18nStringResource(I18nStringKey.unknown) } - is PaymentMethod.Other -> stringResource(R.string.komoju_other) - is PaymentMethod.Paidy -> stringResource(R.string.komoju_paidy) - is PaymentMethod.PayEasy -> stringResource(R.string.komoju_payeasy) - is PaymentMethod.WebMoney -> stringResource(R.string.komoju_webmoney) + is PaymentMethod.Other -> i18nStringResource(I18nStringKey.other) + is PaymentMethod.Paidy -> i18nStringResource(I18nStringKey.paidy) + is PaymentMethod.PayEasy -> i18nStringResource(I18nStringKey.pay_easy) + is PaymentMethod.WebMoney -> i18nStringResource(I18nStringKey.web_money) } private val PaymentMethod.displayIcon get() = when (this) { is PaymentMethod.OffSitePayment -> when (type) { - OffSitePaymentType.ALI_PAY -> R.drawable.komoju_ic_alipay - OffSitePaymentType.AU_PAY -> R.drawable.komoju_ic_au_pay - OffSitePaymentType.MER_PAY -> R.drawable.komoju_ic_merpay - OffSitePaymentType.PAY_PAY -> R.drawable.komoju_ic_paypay - OffSitePaymentType.RAKUTEN_PAY -> R.drawable.komoju_ic_rakuten_pay - OffSitePaymentType.LINE_PAY -> R.drawable.komoju_ic_linepay - OffSitePaymentType.UNKNOWN -> R.drawable.komoju_ic_credit_card + OffSitePaymentType.ALI_PAY -> KomojuIcon.Alipay + OffSitePaymentType.AU_PAY -> KomojuIcon.AuPay + OffSitePaymentType.MER_PAY -> KomojuIcon.Merpay + OffSitePaymentType.PAY_PAY -> KomojuIcon.Paypay + OffSitePaymentType.RAKUTEN_PAY -> KomojuIcon.RakutenPay + OffSitePaymentType.LINE_PAY -> KomojuIcon.Linepay + OffSitePaymentType.UNKNOWN -> KomojuIcon.CreditCard } - is PaymentMethod.BankTransfer -> R.drawable.komoju_ic_bank_transfer - is PaymentMethod.BitCash -> R.drawable.komoju_ic_bitcash - is PaymentMethod.CreditCard -> R.drawable.komoju_ic_credit_card - is PaymentMethod.Konbini -> R.drawable.komoju_ic_konbini - is PaymentMethod.NetCash -> R.drawable.komoju_ic_net_cash - is PaymentMethod.Paidy -> R.drawable.komoju_ic_paidy - is PaymentMethod.PayEasy -> R.drawable.komoju_ic_pay_easy - is PaymentMethod.WebMoney -> R.drawable.komoju_ic_web_money - is PaymentMethod.Other -> R.drawable.komoju_ic_credit_card + is PaymentMethod.BankTransfer -> KomojuIcon.BankTransfer + is PaymentMethod.BitCash -> KomojuIcon.Bitcash + is PaymentMethod.CreditCard -> KomojuIcon.CreditCard + is PaymentMethod.Konbini -> KomojuIcon.Konbini + is PaymentMethod.NetCash -> KomojuIcon.NetCash + is PaymentMethod.Paidy -> KomojuIcon.Paidy + is PaymentMethod.PayEasy -> KomojuIcon.PayEasy + is PaymentMethod.WebMoney -> KomojuIcon.WebMoney + is PaymentMethod.Other -> KomojuIcon.CreditCard } @Composable diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/PaymentSheetHandle.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PaymentSheetHandle.kt similarity index 80% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/PaymentSheetHandle.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PaymentSheetHandle.kt index 73a1334..71e88e6 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/PaymentSheetHandle.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/PaymentSheetHandle.kt @@ -1,17 +1,14 @@ -package com.komoju.android.sdk.ui.screens.payment.composables +package com.komoju.mobile.sdk.ui.screens.payment.composables import androidx.compose.foundation.Image import androidx.compose.foundation.clickable -import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.material.icons.Icons import androidx.compose.material.icons.rounded.Close import androidx.compose.material3.Text -import androidx.compose.material3.ripple import androidx.compose.runtime.Composable -import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color @@ -36,8 +33,6 @@ internal fun PaymentSheetHandle(title: String, onCloseClicked: () -> Unit) { contentDescription = "Close Payment Sheet", modifier = Modifier.align(Alignment.CenterEnd) .clickable( - indication = ripple(bounded = true, radius = 24.dp), - interactionSource = remember { MutableInteractionSource() }, onClick = onCloseClicked, ) .padding(16.dp), diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/TextField.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/TextField.kt similarity index 89% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/TextField.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/TextField.kt index 68e01cd..fc9ee79 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/TextField.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/TextField.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.screens.payment.composables +package com.komoju.mobile.sdk.ui.screens.payment.composables import androidx.compose.foundation.border import androidx.compose.foundation.layout.Box @@ -17,9 +17,9 @@ import androidx.compose.ui.text.input.KeyboardCapitalization import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import com.komoju.android.sdk.ui.theme.Gray200 -import com.komoju.android.sdk.ui.theme.Gray500 -import com.komoju.android.sdk.ui.theme.Red600 +import com.komoju.mobile.sdk.ui.theme.Gray200 +import com.komoju.mobile.sdk.ui.theme.Gray500 +import com.komoju.mobile.sdk.ui.theme.Red600 @Composable internal fun TextField( @@ -28,8 +28,8 @@ internal fun TextField( placeholder: String, onValueChange: (String) -> Unit, error: String? = null, - keyboardType: KeyboardType = KeyboardType.Unspecified, - capitalization: KeyboardCapitalization = KeyboardCapitalization.Unspecified, + keyboardType: KeyboardType = KeyboardType.Text, + capitalization: KeyboardCapitalization = KeyboardCapitalization.None, ) { Column { Text( diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/WebMoneyForm.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/WebMoneyForm.kt similarity index 63% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/WebMoneyForm.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/WebMoneyForm.kt index 2ad256b..459e66b 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/payment/composables/WebMoneyForm.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/payment/composables/WebMoneyForm.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.screens.payment.composables +package com.komoju.mobile.sdk.ui.screens.payment.composables import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer @@ -10,14 +10,13 @@ import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue import androidx.compose.runtime.remember import androidx.compose.ui.Modifier -import androidx.compose.ui.res.stringResource import androidx.compose.ui.unit.dp -import com.komoju.android.sdk.R -import com.komoju.android.sdk.types.Currency -import com.komoju.android.sdk.ui.composables.PrimaryButton -import com.komoju.android.sdk.ui.screens.payment.WebMoneyDisplayData -import com.komoju.android.sdk.utils.AmountUtils import com.komoju.mobile.sdk.entities.PaymentMethod +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.i18n.i18nStringResource +import com.komoju.mobile.sdk.ui.composables.PrimaryButton +import com.komoju.mobile.sdk.ui.screens.payment.WebMoneyDisplayData +import com.komoju.mobile.sdk.utils.AmountUtils @Composable internal fun WebMoneyForm( @@ -28,25 +27,25 @@ internal fun WebMoneyForm( ) { val displayPayableAmount by remember(webMoney.amount) { derivedStateOf { - AmountUtils.formatToDecimal(Currency.parse(webMoney.currency), webMoney.amount) + AmountUtils.formatToDecimal(webMoney.currency, webMoney.amount) } } Column { TextField( value = webMoneyDisplayData.prepaidNumber, - title = stringResource(R.string.komoju_webmoney_information), - placeholder = stringResource(R.string.komoju_prepaid_number), + title = i18nStringResource(I18nStringKey.web_money_information), + placeholder = i18nStringResource(I18nStringKey.prepaid_number), onValueChange = { onWebMoneyDisplayDataChange(webMoneyDisplayData.copy(prepaidNumber = it)) }, - error = webMoneyDisplayData.prepaidNumberErrorStringResource?.let { stringResource(it) }, + error = webMoneyDisplayData.prepaidNumberErrorI18nStringKey?.let { i18nStringResource(it) }, ) Spacer(modifier = Modifier.height(16.dp)) PrimaryButton( modifier = Modifier .padding(16.dp) .fillMaxWidth(), - text = stringResource(R.string.komoju_pay, displayPayableAmount), + text = i18nStringResource(I18nStringKey.pay, displayPayableAmount), onClick = onPayButtonClicked, ) } diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/success/PaymentSuccessScreen.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/success/PaymentSuccessScreen.kt similarity index 68% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/success/PaymentSuccessScreen.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/success/PaymentSuccessScreen.kt index 66aaf06..2e0515a 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/success/PaymentSuccessScreen.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/success/PaymentSuccessScreen.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.ui.screens.success +package com.komoju.mobile.sdk.ui.screens.success import androidx.compose.foundation.Image import androidx.compose.foundation.clickable @@ -16,10 +16,8 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.res.painterResource -import androidx.compose.ui.res.stringResource +import androidx.compose.ui.graphics.vector.rememberVectorPainter import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import androidx.lifecycle.compose.collectAsStateWithLifecycle @@ -27,13 +25,14 @@ import cafe.adriel.voyager.core.model.rememberScreenModel import cafe.adriel.voyager.core.screen.Screen import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.currentOrThrow -import com.komoju.android.sdk.KomojuSDK -import com.komoju.android.sdk.R -import com.komoju.android.sdk.navigation.paymentResultScreenModel -import com.komoju.android.sdk.ui.composables.PrimaryButton -import com.komoju.android.sdk.ui.screens.RouterEffect -import com.komoju.android.sdk.ui.theme.KomojuMobileSdkTheme -import com.komoju.android.sdk.utils.PreviewScreen +import com.komoju.mobile.sdk.KomojuMobileSDKPaymentResult +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.i18n.i18nStringResource +import com.komoju.mobile.sdk.navigation.paymentResultScreenModel +import com.komoju.mobile.sdk.ui.composables.PrimaryButton +import com.komoju.mobile.sdk.ui.icon.KomojuIcon +import com.komoju.mobile.sdk.ui.icon.PaymentStatusCompleted +import com.komoju.mobile.sdk.ui.screens.RouterEffect internal class PaymentSuccessScreen : Screen { @Composable @@ -49,7 +48,7 @@ private fun Screen.PaymentSuccessScreenContent() { val navigator = LocalNavigator.currentOrThrow val resultScreenModel = navigator.paymentResultScreenModel() LaunchedEffect(Unit) { - resultScreenModel.setResult(KomojuSDK.PaymentResult(isSuccessFul = true)) + resultScreenModel.setResult(KomojuMobileSDKPaymentResult(isSuccessFul = true)) } Column(modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) { Box(modifier = Modifier.fillMaxWidth(), contentAlignment = Alignment.CenterEnd) { @@ -63,27 +62,19 @@ private fun Screen.PaymentSuccessScreenContent() { }, ) } - Image(painterResource(R.drawable.komoju_ic_payment_status_completed), "status_icon") + Image(rememberVectorPainter(KomojuIcon.PaymentStatusCompleted), "status_icon") Spacer(Modifier.height(16.dp)) - Text(stringResource(R.string.komoju_payment_success), fontSize = 24.sp, fontWeight = FontWeight.Bold) + Text(i18nStringResource(I18nStringKey.payment_success), fontSize = 24.sp, fontWeight = FontWeight.Bold) Spacer(Modifier.height(16.dp)) - Text(stringResource(R.string.komoju_thank_you_for_your_order)) + Text(i18nStringResource(I18nStringKey.thank_you_for_your_order)) Spacer(Modifier.weight(1f)) PrimaryButton( modifier = Modifier .fillMaxWidth() .padding(16.dp), - text = stringResource(R.string.komoju_back_to_store), + text = i18nStringResource(I18nStringKey.back_to_store), ) { screenModel.onBackToStoreButtonClicked() } } } - -@Composable -@Preview -private fun PaymentSuccessScreenContentPreview() { - KomojuMobileSdkTheme { - PreviewScreen.PaymentSuccessScreenContent() - } -} diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/success/PaymentSuccessScreenModel.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/success/PaymentSuccessScreenModel.kt similarity index 66% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/success/PaymentSuccessScreenModel.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/success/PaymentSuccessScreenModel.kt index 61c2f88..54fa28c 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/success/PaymentSuccessScreenModel.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/success/PaymentSuccessScreenModel.kt @@ -1,6 +1,6 @@ -package com.komoju.android.sdk.ui.screens.success +package com.komoju.mobile.sdk.ui.screens.success -import com.komoju.android.sdk.navigation.RouterStateScreenModel +import com.komoju.mobile.sdk.navigation.RouterStateScreenModel internal class PaymentSuccessScreenModel : RouterStateScreenModel(Unit) { fun onCloseButtonClicked() { diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/verify/ProcessPaymentScreen.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/verify/ProcessPaymentScreen.kt similarity index 80% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/verify/ProcessPaymentScreen.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/verify/ProcessPaymentScreen.kt index 8df74ed..5bfa718 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/verify/ProcessPaymentScreen.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/verify/ProcessPaymentScreen.kt @@ -1,18 +1,17 @@ -package com.komoju.android.sdk.ui.screens.verify +package com.komoju.mobile.sdk.ui.screens.verify import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect -import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.lifecycle.compose.collectAsStateWithLifecycle import cafe.adriel.voyager.core.model.rememberScreenModel import cafe.adriel.voyager.core.screen.Screen -import com.komoju.android.sdk.ui.composables.ThemedCircularProgressIndicator -import com.komoju.android.sdk.ui.screens.KomojuPaymentRoute -import com.komoju.android.sdk.ui.screens.RouterEffect +import com.komoju.mobile.sdk.ui.composables.ThemedCircularProgressIndicator +import com.komoju.mobile.sdk.ui.screens.KomojuPaymentRoute +import com.komoju.mobile.sdk.ui.screens.RouterEffect internal class ProcessPaymentScreen(private val route: KomojuPaymentRoute.ProcessPayment) : Screen { @Composable diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/verify/VerifyPaymentScreenModel.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/verify/VerifyPaymentScreenModel.kt similarity index 85% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/verify/VerifyPaymentScreenModel.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/verify/VerifyPaymentScreenModel.kt index 46ff9ad..a502e78 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/verify/VerifyPaymentScreenModel.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/verify/VerifyPaymentScreenModel.kt @@ -1,19 +1,20 @@ -package com.komoju.android.sdk.ui.screens.verify +package com.komoju.mobile.sdk.ui.screens.verify import cafe.adriel.voyager.core.model.screenModelScope -import com.komoju.android.sdk.KomojuSDK -import com.komoju.android.sdk.navigation.RouterStateScreenModel -import com.komoju.android.sdk.ui.screens.KomojuPaymentRoute -import com.komoju.android.sdk.ui.screens.Router -import com.komoju.android.sdk.ui.screens.failed.Reason +import com.komoju.mobile.sdk.KomojuMobileSDKConfiguration +import com.komoju.mobile.sdk.KomojuMobileSDKPaymentResult import com.komoju.mobile.sdk.entities.PaymentStatus import com.komoju.mobile.sdk.entities.PaymentStatus.Companion.isSuccessful +import com.komoju.mobile.sdk.navigation.RouterStateScreenModel import com.komoju.mobile.sdk.remote.apis.KomojuRemoteApi +import com.komoju.mobile.sdk.ui.screens.KomojuPaymentRoute +import com.komoju.mobile.sdk.ui.screens.Router +import com.komoju.mobile.sdk.ui.screens.failed.Reason import kotlinx.coroutines.launch -internal class VerifyPaymentScreenModel(private val config: KomojuSDK.Configuration) : RouterStateScreenModel(Unit) { +internal class VerifyPaymentScreenModel(private val config: KomojuMobileSDKConfiguration) : RouterStateScreenModel(Unit) { - private val komojuApi: KomojuRemoteApi = KomojuRemoteApi.create(config.publishableKey) + private val komojuApi: KomojuRemoteApi = KomojuRemoteApi.create(config) fun process(type: KomojuPaymentRoute.ProcessPayment.ProcessType) { screenModelScope.launch { @@ -29,7 +30,7 @@ internal class VerifyPaymentScreenModel(private val config: KomojuSDK.Configurat komojuApi.sessions.verifyPaymentBySessionID(config.sessionId.orEmpty()).onSuccess { paymentDetails -> mutableRouter.value = when { config.inlinedProcessing -> Router.SetPaymentResultAndPop( - KomojuSDK.PaymentResult( + KomojuMobileSDKPaymentResult( isSuccessFul = paymentDetails.status.isSuccessful(), ), ) diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/webview/WebViewRequestInterceptor.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/webview/WebViewRequestInterceptor.kt new file mode 100644 index 0000000..118f908 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/webview/WebViewRequestInterceptor.kt @@ -0,0 +1,27 @@ +package com.komoju.mobile.sdk.ui.screens.webview + +import com.eygraber.uri.Uri +import com.multiplatform.webview.request.RequestInterceptor +import com.multiplatform.webview.request.WebRequest +import com.multiplatform.webview.request.WebRequestInterceptResult +import com.multiplatform.webview.web.WebViewNavigator + +internal class WebViewRequestInterceptor(private val appScheme: String, private val onDeeplinkCaptured: (String) -> Unit) : + RequestInterceptor { + override fun onInterceptUrlRequest(request: WebRequest, navigator: WebViewNavigator): WebRequestInterceptResult = + request.checkAndOpen(appScheme, onDeeplinkCaptured) + + private fun WebRequest.checkAndOpen(appScheme: String, onDeeplinkCaptured: (String) -> Unit): WebRequestInterceptResult { + try { + val uri = Uri.parse(url) + if (uri.scheme == appScheme) { + onDeeplinkCaptured(url) + return WebRequestInterceptResult.Reject + } else { + error("Unsupported scheme for deeplink, load in webView Instead.") + } + } catch (_: Exception) { + return WebRequestInterceptResult.Allow + } + } +} diff --git a/android/src/main/java/com/komoju/android/sdk/ui/screens/webview/WebViewScreen.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/webview/WebViewScreen.kt similarity index 66% rename from android/src/main/java/com/komoju/android/sdk/ui/screens/webview/WebViewScreen.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/webview/WebViewScreen.kt index 514ff45..46891c1 100644 --- a/android/src/main/java/com/komoju/android/sdk/ui/screens/webview/WebViewScreen.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/webview/WebViewScreen.kt @@ -1,10 +1,7 @@ -package com.komoju.android.sdk.ui.screens.webview +package com.komoju.mobile.sdk.ui.screens.webview -import androidx.activity.compose.BackHandler import androidx.compose.foundation.Image -import androidx.compose.foundation.background import androidx.compose.foundation.clickable -import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxSize @@ -17,9 +14,7 @@ import androidx.compose.material.icons.rounded.Close import androidx.compose.material3.AlertDialog import androidx.compose.material3.Icon import androidx.compose.material3.LinearProgressIndicator -import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text -import androidx.compose.material3.ripple import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf @@ -27,22 +22,24 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow -import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import androidx.lifecycle.compose.collectAsStateWithLifecycle +import cafe.adriel.voyager.core.annotation.InternalVoyagerApi import cafe.adriel.voyager.core.model.rememberScreenModel import cafe.adriel.voyager.core.screen.Screen -import com.kevinnzou.web.LoadingState -import com.kevinnzou.web.WebView -import com.kevinnzou.web.rememberWebViewState -import com.komoju.android.sdk.R -import com.komoju.android.sdk.ui.screens.KomojuPaymentRoute -import com.komoju.android.sdk.ui.screens.RouterEffect -import com.komoju.android.sdk.ui.theme.LocalConfigurableTheme +import cafe.adriel.voyager.navigator.internal.BackHandler +import com.komoju.mobile.sdk.i18n.I18nStringKey +import com.komoju.mobile.sdk.i18n.i18nStringResource +import com.komoju.mobile.sdk.ui.screens.KomojuPaymentRoute +import com.komoju.mobile.sdk.ui.screens.RouterEffect +import com.komoju.mobile.sdk.ui.theme.LocalConfigurableTheme +import com.komoju.mobile.sdk.ui.theme.toColor +import com.multiplatform.webview.web.LoadingState +import com.multiplatform.webview.web.WebView +import com.multiplatform.webview.web.rememberWebViewNavigator +import com.multiplatform.webview.web.rememberWebViewState internal data class WebViewScreen(val route: KomojuPaymentRoute.WebView) : Screen { @Composable @@ -51,16 +48,15 @@ internal data class WebViewScreen(val route: KomojuPaymentRoute.WebView) : Scree } } +@OptIn(InternalVoyagerApi::class) @Composable private fun Screen.WebViewScreenContent(route: KomojuPaymentRoute.WebView) { val state = rememberWebViewState(route.url) var showBackPressDialog by remember { mutableStateOf(false) } val screenModel = rememberScreenModel { WebViewScreenModel() } RouterEffect(screenModel.router.collectAsStateWithLifecycle(), screenModel::onRouteConsumed) - if (route.canComeBack.not() && showBackPressDialog.not()) { - BackHandler { - showBackPressDialog = true - } + BackHandler(enabled = route.canComeBack.not() && showBackPressDialog.not()) { + showBackPressDialog = true } Column(modifier = Modifier) { Row( @@ -74,8 +70,6 @@ private fun Screen.WebViewScreenContent(route: KomojuPaymentRoute.WebView) { contentDescription = "Back", modifier = Modifier .clickable( - indication = ripple(bounded = true, radius = 24.dp), - interactionSource = remember { MutableInteractionSource() }, onClick = { screenModel.onBackPressed() }, @@ -99,8 +93,6 @@ private fun Screen.WebViewScreenContent(route: KomojuPaymentRoute.WebView) { contentDescription = "Close Payment Sheet", modifier = Modifier .clickable( - indication = ripple(bounded = true, radius = 24.dp), - interactionSource = remember { MutableInteractionSource() }, onClick = { showBackPressDialog = true }, @@ -114,25 +106,19 @@ private fun Screen.WebViewScreenContent(route: KomojuPaymentRoute.WebView) { LinearProgressIndicator( progress = { loadingState.progress }, modifier = Modifier.fillMaxWidth(), - color = Color(LocalConfigurableTheme.current.loaderColor), + color = LocalConfigurableTheme.current.loaderColor.toColor(), ) } WebView( modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.surface), + .fillMaxSize(), state = state, - onCreated = { nativeWebView -> - nativeWebView.clipToOutline = true - nativeWebView.setBackgroundColor(android.graphics.Color.TRANSPARENT) - nativeWebView.settings.apply { - domStorageEnabled = true - javaScriptEnabled = route.isJavaScriptEnabled - } - }, captureBackPresses = false, - chromeClient = remember { WebChromeClient() }, - client = remember { WebViewClient() }, + navigator = rememberWebViewNavigator( + requestInterceptor = WebViewRequestInterceptor(route.configuration.appScheme) { + screenModel.onNewDeeplink(route.configuration, it) + }, + ), ) if (showBackPressDialog) { AlertDialog( @@ -141,7 +127,7 @@ private fun Screen.WebViewScreenContent(route: KomojuPaymentRoute.WebView) { }, confirmButton = { Text( - text = stringResource(R.string.komoju_yes), + text = i18nStringResource(I18nStringKey.yes), modifier = Modifier .clickable { screenModel.onBackPressed() @@ -151,7 +137,7 @@ private fun Screen.WebViewScreenContent(route: KomojuPaymentRoute.WebView) { }, dismissButton = { Text( - text = stringResource(R.string.komoju_no), + text = i18nStringResource(I18nStringKey.no), modifier = Modifier .clickable { showBackPressDialog = false @@ -161,20 +147,14 @@ private fun Screen.WebViewScreenContent(route: KomojuPaymentRoute.WebView) { }, text = { Text( - text = stringResource(R.string.komoju_are_you_sure_you_want_to_cancel_the_payment), + text = i18nStringResource(I18nStringKey.are_you_sure_you_want_to_cancel_the_payment), modifier = Modifier.padding(8.dp), ) }, title = { - Text(text = stringResource(R.string.komoju_cancel_payment)) + Text(text = i18nStringResource(I18nStringKey.cancel_payment)) }, ) } } } - -@Composable -@Preview(showBackground = true, showSystemUi = true) -private fun WebViewScreenPreview() { - WebViewScreen(KomojuPaymentRoute.WebView("https://www.komoju.com/")) -} diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/webview/WebViewScreenModel.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/webview/WebViewScreenModel.kt new file mode 100644 index 0000000..625005e --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/screens/webview/WebViewScreenModel.kt @@ -0,0 +1,32 @@ +package com.komoju.mobile.sdk.ui.screens.webview + +import com.komoju.mobile.sdk.KomojuMobileSDKConfiguration +import com.komoju.mobile.sdk.navigation.RouterStateScreenModel +import com.komoju.mobile.sdk.ui.screens.KomojuPaymentRoute +import com.komoju.mobile.sdk.ui.screens.Router +import com.komoju.mobile.sdk.utils.DeeplinkEntity + +internal class WebViewScreenModel : RouterStateScreenModel(Unit) { + + fun onBackPressed() { + mutableRouter.pop() + } + + fun onNewDeeplink(configuration: KomojuMobileSDKConfiguration, deeplink: String) { + val deeplinkEntity = DeeplinkEntity.from(deeplink) + mutableRouter.value = Router.ReplaceAll( + KomojuPaymentRoute.ProcessPayment( + configuration = configuration, + processType = when (deeplinkEntity) { + is DeeplinkEntity.Verify.BySecureToken -> KomojuPaymentRoute.ProcessPayment.ProcessType.VerifyTokenAndPay( + deeplinkEntity.secureTokenId, + amount = deeplinkEntity.amount, + currency = deeplinkEntity.currency, + ) + + DeeplinkEntity.Verify.BySessionId -> KomojuPaymentRoute.ProcessPayment.ProcessType.Session + }, + ), + ) + } +} diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/theme/ConfigurableTheme.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/theme/ConfigurableTheme.kt new file mode 100644 index 0000000..31884ff --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/theme/ConfigurableTheme.kt @@ -0,0 +1,63 @@ +package com.komoju.mobile.sdk.ui.theme + +import androidx.compose.ui.graphics.Color + +/** + * Interface representing a configurable theme with customizable UI properties. + */ +interface ConfigurableTheme { + + /** + * primary color of the SDK + * + * @return A value representing a color value annotated with [Color]. + */ + val primaryColor: Long + + /** + * Color value for the content (e.g., text or icon) inside the primary button. + * + * @return A value representing a color value annotated with [Color]. + */ + val primaryContentColor: Long + + /** + * Corner radius for the primary button in density-independent pixels (DP). + * + * @return A value representing the corner radius in DP annotated with [Int]. + */ + val primaryShapeCornerRadiusInDp: Int + + /** + * Color value for the loader/spinner. + * + * @return A value representing a color value annotated with [Color]. + */ + val loaderColor: Long + + companion object { + /** + * Provides a default implementation of the [ConfigurableTheme]. + */ + val default = DefaultConfigurableTheme() + } +} + +/** + * Data class representing the default implementation of [ConfigurableTheme]. + * This class uses default values for UI elements such as buttons and loaders. + * + * @param primaryColor The background color of the primary button. + * @param primaryContentColor The color of the content inside the primary button. + * @param primaryShapeCornerRadiusInDp The corner radius of the primary button in DP. + * @param loaderColor The color of the loader/spinner. + */ + +data class DefaultConfigurableTheme( + override val primaryColor: Long = 0xFF297FE7, // Default blue color for primary button. + override val primaryContentColor: Long = 0xFFFFFFFF, // Default white color for primary button content. + override val primaryShapeCornerRadiusInDp: Int = 8, // Default corner radius of 8 DP for primary button. + override val loaderColor: Long = 0xFF3CC239, // Default green color for loader. +) : ConfigurableTheme + +fun Long.toColor(): Color = Color(this) diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/theme/Theme.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/theme/Theme.kt new file mode 100644 index 0000000..eb7b961 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/ui/theme/Theme.kt @@ -0,0 +1,61 @@ +package com.komoju.mobile.sdk.ui.theme + +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Surface +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.compositionLocalOf +import androidx.compose.ui.graphics.Color +import com.komoju.mobile.sdk.KomojuMobileSDKConfiguration +import com.komoju.mobile.sdk.i18n.KomojuLanguage + +internal val KomojuLightGreen = Color(0xFF3CC239) +internal val KomojuDarkGreen = Color(0xFF172E44) +internal val Gray50 = Color(0xFFF6F7F9) +internal val Gray200 = Color(0xFFD7DCE0) +internal val Gray500 = Color(0xFF6D7D88) +internal val Gray700 = Color(0xFF45535E) +internal val Red600 = Color(0xFFF04438) + +internal val LocalConfigurableTheme = compositionLocalOf { + error("Use KomojuMobileSdkTheme to provide ConfigurableTheme") +} + +internal val LocalKomojuLanguage = compositionLocalOf { + error("Use KomojuMobileSdkTheme to provide ConfigurableTheme") +} + +private val LightColorScheme = lightColorScheme( + primary = KomojuLightGreen, + secondary = KomojuDarkGreen, + tertiary = KomojuLightGreen, + background = Color.White, + surfaceContainer = Color.White, +) + +@Composable +internal fun KomojuMobileSdkTheme(configuration: KomojuMobileSDKConfiguration = EmptyConfiguration, content: @Composable () -> Unit) { + Surface(color = Color.White) { + MaterialTheme( + colorScheme = LightColorScheme, + content = { + CompositionLocalProvider(LocalKomojuLanguage provides KomojuLanguage(configuration.language)) { + CompositionLocalProvider(LocalConfigurableTheme provides configuration.configurableTheme, content = content) + } + }, + ) + } +} + +internal val EmptyConfiguration = KomojuMobileSDKConfiguration( + language = "ja", + currency = "jpy", + publishableKey = null, + isDebugMode = false, + sessionId = null, + redirectURL = "", + appScheme = "", + configurableTheme = DefaultConfigurableTheme(), + inlinedProcessing = false, +) diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/AmountUtils.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/AmountUtils.kt new file mode 100644 index 0000000..620f5e1 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/AmountUtils.kt @@ -0,0 +1,15 @@ +package com.komoju.mobile.sdk.utils + +import nl.jacobras.humanreadable.HumanReadable + +internal object AmountUtils { + fun formatToDecimal(currency: String, amount: String): String { + if (amount.isBlank()) return "" + return currency.symbol() + HumanReadable.number(amount.toInt(), decimals = 0) + } +} + +private fun String.symbol(): String = when (this.uppercase()) { + "JPY" -> "¥" + else -> "$" +} diff --git a/android/src/main/java/com/komoju/android/sdk/utils/CreditCardUtils.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/CreditCardUtils.kt similarity index 98% rename from android/src/main/java/com/komoju/android/sdk/utils/CreditCardUtils.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/CreditCardUtils.kt index 2ea3805..1878461 100644 --- a/android/src/main/java/com/komoju/android/sdk/utils/CreditCardUtils.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/CreditCardUtils.kt @@ -1,4 +1,4 @@ -package com.komoju.android.sdk.utils +package com.komoju.mobile.sdk.utils import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.text.input.OffsetMapping @@ -153,7 +153,7 @@ internal object CreditCardUtils { var sum = 0 var alternate = false for (i in sanitizedCardNumber.length - 1 downTo 0) { - var digit = Character.getNumericValue(sanitizedCardNumber[i]) + var digit = sanitizedCardNumber[i].digitToInt() if (alternate) { digit *= 2 if (digit > 9) { diff --git a/android/src/main/java/com/komoju/android/sdk/utils/DeeplinkEntity.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/DeeplinkEntity.kt similarity index 82% rename from android/src/main/java/com/komoju/android/sdk/utils/DeeplinkEntity.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/DeeplinkEntity.kt index 19eae8a..f54ac51 100644 --- a/android/src/main/java/com/komoju/android/sdk/utils/DeeplinkEntity.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/DeeplinkEntity.kt @@ -1,8 +1,8 @@ -package com.komoju.android.sdk.utils +package com.komoju.mobile.sdk.utils -import androidx.core.net.toUri +import com.eygraber.uri.Uri -internal sealed interface DeeplinkEntity { +sealed interface DeeplinkEntity { sealed interface Verify : DeeplinkEntity { data class BySecureToken(val secureTokenId: String, val amount: String, val currency: String) : Verify @@ -11,7 +11,7 @@ internal sealed interface DeeplinkEntity { companion object { fun from(rawDeeplink: String): DeeplinkEntity { - val uri = rawDeeplink.toUri() + val uri = Uri.parse(rawDeeplink) val token = uri.getQueryParameter("secure_token_id") return when { token != null -> Verify.BySecureToken( diff --git a/android/src/main/java/com/komoju/android/sdk/utils/InlinedPaymentProcessor.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/InlinedPaymentProcessor.kt similarity index 94% rename from android/src/main/java/com/komoju/android/sdk/utils/InlinedPaymentProcessor.kt rename to shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/InlinedPaymentProcessor.kt index 8043127..5c72729 100644 --- a/android/src/main/java/com/komoju/android/sdk/utils/InlinedPaymentProcessor.kt +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/InlinedPaymentProcessor.kt @@ -1,8 +1,8 @@ -package com.komoju.android.sdk.utils +package com.komoju.mobile.sdk.utils -import com.komoju.android.sdk.ui.screens.failed.Reason import com.komoju.mobile.sdk.entities.PaymentStatus import com.komoju.mobile.sdk.remote.apis.KomojuRemoteApi +import com.komoju.mobile.sdk.ui.screens.failed.Reason internal suspend fun KomojuRemoteApi.verifyTokenAndProcessPayment( sessionId: String, diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/Logger.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/Logger.kt new file mode 100644 index 0000000..adb8e91 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/Logger.kt @@ -0,0 +1,17 @@ +package com.komoju.mobile.sdk.utils + +internal object Logger { + private var shouldPrintLogs = false + + fun setDebugMode(debugMode: Boolean) { + shouldPrintLogs = debugMode + } + + fun d(message: String?) { + if (shouldPrintLogs) println(message) + } + + fun e(t: Throwable) { + if (shouldPrintLogs) println(t) + } +} diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/ModifierExt.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/ModifierExt.kt new file mode 100644 index 0000000..92e392f --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/ModifierExt.kt @@ -0,0 +1,5 @@ +package com.komoju.mobile.sdk.utils + +import androidx.compose.ui.Modifier + +internal expect fun Modifier.testID(id: String): Modifier diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/Platform.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/Platform.kt new file mode 100644 index 0000000..801f2a4 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/Platform.kt @@ -0,0 +1,8 @@ +package com.komoju.mobile.sdk.utils + +enum class Platform { + ANDROID, + IOS, +} + +expect val currentPlatform: Platform diff --git a/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/StringExt.kt b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/StringExt.kt new file mode 100644 index 0000000..9b97401 --- /dev/null +++ b/shared/src/commonMain/kotlin/com/komoju/mobile/sdk/utils/StringExt.kt @@ -0,0 +1,24 @@ +package com.komoju.mobile.sdk.utils + +private val EMAIL_REGEX = "^[A-Za-z0-9+_.-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}$".toRegex() + +internal inline val String.Companion.empty get() = "" + +internal inline val String.isValidEmail: Boolean get() = matches(EMAIL_REGEX) + +internal inline val String.isDigitsOnly get() = all { it.isDigit() } + +// japanese detection Stuff below. +internal inline val Char.isKana get() = isHiragana || isKatakana +internal inline val String.isKanaOnly: Boolean get() = all { it.isKana } + +// Source: https://github.com/esnaultdev/wanakana-kt +private const val KATAKANA_START = 0x30a1 +private const val KATAKANA_END = 0x30fc +private const val HIRAGANA_START = 0x3041 +private const val HIRAGANA_END = 0x3096 +private const val PROLONGED_SOUND_MARK = 0x30fc +private val KATAKANA_RANGE = KATAKANA_START..KATAKANA_END +private val HIRAGANA_RANGE = HIRAGANA_START..HIRAGANA_END +private val Char.isHiragana: Boolean get() = code == PROLONGED_SOUND_MARK || code in HIRAGANA_RANGE +private val Char.isKatakana: Boolean get() = code in KATAKANA_RANGE diff --git a/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/.keep b/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/MainViewController.kt b/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/MainViewController.kt new file mode 100644 index 0000000..f76b66d --- /dev/null +++ b/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/MainViewController.kt @@ -0,0 +1,52 @@ +package com.komoju.mobile.sdk + +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.ExperimentalComposeApi +import androidx.compose.runtime.compositionLocalOf +import androidx.compose.ui.uikit.ComposeUIViewControllerDelegate +import androidx.compose.ui.uikit.OnFocusBehavior +import androidx.compose.ui.window.ComposeUIViewController +import com.komoju.mobile.sdk.navigation.PaymentResultScreenModel +import com.komoju.mobile.sdk.navigation.paymentResultScreenModel +import com.komoju.mobile.sdk.ui.screens.KomojuPaymentEntryPoint +import platform.UIKit.UIViewController + +internal val LocalViewController = compositionLocalOf<() -> UIViewController> { + error("LocalViewController not provided") +} + +fun MainViewController(configuration: KomojuMobileSDKConfiguration, onDismiss: (KomojuMobileSDKPaymentResult) -> Unit) = + extendedComposeViewController(configuration, onDismiss) + +@OptIn(ExperimentalComposeApi::class) +private fun extendedComposeViewController( + configuration: KomojuMobileSDKConfiguration, + onDismiss: (KomojuMobileSDKPaymentResult) -> Unit, +): UIViewController { + var platformResultScreenModel: PaymentResultScreenModel? = null + var localViewController: UIViewController? = null + return ComposeUIViewController( + configure = { + onFocusBehavior = OnFocusBehavior.FocusableAboveKeyboard + opaque = false + delegate = object : ComposeUIViewControllerDelegate { + override fun viewWillDisappear(animated: Boolean) { + super.viewWillDisappear(animated) + onDismiss(platformResultScreenModel?.result ?: KomojuMobileSDKPaymentResult(isSuccessFul = false)) + } + } + }, + content = { + CompositionLocalProvider(LocalViewController provides { localViewController!! }) { + KomojuPaymentEntryPoint( + configuration = configuration, + onCreated = { navigator -> + platformResultScreenModel = navigator.paymentResultScreenModel() + }, + ) + } + }, + ).also { + localViewController = it + } +} diff --git a/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/navigation/PlatformBackPress.ios.kt b/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/navigation/PlatformBackPress.ios.kt new file mode 100644 index 0000000..e50a74a --- /dev/null +++ b/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/navigation/PlatformBackPress.ios.kt @@ -0,0 +1,29 @@ +package com.komoju.mobile.sdk.navigation + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember +import androidx.compose.ui.interop.LocalUIViewController +import platform.UIKit.UIViewController + +@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") +internal actual class PlatformBackPressDispatcher { + private var uiViewController: UIViewController? = null + + @Composable + fun Create() { + uiViewController = LocalUIViewController.current + } + + actual fun onBackPressed() { + uiViewController?.dismissViewControllerAnimated(true) { + // Nothing to do here + } + } +} + +@Composable +internal actual fun rememberPlatformBackPressDispatcher(): PlatformBackPressDispatcher = remember { + PlatformBackPressDispatcher() +}.apply { + Create() +} diff --git a/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/ui/composables/ExternalScreenLauncherResult.ios.kt b/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/ui/composables/ExternalScreenLauncherResult.ios.kt new file mode 100644 index 0000000..76f0a7b --- /dev/null +++ b/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/ui/composables/ExternalScreenLauncherResult.ios.kt @@ -0,0 +1,8 @@ +package com.komoju.mobile.sdk.ui.composables + +@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") +actual class Launcher { + actual fun launch(input: I) { + error("IOS Launcher is not implemented") + } +} diff --git a/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/ui/composables/RememberLauncherForActivityResult.ios.kt b/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/ui/composables/RememberLauncherForActivityResult.ios.kt new file mode 100644 index 0000000..2f31215 --- /dev/null +++ b/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/ui/composables/RememberLauncherForActivityResult.ios.kt @@ -0,0 +1,6 @@ +package com.komoju.mobile.sdk.ui.composables + +import androidx.compose.runtime.Composable + +@Composable +actual fun launchCustomTab(onResult: (Int) -> Unit): Launcher = Launcher() diff --git a/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/ui/screens/KomojuPaymentEntryPoint.ios.kt b/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/ui/screens/KomojuPaymentEntryPoint.ios.kt new file mode 100644 index 0000000..7598c53 --- /dev/null +++ b/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/ui/screens/KomojuPaymentEntryPoint.ios.kt @@ -0,0 +1,3 @@ +package com.komoju.mobile.sdk.ui.screens + +internal actual const val MAX_HEIGHT_FRACTION: Float = 1f diff --git a/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/utils/ModifierExt.ios.kt b/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/utils/ModifierExt.ios.kt new file mode 100644 index 0000000..3c3a625 --- /dev/null +++ b/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/utils/ModifierExt.ios.kt @@ -0,0 +1,8 @@ +package com.komoju.mobile.sdk.utils + +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.semantics.semantics + +internal actual fun Modifier.testID(id: String) = semantics { +}.testTag(id) diff --git a/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/utils/Platform.ios.kt b/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/utils/Platform.ios.kt new file mode 100644 index 0000000..d3ed78b --- /dev/null +++ b/shared/src/iosMain/kotlin/com/komoju/mobile/sdk/utils/Platform.ios.kt @@ -0,0 +1,3 @@ +package com.komoju.mobile.sdk.utils + +actual val currentPlatform: Platform = Platform.IOS