-
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.
Merge pull request #49 from trustedshops-public/develop
Prepare release 0.1.756
- Loading branch information
Showing
109 changed files
with
3,314 additions
and
173 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,4 @@ app/config.json | |
fastlane/report.xml | ||
app-dist-key.json | ||
.scannerwork | ||
docs/.DS_Store |
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
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
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 |
---|---|---|
|
@@ -25,15 +25,76 @@ | |
|
||
package com.etrusted.android.trustbadgeexample.ui.profile | ||
|
||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Alignment | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.tooling.preview.Preview | ||
import com.etrusted.android.trustbadge.library.common.internal.EnvironmentKey | ||
import com.etrusted.android.trustbadge.library.model.CurrencyCode | ||
import com.etrusted.android.trustbadge.library.model.OrderDetails | ||
import com.etrusted.android.trustbadge.library.ui.badge.Trustbadge | ||
import com.etrusted.android.trustbadge.library.ui.badge.TrustbadgeContext | ||
import com.etrusted.android.trustbadge.library.ui.badge.rememberTrustbadgeState | ||
|
||
@Composable | ||
internal fun ProfileScreen() { | ||
Text(text = "Profile Screen") | ||
internal fun ProfileScreen( | ||
env: EnvironmentKey, | ||
) { | ||
|
||
val badgeState = rememberTrustbadgeState() | ||
|
||
Box(modifier = Modifier.fillMaxSize()) { | ||
|
||
Column( | ||
Modifier | ||
.align(Alignment.Center) | ||
) { | ||
Button(onClick = { | ||
badgeState.showAsCard() | ||
}) { | ||
Text(text = "Show Trustcard") | ||
} | ||
} | ||
|
||
when(env) { | ||
EnvironmentKey.DEBUG -> { | ||
Trustbadge( | ||
modifier = Modifier.align(Alignment.BottomStart), | ||
state = badgeState, | ||
badgeContext = TrustbadgeContext.BuyerProtection( | ||
orderDetails = OrderDetails( | ||
number = "123456789", | ||
amount = "129.00", | ||
currency = CurrencyCode.EUR, | ||
paymentType = "PayPal", | ||
estimatedDeliveryDate = "2022-11-30", | ||
buyerEmail = "[email protected]" | ||
), | ||
), | ||
tsid = "X2AB6FF7BFF70A04D1D323E039D676EDB", | ||
channelId = "chl-7e52920a-2722-4881-9908-ecec98c716e4" | ||
) | ||
} | ||
else -> { | ||
Trustbadge( | ||
modifier = Modifier.align(Alignment.BottomStart), | ||
state = badgeState, | ||
badgeContext = TrustbadgeContext.BuyerProtection(), | ||
tsid = "X079198F3BC11FA13F8980EB6879E2677", | ||
channelId = "chl-b38b62ee-1e62-4a9f-9381-0ece0909b038" | ||
) | ||
} | ||
} | ||
} | ||
} | ||
|
||
@Composable | ||
@Preview | ||
internal fun PreviewProfileScreen() { | ||
ProfileScreen() | ||
ProfileScreen(EnvironmentKey.DEBUG) | ||
} |
Oops, something went wrong.