Skip to content

Commit f3552dc

Browse files
authored
Merge pull request #264 from niscy-eudiw/feature/new_design_system
New UI/UX, Application Rework
2 parents 3ca1cfa + cd14dbf commit f3552dc

File tree

211 files changed

+15024
-8394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+15024
-8394
lines changed

Gemfile.lock

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ GEM
3232
colored2 (3.1.2)
3333
commander (4.6.0)
3434
highline (~> 2.0.0)
35+
csv (3.3.2)
3536
declarative (0.0.20)
3637
digest-crc (0.6.5)
3738
rake (>= 12.0.0, < 14.0.0)
@@ -110,7 +111,8 @@ GEM
110111
xcodeproj (>= 1.13.0, < 2.0.0)
111112
xcpretty (~> 0.4.0)
112113
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
113-
fastlane-plugin-appcenter (2.1.2)
114+
fastlane-plugin-appcenter (2.1.3)
115+
csv
114116
fastlane-plugin-increment_version_code (0.4.3)
115117
fastlane-plugin-properties (1.1.2)
116118
java-properties

build-logic/convention/src/main/kotlin/project/convention/logic/AndroidCompose.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ internal fun Project.configureAndroidCompose(
4141

4242
add("implementation", libs.findLibrary("coil.kt").get())
4343
add("implementation", libs.findLibrary("coil.kt.compose").get())
44+
add("implementation", libs.findLibrary("coil.kt.svg").get())
4445

4546
add("implementation", libs.findLibrary("androidx-navigation-compose").get())
4647

business-logic/src/main/java/eu/europa/ec/businesslogic/extension/StringExtensions.kt

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,29 @@ fun String.splitToLines(lineLength: Int): String {
8585
}
8686
}
8787

88-
fun String.firstPart(separator: String): String = this.split(separator).firstOrNull() ?: this
88+
fun String.firstPart(separator: String): String = this.split(separator).firstOrNull() ?: this
89+
90+
/**
91+
* Returns the current string if it is not `null`, empty, or blank.
92+
* Otherwise, returns the specified default string.
93+
*
94+
* This function checks both nullability and blankness, meaning
95+
* it treats strings containing only whitespace as invalid.
96+
*
97+
* @param default The string to return if the current string is `null`, empty, or blank.
98+
* @return The current string if it is not `null`, empty, or blank; otherwise, the default string.
99+
*
100+
* Example usage:
101+
* ```
102+
* val str1: String? = null
103+
* val str2: String? = " "
104+
* val str3: String? = "Hello, Kotlin!"
105+
*
106+
* println(str1.ifEmptyOrNull("Default")) // Output: Default
107+
* println(str2.ifEmptyOrNull("Default")) // Output: Default
108+
* println(str3.ifEmptyOrNull("Default")) // Output: Hello, Kotlin!
109+
* ```
110+
*/
111+
fun String?.ifEmptyOrNull(default: String): String {
112+
return if (this.isNullOrBlank()) default else this
113+
}

business-logic/src/main/java/eu/europa/ec/businesslogic/util/DateHelper.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ package eu.europa.ec.businesslogic.util
1818

