Skip to content

Commit

Permalink
update demo app
Browse files Browse the repository at this point in the history
  • Loading branch information
saperi22 committed May 21, 2024
1 parent f8928ce commit 9165dfb
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Demo/src/main/java/com/paypal/android/ui/DemoApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import com.paypal.android.ui.approveorder.ApproveOrderViewModel
import com.paypal.android.ui.features.FeaturesView
import com.paypal.android.ui.paypalbuttons.PayPalButtonsView
import com.paypal.android.ui.paypalnative.PayPalNativeView
import com.paypal.android.ui.paypalstaticbuttons.PayPalStaticButtonsView
import com.paypal.android.ui.paypalweb.PayPalWebView
import com.paypal.android.ui.paypalwebvault.PayPalWebVaultView
import com.paypal.android.ui.selectcard.SelectCardView
Expand Down Expand Up @@ -115,6 +116,9 @@ fun DemoApp() {
composable(DemoAppDestinations.PAYPAL_BUTTONS) {
PayPalButtonsView()
}
composable(DemoAppDestinations.PAYPAL_STATIC_BUTTONS) {
PayPalStaticButtonsView()
}
composable(DemoAppDestinations.PAYPAL_NATIVE) {
PayPalNativeView()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ object DemoAppDestinations {
const val PAYPAL_WEB = "paypal_web"
const val PAYPAL_WEB_VAULT = "paypal_web_vault"
const val PAYPAL_BUTTONS = "paypal_buttons"
const val PAYPAL_STATIC_BUTTONS = "paypal_static_buttons"
const val PAYPAL_NATIVE = "paypal_native"
const val SELECT_TEST_CARD = "select_test_card"

Expand All @@ -16,6 +17,7 @@ object DemoAppDestinations {
CARD_VAULT -> "Vault Card"
PAYPAL_WEB -> "PayPal Web"
PAYPAL_BUTTONS -> "PayPal Buttons"
PAYPAL_STATIC_BUTTONS -> "PayPal Static Buttons"
PAYPAL_NATIVE -> "PayPal Native"
SELECT_TEST_CARD -> "Select a Test Card"
PAYPAL_WEB_VAULT -> "PayPal Web Vault"
Expand Down
4 changes: 4 additions & 0 deletions Demo/src/main/java/com/paypal/android/ui/features/Feature.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ enum class Feature(@StringRes val stringRes: Int, val routeName: String) {
PAYPAL_WEB(R.string.feature_paypal_web, DemoAppDestinations.PAYPAL_WEB),
PAYPAL_WEB_VAULT(R.string.feature_paypal_web_vault, DemoAppDestinations.PAYPAL_WEB_VAULT),
PAYPAL_BUTTONS(R.string.feature_paypal_buttons, DemoAppDestinations.PAYPAL_BUTTONS),
PAYPAL_STATIC_BUTTONS(
R.string.feature_paypal_static_buttons,
DemoAppDestinations.PAYPAL_STATIC_BUTTONS
),
PAYPAL_NATIVE(R.string.feature_paypal_native, DemoAppDestinations.PAYPAL_NATIVE)
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ private val cardFeatures = listOf(
private val payPalWebFeatures = listOf(
Feature.PAYPAL_WEB,
Feature.PAYPAL_BUTTONS,
Feature.PAYPAL_STATIC_BUTTONS,
Feature.PAYPAL_WEB_VAULT
)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.paypal.android.ui.paypalstaticbuttons

import android.view.LayoutInflater
import androidx.compose.runtime.Composable
import androidx.compose.ui.viewinterop.AndroidView
import com.paypal.android.R

@Composable
fun PayPalStaticButtonsView() {
AndroidView(
factory = { context ->
val view = LayoutInflater.from(context)
.inflate(R.layout.pay_later_button_test_layout, null, false)

view
}
)
}
1 change: 1 addition & 0 deletions Demo/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<string name="feature_paypal_web_vault">PayPal Web Vault</string>
<string name="feature_paypal_native">PayPal Native</string>
<string name="feature_paypal_buttons">PayPal Buttons</string>
<string name="feature_paypal_static_buttons">PayPal Buttons - XML</string>

<!-- Card Fields -->
<string name="card_field_card_number">CARD NUMBER</string>
Expand Down

0 comments on commit 9165dfb

Please sign in to comment.