Skip to content

Commit

Permalink
TIQR-477: Handle PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dzolnai committed Nov 6, 2024
1 parent 4fad8c9 commit c710ac9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 21 deletions.
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ dependencies {
implementation(libs.kotlin.stdlib)
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.android)
implementation(libs.kotlinx.collections.immutable)
implementation(libs.androidx.core)

implementation(libs.androidx.activity)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
package nl.eduid.screens.selectyourbank

import android.widget.Space
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.compose.foundation.Image
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.calculateEndPadding
import androidx.compose.foundation.layout.calculateStartPadding
import androidx.compose.foundation.layout.fillMaxHeight
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.foundation.layout.safeContentPadding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.systemBarsPadding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
Expand All @@ -51,7 +43,6 @@ import androidx.compose.ui.text.withLink
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
import coil.compose.rememberAsyncImagePainter
import nl.eduid.ErrorData
import nl.eduid.R
import nl.eduid.di.model.VerifyIssuer
Expand All @@ -61,7 +52,6 @@ import nl.eduid.ui.EduIdTopAppBar
import nl.eduid.ui.SvgImage
import nl.eduid.ui.annotatedStringWithBoldParts
import nl.eduid.ui.theme.AlertWarningBackground
import nl.eduid.ui.theme.BlueButton
import nl.eduid.ui.theme.ColorMain_Green_400
import nl.eduid.ui.theme.ColorSupport_Blue_400
import nl.eduid.ui.theme.EduidAppAndroidTheme
Expand All @@ -76,10 +66,6 @@ fun SelectYourBankScreen(
// TODO: handle result
})


LaunchedEffect(viewModel) {
viewModel.fetchIssuerList()
}
LaunchedEffect(viewModel.uiState.launchIntent) {
viewModel.uiState.launchIntent?.let {
launcher.launch(it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import androidx.compose.runtime.setValue
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.delay
import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.launch
import nl.eduid.ErrorData
import nl.eduid.R
Expand All @@ -27,13 +27,13 @@ class SelectYourBankViewModel @Inject constructor(

var uiState: UiState by mutableStateOf(UiState())

fun fetchIssuerList() {
init {
viewModelScope.launch {
try {
val issuers = repository.getVerifyIssuers()
uiState = uiState.copy(
isLoading = false,
verifyIssuerList = issuers!!
verifyIssuerList = issuers!!.toImmutableList()
)
} catch (ex: Exception) {
uiState = uiState.copy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ fun VerifyIdentityScreen(
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(it))
launcher.launch(intent)
},
expandMoreOptions = {
viewModel.expandMoreOptions()
},
expandMoreOptions = viewModel::expandMoreOptions,
padding = padding
)
}
Expand Down Expand Up @@ -218,7 +216,7 @@ fun VerifyIdentityScreenContent(
} else {
Spacer(Modifier.height(20.dp))
OutlinedButton(
onClick = { expandMoreOptions() },
onClick = expandMoreOptions,
shape = RoundedCornerShape(6.dp),
border = BorderStroke(width = 1.dp, color =ColorScale_Gray_400),
modifier = Modifier
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ retrofit = "2.11.0"
moshi = "1.15.1"
rebugger = "1.0.0-rc02"
kotlinx-serialization = "1.6.3"
kotlinx-immutable-collections = "0.3.8"
coil = "2.7.0"

[libraries]
Expand All @@ -32,6 +33,7 @@ kotlinx-coroutines-android = { module = "org.jetbrains.kotlinx:kotlinx-coroutine
kotlinx-coroutines-playServices = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-play-services", version.ref = "coroutines" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
kotlinx-collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable-jvm", version.ref = "kotlinx-immutable-collections" }

dagger-hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" }
dagger-hilt-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt" }
Expand Down

0 comments on commit c710ac9

Please sign in to comment.