Skip to content

Commit

Permalink
Merge pull request #28 from maik-mursall/more-fixes
Browse files Browse the repository at this point in the history
More fixes
  • Loading branch information
FriedrichSchlee authored Jun 10, 2024
2 parents 069f872 + 335278d commit ef3ea8e
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 40 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
kotlin_version = '1.8.10'
compose_version = '1.6.7'
kotlin_version = '1.9.23'
compose_version = '1.6.6'
}
repositories {
google()
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
GROUP=com.fintecsystems
VERSION_NAME=5.2.2
VERSION_NAME=5.2.3
POM_URL=https://github.com/FinTecSystems/xs2a-android
POM_SCM_URL=[email protected]:FinTecSystems/xs2a-android.git
POM_SCM_CONNECTION=scm:git:[email protected]:FinTecSystems/xs2a-android.git
Expand Down
7 changes: 4 additions & 3 deletions xs2awizard/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.8.10'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.9.23'
id 'maven-publish'
id 'signing'
id 'kotlin-parcelize'
Expand Down Expand Up @@ -41,7 +41,7 @@ android {
jvmTarget = '11'
}
composeOptions {
kotlinCompilerExtensionVersion '1.4.3'
kotlinCompilerExtensionVersion '1.5.11'
}
}

Expand All @@ -56,6 +56,7 @@ dependencies {
implementation "androidx.compose.ui:ui-tooling:$compose_version"
// Integration with ViewModels
implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.8.1'
implementation 'androidx.fragment:fragment-ktx:1.7.1'
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
// Security & EncryptedSharedPreferences
implementation("androidx.security:security-crypto:1.1.0-alpha06")
Expand All @@ -66,7 +67,7 @@ dependencies {

implementation "androidx.browser:browser:1.8.0"

implementation "com.fintecsystems:xs2awizard_networking:1.2.0"
implementation "com.fintecsystems:xs2awizard_networking:1.2.2"
}

publishing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,27 @@ import android.view.View
import android.view.ViewGroup
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Typography
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.ViewCompositionStrategy
import androidx.compose.ui.text.font.Font
import androidx.compose.ui.text.font.FontFamily
import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelStoreOwner
import androidx.lifecycle.viewmodel.compose.LocalViewModelStoreOwner
import androidx.fragment.app.activityViewModels
import com.fintecsystems.xs2awizard.XS2AWizard
import com.fintecsystems.xs2awizard.components.*
import com.fintecsystems.xs2awizard.components.XS2AWizardBundleKeys
import com.fintecsystems.xs2awizard.components.XS2AWizardCallbackListener
import com.fintecsystems.xs2awizard.components.XS2AWizardError
import com.fintecsystems.xs2awizard.components.XS2AWizardLanguage
import com.fintecsystems.xs2awizard.components.XS2AWizardStep
import com.fintecsystems.xs2awizard.components.XS2AWizardViewModel
import com.fintecsystems.xs2awizard.components.theme.XS2ATheme

/**
* Wrapper for the XS2A-Wizard Compose Component
*/
class XS2AWizardFragment() : Fragment(), XS2AWizardCallbackListener {
private val xS2AWizardViewModel: XS2AWizardViewModel by activityViewModels()

/**
* Renders the XS2A-Wizard.
*
Expand Down Expand Up @@ -82,40 +87,37 @@ class XS2AWizardFragment() : Fragment(), XS2AWizardCallbackListener {
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed)

setContent {
CompositionLocalProvider(
LocalViewModelStoreOwner provides (activity as ViewModelStoreOwner)
) {
val arguments = requireArguments()

assert(arguments.containsKey("sessionKey"))

val typography = if (arguments.containsKey(XS2AWizardBundleKeys.fontResId))
Typography(
defaultFontFamily = FontFamily(
Font(
arguments.getInt(
XS2AWizardBundleKeys.fontResId
)
val arguments = requireArguments()

assert(arguments.containsKey("sessionKey"))

val typography = if (arguments.containsKey(XS2AWizardBundleKeys.fontResId))
Typography(
defaultFontFamily = FontFamily(
Font(
arguments.getInt(
XS2AWizardBundleKeys.fontResId
)
)
)
else
MaterialTheme.typography


XS2AWizard(
sessionKey = arguments.getString(XS2AWizardBundleKeys.sessionKey)!!,
backendURL = arguments.getString(XS2AWizardBundleKeys.backendURL),
theme = arguments.getParcelable(XS2AWizardBundleKeys.theme),
typography = typography,
language = arguments.getSerializable(XS2AWizardBundleKeys.language) as? XS2AWizardLanguage,
enableScroll = arguments.getBoolean(XS2AWizardBundleKeys.enableScroll),
enableBackButton = arguments.getBoolean(XS2AWizardBundleKeys.enableBackButton),
enableAutomaticRetry = arguments.getBoolean(XS2AWizardBundleKeys.enableAutomaticRetry),
callbackListener = this@XS2AWizardFragment,
redirectDeepLink = arguments.getString(XS2AWizardBundleKeys.redirectDeepLink)
)
}
else
MaterialTheme.typography


XS2AWizard(
sessionKey = arguments.getString(XS2AWizardBundleKeys.sessionKey)!!,
backendURL = arguments.getString(XS2AWizardBundleKeys.backendURL),
theme = arguments.getParcelable(XS2AWizardBundleKeys.theme),
typography = typography,
language = arguments.getSerializable(XS2AWizardBundleKeys.language) as? XS2AWizardLanguage,
enableScroll = arguments.getBoolean(XS2AWizardBundleKeys.enableScroll),
enableBackButton = arguments.getBoolean(XS2AWizardBundleKeys.enableBackButton),
enableAutomaticRetry = arguments.getBoolean(XS2AWizardBundleKeys.enableAutomaticRetry),
callbackListener = this@XS2AWizardFragment,
redirectDeepLink = arguments.getString(XS2AWizardBundleKeys.redirectDeepLink),
xs2aWizardViewModel = xS2AWizardViewModel
)
}
}
}
Expand Down

0 comments on commit ef3ea8e

Please sign in to comment.