diff --git a/petcare-sample/b2c/mobile-app/petcare-with-sdk/README.md b/petcare-sample/b2c/mobile-app/petcare-with-sdk/README.md index 1c2b57002..04f00209e 100644 --- a/petcare-sample/b2c/mobile-app/petcare-with-sdk/README.md +++ b/petcare-sample/b2c/mobile-app/petcare-with-sdk/README.md @@ -250,3 +250,5 @@ The application you created requires 2 properties to perform android attestation ![Screenshot_20240411_223521](https://github.com/wso2/samples-is/assets/46097917/34bd711c-aa69-418a-a5a9-6e517d15ba1a) ![Screenshot_20240411_223607](https://github.com/wso2/samples-is/assets/46097917/6c6a6d25-4be3-454b-930d-9fd4332c1e4c) +###### Credits +- Images used in the application are taken from [Freepik](https://www.freepik.com/), [Unsplash](https://unsplash.com/), and [Flaticon](https://www.flaticon.com/). diff --git a/petcare-sample/b2c/mobile-app/petcare-with-sdk/app/build.gradle.kts b/petcare-sample/b2c/mobile-app/petcare-with-sdk/app/build.gradle.kts index ab216a568..c265e493e 100644 --- a/petcare-sample/b2c/mobile-app/petcare-with-sdk/app/build.gradle.kts +++ b/petcare-sample/b2c/mobile-app/petcare-with-sdk/app/build.gradle.kts @@ -32,8 +32,8 @@ android { applicationId = "com.wso2_sample.api_auth_sample" minSdk = 26 targetSdk = 34 - versionCode = 1 - versionName = "1.0" + versionCode = 17 + versionName = "0.0.17" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" diff --git a/petcare-sample/b2c/mobile-app/petcare-with-sdk/app/src/main/java/com/wso2_sample/api_auth_sample/features/home/presentation/screens/add_pet/AddPetScreenViewModel.kt b/petcare-sample/b2c/mobile-app/petcare-with-sdk/app/src/main/java/com/wso2_sample/api_auth_sample/features/home/presentation/screens/add_pet/AddPetScreenViewModel.kt index 6f0ce0be1..2b92c200b 100644 --- a/petcare-sample/b2c/mobile-app/petcare-with-sdk/app/src/main/java/com/wso2_sample/api_auth_sample/features/home/presentation/screens/add_pet/AddPetScreenViewModel.kt +++ b/petcare-sample/b2c/mobile-app/petcare-with-sdk/app/src/main/java/com/wso2_sample/api_auth_sample/features/home/presentation/screens/add_pet/AddPetScreenViewModel.kt @@ -87,6 +87,7 @@ class AddPetScreenViewModel @Inject constructor( _state.update { it.copy(isLoading = false) } + navigateToHome() }.onFailure { e -> _state.update { it.copy(error = e.message!!, isLoading = false) @@ -94,7 +95,6 @@ class AddPetScreenViewModel @Inject constructor( } } } - } } } diff --git a/petcare-sample/b2c/mobile-app/petcare-with-sdk/app/src/main/java/com/wso2_sample/api_auth_sample/features/home/presentation/screens/profile/ProfileScreen.kt b/petcare-sample/b2c/mobile-app/petcare-with-sdk/app/src/main/java/com/wso2_sample/api_auth_sample/features/home/presentation/screens/profile/ProfileScreen.kt index fbcf009c9..dd7f027c7 100644 --- a/petcare-sample/b2c/mobile-app/petcare-with-sdk/app/src/main/java/com/wso2_sample/api_auth_sample/features/home/presentation/screens/profile/ProfileScreen.kt +++ b/petcare-sample/b2c/mobile-app/petcare-with-sdk/app/src/main/java/com/wso2_sample/api_auth_sample/features/home/presentation/screens/profile/ProfileScreen.kt @@ -94,10 +94,12 @@ fun ProfileScreenContent( verticalArrangement = Arrangement.spacedBy(8.dp) ) { ProfileImage(imageUrl = state.user?.imageUrl ?: "") - NameSection( - firstName = state.user?.firstName, - lastName = state.user?.lastName - ) + if (state.user?.firstName != null || state.user?.lastName != null) { + NameSection( + firstName = state.user.firstName, + lastName = state.user.lastName + ) + } } Spacer(modifier = Modifier.height(32.dp)) Column( diff --git a/petcare-sample/b2c/mobile-app/petcare-with-sdk/app/src/main/java/com/wso2_sample/api_auth_sample/features/home/presentation/util/pets_list/PetsList.kt b/petcare-sample/b2c/mobile-app/petcare-with-sdk/app/src/main/java/com/wso2_sample/api_auth_sample/features/home/presentation/util/pets_list/PetsList.kt index 59fae8ce2..6aa6f0a84 100644 --- a/petcare-sample/b2c/mobile-app/petcare-with-sdk/app/src/main/java/com/wso2_sample/api_auth_sample/features/home/presentation/util/pets_list/PetsList.kt +++ b/petcare-sample/b2c/mobile-app/petcare-with-sdk/app/src/main/java/com/wso2_sample/api_auth_sample/features/home/presentation/util/pets_list/PetsList.kt @@ -25,7 +25,9 @@ import androidx.compose.foundation.layout.padding import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text 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.unit.dp import com.wso2_sample.api_auth_sample.features.home.domain.models.pet.Pet @@ -42,9 +44,20 @@ fun PetsList(pets: List) { Column( modifier = Modifier .padding(top = 16.dp) - .fillMaxWidth(), - verticalArrangement = Arrangement.spacedBy(16.dp) + .fillMaxWidth() + .align(Alignment.CenterHorizontally), + verticalArrangement = Arrangement.spacedBy(16.dp), ) { + + if (pets.isEmpty()) { + Text( + text = "You don't have any pets yet", + style = MaterialTheme.typography.bodyMedium, + color = MaterialTheme.colorScheme.tertiaryContainer, + textAlign = TextAlign.Center + ) + } + pets.forEach { pet -> PetCard(pet = pet) } diff --git a/petcare-sample/b2c/mobile-app/petcare-with-sdk/origin_finder.py b/petcare-sample/b2c/mobile-app/petcare-with-sdk/origin_finder.py new file mode 100644 index 000000000..a574dc082 --- /dev/null +++ b/petcare-sample/b2c/mobile-app/petcare-with-sdk/origin_finder.py @@ -0,0 +1,25 @@ +# ------------------------------------------------------------------------------------- +# +# Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). +# +# WSO2 LLC. licenses this file to you under the Apache License, +# Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# -------------------------------------------------------------------------------------- + +import binascii +import base64 +fingerprint = + +print("android:apk-key-hash:" + base64.urlsafe_b64encode(binascii.a2b_hex(fingerprint.replace(':', ''))).decode('utf8').replace('=', ''))