1919
import java.text.DateFormat
2020
import java.text.SimpleDateFormat
21+
import java.time.Instant
2122
import java.time.LocalDate
23+
import java.time.ZoneId
2224
import java.time.format.DateTimeFormatter
2325
import java.util.Date
2426
import java.util.Locale
@@ -33,7 +35,7 @@ private val dtoDateFormatters = listOf(
3335

3436
fun String.toDateFormatted(
3537
selectedLanguage: String = LocaleUtils.DEFAULT_LOCALE,
36-
dateFormatStyle: Int = DateFormat.MEDIUM
38+
dateFormatStyle: Int = DateFormat.MEDIUM,
3739
): String? {
3840
var formattedDate: Date? = null
3941
val dateFormat = SimpleDateFormat.getDateInstance(
@@ -71,4 +73,13 @@ fun String.toLocalDate(
7173
}
7274

7375
return result
76+
}
77+
78+
fun Instant.formatInstant(
79+
zoneId: ZoneId = ZoneId.systemDefault(),
80+
locale: Locale = Locale.ENGLISH
81+
): String {
82+
val formatter = DateTimeFormatter.ofPattern("dd MMM yyyy", locale)
83+
.withZone(zoneId)
84+
return formatter.format(this)
7485
}

common-feature/src/main/java/eu/europa/ec/commonfeature/config/BiometricUiConfig.kt

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,22 @@ import eu.europa.ec.uilogic.serializer.UiSerializable
2424
import eu.europa.ec.uilogic.serializer.UiSerializableParser
2525
import eu.europa.ec.uilogic.serializer.adapter.SerializableTypeAdapter
2626

27+
sealed interface BiometricMode {
28+
data class Default(
29+
val descriptionWhenBiometricsEnabled: String,
30+
val descriptionWhenBiometricsNotEnabled: String,
31+
val textAbovePin: String,
32+
) : BiometricMode
33+
34+
data class Login(
35+
val title: String,
36+
val subTitleWhenBiometricsEnabled: String,
37+
val subTitleWhenBiometricsNotEnabled: String,
38+
) : BiometricMode
39+
}
40+
2741
data class BiometricUiConfig(
28-
val title: String,
29-
val subTitle: String,
30-
val quickPinOnlySubTitle: String,
42+
val mode: BiometricMode,
3143
val isPreAuthorization: Boolean = false,
3244
val shouldInitializeBiometricAuthOnCreate: Boolean = true,
3345
val onSuccessNavigation: ConfigNavigation,
@@ -37,17 +49,23 @@ data class BiometricUiConfig(
3749
companion object Parser : UiSerializableParser {
3850
override val serializedKeyName = "biometricConfig"
3951
override fun provideParser(): Gson {
40-
return GsonBuilder().registerTypeAdapter(
41-
NavigationType::class.java,
42-
SerializableTypeAdapter<NavigationType>()
43-
).create()
52+
return GsonBuilder()
53+
.registerTypeAdapter(
54+
NavigationType::class.java,
55+
SerializableTypeAdapter<NavigationType>()
56+
)
57+
.registerTypeAdapter(
58+
BiometricMode::class.java,
59+
SerializableTypeAdapter<BiometricMode>()
60+
)
61+
.create()
4462
}
4563
}
4664
}
4765

4866
data class OnBackNavigationConfig(
4967
val onBackNavigation: ConfigNavigation?,
50-
private val hasToolbarCancelIcon: Boolean
68+
private val hasToolbarBackIcon: Boolean
5169
) {
52-
val isCancellable: Boolean get() = hasToolbarCancelIcon && onBackNavigation != null
70+
val isBackable: Boolean get() = hasToolbarBackIcon && onBackNavigation != null
5371
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (c) 2023 European Commission
3+
*
4+
* Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European
5+
* Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work
6+
* except in compliance with the Licence.
7+
*
8+
* You may obtain a copy of the Licence at:
9+
* https://joinup.ec.europa.eu/software/page/eupl
10+
*
11+
* Unless required by applicable law or agreed to in writing, software distributed under
12+
* the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF
13+
* ANY KIND, either express or implied. See the Licence for the specific language
14+
* governing permissions and limitations under the Licence.
15+
*/
16+
17+
package eu.europa.ec.commonfeature.config
18+
19+
import com.google.gson.Gson
20+
import com.google.gson.GsonBuilder
21+
import eu.europa.ec.eudi.wallet.document.DocumentId
22+
import eu.europa.ec.uilogic.config.ConfigNavigation
23+
import eu.europa.ec.uilogic.config.NavigationType
24+
import eu.europa.ec.uilogic.serializer.UiSerializable
25+
import eu.europa.ec.uilogic.serializer.UiSerializableParser
26+
import eu.europa.ec.uilogic.serializer.adapter.SerializableTypeAdapter
27+
28+
data class IssuanceSuccessUiConfig(
29+
val documentIds: List<DocumentId>,
30+
val onSuccessNavigation: ConfigNavigation,
31+
) : UiSerializable {
32+
33+
companion object Parser : UiSerializableParser {
34+
override val serializedKeyName = "issuanceSuccessConfig"
35+
override fun provideParser(): Gson {
36+
return GsonBuilder()
37+
.registerTypeAdapter(
38+
NavigationType::class.java,
39+
SerializableTypeAdapter<NavigationType>()
40+
).create()
41+
}
42+
}
43+
}

common-feature/src/main/java/eu/europa/ec/commonfeature/config/OfferCodeUiConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ data class OfferCodeUiConfig(
3232
) : UiSerializable {
3333

3434
companion object Parser : UiSerializableParser {
35-
override val serializedKeyName = "offerCodeUiConfig"
35+
override val serializedKeyName = "offerCodeConfig"
3636
override fun provideParser(): Gson {
3737
return GsonBuilder().registerTypeAdapter(
3838
NavigationType::class.java,

common-feature/src/main/java/eu/europa/ec/commonfeature/config/SuccessUIConfig.kt

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,39 @@
1616

1717
package eu.europa.ec.commonfeature.config
1818

19-
import androidx.annotation.DrawableRes
2019
import androidx.compose.ui.graphics.Color
2120
import com.google.gson.Gson
2221
import com.google.gson.GsonBuilder
2322
import eu.europa.ec.resourceslogic.theme.values.ThemeColors
23+
import eu.europa.ec.uilogic.component.AppIconAndTextData
24+
import eu.europa.ec.uilogic.component.IconData
25+
import eu.europa.ec.uilogic.component.content.ContentHeaderConfig
26+
import eu.europa.ec.uilogic.component.utils.PERCENTAGE_60
2427
import eu.europa.ec.uilogic.config.ConfigNavigation
2528
import eu.europa.ec.uilogic.config.NavigationType
2629
import eu.europa.ec.uilogic.serializer.UiSerializable
2730
import eu.europa.ec.uilogic.serializer.UiSerializableParser
2831
import eu.europa.ec.uilogic.serializer.adapter.SerializableTypeAdapter
2932

3033
data class SuccessUIConfig(
31-
val headerConfig: HeaderConfig?,
32-
val content: String,
34+
val textElementsConfig: TextElementsConfig,
35+
val headerConfig: ContentHeaderConfig = ContentHeaderConfig(
36+
appIconAndTextData = AppIconAndTextData(),
37+
description = null,
38+
),
3339
val imageConfig: ImageConfig,
3440
val buttonConfig: List<ButtonConfig>,
3541
val onBackScreenToNavigate: ConfigNavigation
3642
) : UiSerializable {
3743

3844
data class ImageConfig(
39-
val type: Type,
40-
@DrawableRes val drawableRes: Int? = null,
41-
val tint: Color = ThemeColors.success,
42-
val contentDescription: String? = null
45+
val type: Type = Type.Default,
46+
val tint: Color? = ThemeColors.success,
47+
val screenPercentageSize: Float = PERCENTAGE_60,
4348
) {
44-
enum class Type {
45-
DRAWABLE, DEFAULT
49+
sealed class Type {
50+
data object Default : Type()
51+
data class Drawable(val icon: IconData) : Type()
4652
}
4753
}
4854

@@ -56,18 +62,25 @@ data class SuccessUIConfig(
5662
}
5763
}
5864

59-
data class HeaderConfig(
60-
val title: String,
65+
data class TextElementsConfig(
66+
val text: String,
67+
val description: String,
6168
val color: Color = ThemeColors.success
6269
)
6370

6471
companion object Parser : UiSerializableParser {
6572
override val serializedKeyName = "successConfig"
6673
override fun provideParser(): Gson {
67-
return GsonBuilder().registerTypeAdapter(
68-
NavigationType::class.java,
69-
SerializableTypeAdapter<NavigationType>()
70-
).create()
74+
return GsonBuilder()
75+
.registerTypeAdapter(
76+
NavigationType::class.java,
77+
SerializableTypeAdapter<NavigationType>()
78+
)
79+
.registerTypeAdapter(
80+
ImageConfig.Type::class.java,
81+
SerializableTypeAdapter<ImageConfig.Type>()
82+
)
83+
.create()
7184
}
7285
}
7386
}

common-feature/src/main/java/eu/europa/ec/commonfeature/model/AddDocumentUi.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@
1616

1717
package eu.europa.ec.commonfeature.model
1818

19-
import eu.europa.ec.uilogic.component.IconData
19+
import eu.europa.ec.uilogic.component.ListItemData
2020

2121
data class DocumentOptionItemUi(
22-
val configId: String,
23-
val text: String,
24-
val icon: IconData,
25-
val available: Boolean,
22+
val itemData: ListItemData,
2623
)

common-feature/src/main/java/eu/europa/ec/commonfeature/model/DocumentTypeUi.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616

1717
package eu.europa.ec.commonfeature.model
1818

19-
import eu.europa.ec.commonfeature.ui.document_details.model.DocumentDetailsUi
2019
import eu.europa.ec.corelogic.model.DocumentIdentifier
2120
import eu.europa.ec.eudi.wallet.document.DocumentId
21+
import eu.europa.ec.uilogic.component.ListItemData
2222

2323
enum class DocumentUiIssuanceState {
24-
Issued, Pending, Failed
24+
Issued, Pending, Failed, Expired
2525
}
2626

2727
data class DocumentUi(
@@ -31,7 +31,7 @@ data class DocumentUi(
3131
val documentExpirationDateFormatted: String,
3232
val documentHasExpired: Boolean,
3333
val documentImage: String,
34-
val documentDetails: List<DocumentDetailsUi>,
34+
val documentDetails: List<ListItemData>,
3535
val userFullName: String? = null,
3636
val documentId: DocumentId,
3737
)

0 commit comments

Comments
 (0)