Skip to content

Commit

Permalink
Merge pull request #471 from Achintha444/master
Browse files Browse the repository at this point in the history
[chore] added attribution
  • Loading branch information
Achintha Isuru authored May 6, 2024
2 parents 79fdba7 + 0e99416 commit a260208
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 9 deletions.
2 changes: 2 additions & 0 deletions petcare-sample/b2c/mobile-app/petcare-with-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ class AddPetScreenViewModel @Inject constructor(
_state.update {
it.copy(isLoading = false)
}
navigateToHome()
}.onFailure { e ->
_state.update {
it.copy(error = e.message!!, isLoading = false)
}
}
}
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -42,9 +44,20 @@ fun PetsList(pets: List<Pet>) {
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)
}
Expand Down
25 changes: 25 additions & 0 deletions petcare-sample/b2c/mobile-app/petcare-with-sdk/origin_finder.py
Original file line number Diff line number Diff line change
@@ -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 = <ADD_YOUR_SHA256_FINGERPRINT>

print("android:apk-key-hash:" + base64.urlsafe_b64encode(binascii.a2b_hex(fingerprint.replace(':', ''))).decode('utf8').replace('=', ''))

0 comments on commit a260208

Please sign in to comment.