-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modifications in SelectionOptionUi model to act as a generic UI option model that can carry an event, using it to define the items for document, qtsp and certificate selection. Equivalent modifications in Success screen, also using now the ContentHeader. Imported WrapImage, WrapText, AppIconAndText, RelyingParty components. LocalizableKey updated with new wordings. Drawables and text resources for content description added. Signed-off-by: Christos Kaitatzis <[email protected]>
- Loading branch information
1 parent
24a6945
commit d4de0ab
Showing
19 changed files
with
911 additions
and
246 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
rqes-ui-sdk/src/main/java/eu/europa/ec/eudi/rqesui/presentation/entities/ButtonActionUi.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (c) 2023 European Commission | ||
* | ||
* Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European | ||
* Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work | ||
* except in compliance with the Licence. | ||
* | ||
* You may obtain a copy of the Licence at: | ||
* https://joinup.ec.europa.eu/software/page/eupl | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under | ||
* the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF | ||
* ANY KIND, either express or implied. See the Licence for the specific language | ||
* governing permissions and limitations under the Licence. | ||
*/ | ||
|
||
package eu.europa.ec.eudi.rqesui.presentation.entities | ||
|
||
import eu.europa.ec.eudi.rqesui.presentation.architecture.ViewEvent | ||
|
||
internal data class ButtonActionUi<T : ViewEvent>( | ||
val buttonText: String, | ||
val event: T | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...ui-sdk/src/main/java/eu/europa/ec/eudi/rqesui/presentation/ui/component/AppIconAndText.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright (c) 2023 European Commission | ||
* | ||
* Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European | ||
* Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work | ||
* except in compliance with the Licence. | ||
* | ||
* You may obtain a copy of the Licence at: | ||
* https://joinup.ec.europa.eu/software/page/eupl | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under | ||
* the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF | ||
* ANY KIND, either express or implied. See the Licence for the specific language | ||
* governing permissions and limitations under the Licence. | ||
*/ | ||
|
||
package eu.europa.ec.eudi.rqesui.presentation.ui.component | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import eu.europa.ec.eudi.rqesui.presentation.ui.component.preview.PreviewTheme | ||
import eu.europa.ec.eudi.rqesui.presentation.ui.component.preview.ThemeModePreviews | ||
import eu.europa.ec.eudi.rqesui.presentation.ui.component.utils.SPACING_SMALL | ||
import eu.europa.ec.eudi.rqesui.presentation.ui.component.wrap.WrapImage | ||
|
||
|
||
internal data class AppIconAndTextData( | ||
val appIcon: IconData = AppIcons.LogoPlain, | ||
val appText: IconData = AppIcons.LogoText, | ||
) | ||
|
||
@Composable | ||
internal fun AppIconAndText( | ||
modifier: Modifier = Modifier, | ||
appIconAndTextData: AppIconAndTextData | ||
) { | ||
Row( | ||
modifier = modifier, | ||
horizontalArrangement = Arrangement.spacedBy( | ||
space = SPACING_SMALL.dp, | ||
alignment = Alignment.CenterHorizontally | ||
), | ||
verticalAlignment = Alignment.Top | ||
) { | ||
WrapImage(iconData = appIconAndTextData.appIcon) | ||
WrapImage(iconData = appIconAndTextData.appText) | ||
} | ||
} | ||
|
||
@ThemeModePreviews | ||
@Composable | ||
private fun AppIconAndTextPreview() { | ||
PreviewTheme { | ||
AppIconAndText( | ||
appIconAndTextData = AppIconAndTextData( | ||
appIcon = AppIcons.LogoPlain, | ||
appText = AppIcons.LogoText, | ||
) | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
rqes-ui-sdk/src/main/java/eu/europa/ec/eudi/rqesui/presentation/ui/component/RelyingParty.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
/* | ||
* Copyright (c) 2023 European Commission | ||
* | ||
* Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European | ||
* Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work | ||
* except in compliance with the Licence. | ||
* | ||
* You may obtain a copy of the Licence at: | ||
* https://joinup.ec.europa.eu/software/page/eupl | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under | ||
* the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF | ||
* ANY KIND, either express or implied. See the Licence for the specific language | ||
* governing permissions and limitations under the Licence. | ||
*/ | ||
|
||
package eu.europa.ec.eudi.rqesui.presentation.ui.component | ||
|
||
import androidx.compose.foundation.layout.Arrangement | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Row | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.size | ||
import androidx.compose.foundation.layout.wrapContentWidth | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.text.style.TextAlign | ||
import androidx.compose.ui.tooling.preview.PreviewParameter | ||
import androidx.compose.ui.unit.dp | ||
import eu.europa.ec.eudi.rqesui.infrastructure.theme.values.success | ||
import eu.europa.ec.eudi.rqesui.presentation.ui.component.preview.PreviewTheme | ||
import eu.europa.ec.eudi.rqesui.presentation.ui.component.preview.TextLengthPreviewProvider | ||
import eu.europa.ec.eudi.rqesui.presentation.ui.component.preview.ThemeModePreviews | ||
import eu.europa.ec.eudi.rqesui.presentation.ui.component.wrap.TextConfig | ||
import eu.europa.ec.eudi.rqesui.presentation.ui.component.wrap.WrapIcon | ||
import eu.europa.ec.eudi.rqesui.presentation.ui.component.wrap.WrapText | ||
|
||
/** | ||
* Data class representing information about a Relying Party. | ||
* | ||
* @property isVerified A boolean indicating whether the Relying Party is verified. | ||
* @property name The name of the Relying Party. | ||
*/ | ||
data class RelyingPartyData( | ||
val isVerified: Boolean, | ||
val name: String, | ||
) | ||
|
||
@Composable | ||
fun RelyingParty( | ||
modifier: Modifier = Modifier, | ||
relyingPartyData: RelyingPartyData, | ||
) { | ||
val commonTextAlign = TextAlign.Center | ||
|
||
Column( | ||
modifier = modifier, | ||
verticalArrangement = Arrangement.Center, | ||
horizontalAlignment = Alignment.CenterHorizontally | ||
) { | ||
with(relyingPartyData) { | ||
Row( | ||
modifier = Modifier.fillMaxWidth(), | ||
horizontalArrangement = Arrangement.Center, | ||
verticalAlignment = Alignment.CenterVertically | ||
) { | ||
if (isVerified) { | ||
WrapIcon( | ||
modifier = Modifier.size(20.dp), | ||
iconData = AppIcons.Verified, | ||
customTint = MaterialTheme.colorScheme.success, | ||
) | ||
} | ||
WrapText( | ||
modifier = Modifier.wrapContentWidth(), | ||
text = name, | ||
textConfig = TextConfig( | ||
style = MaterialTheme.typography.titleMedium, | ||
textAlign = commonTextAlign, | ||
) | ||
) | ||
} | ||
|
||
} | ||
} | ||
} | ||
|
||
@ThemeModePreviews | ||
@Composable | ||
private fun RelyingPartyPreview( | ||
@PreviewParameter(TextLengthPreviewProvider::class) text: String | ||
) { | ||
PreviewTheme { | ||
RelyingParty( | ||
relyingPartyData = RelyingPartyData( | ||
isVerified = true, | ||
name = "Relying Party Name: $text", | ||
) | ||
) | ||
} | ||
} |
Oops, something went wrong.