Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[connect] Update SDK API then Example app as needed #10330

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions connect-example/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
android:name=".App"
Expand All @@ -17,14 +17,5 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".ui.features.accountonboarding.AccountOnboardingExampleActivity"
android:exported="false"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<activity
android:name=".ui.features.payouts.PayoutsExampleActivity"
android:exported="false"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.stripe.android.connect.example

import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.activity.viewModels
import androidx.annotation.CallSuper
import androidx.fragment.app.FragmentActivity
import com.stripe.android.connect.EmbeddedComponentManager
import com.stripe.android.connect.PrivateBetaConnectSDK
import com.stripe.android.connect.example.ui.embeddedcomponentmanagerloader.EmbeddedComponentLoaderViewModel
import com.stripe.android.connect.example.ui.settings.SettingsViewModel
import dagger.hilt.android.AndroidEntryPoint

@OptIn(PrivateBetaConnectSDK::class)
Expand All @@ -15,10 +17,18 @@ abstract class BaseActivity : FragmentActivity() {

protected val loaderViewModel: EmbeddedComponentLoaderViewModel by viewModels()

private val settingsViewModel: SettingsViewModel by viewModels()

@CallSuper
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

val settings = settingsViewModel.state.value
val isEdgeToEdgeEnabled = settings.presentationSettings.enableEdgeToEdge
if (isEdgeToEdgeEnabled) {
enableEdgeToEdge()
}

EmbeddedComponentManager.onActivityCreate(this)
lifecycle.addObserver(loaderViewModel)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class SettingsService @Inject constructor(@ApplicationContext context: Context)
presentationStyleIsPush = !sharedPreferences.getBoolean(PRESENTATION_IS_MODAL, false),
embedInTabBar = sharedPreferences.getBoolean(EMBED_IN_TABBAR, false),
embedInNavBar = !sharedPreferences.getBoolean(DISABLE_EMBED_IN_NAVBAR, false),
useXmlViews = sharedPreferences.getBoolean(USE_XML_VIEWS, false),
enableEdgeToEdge = sharedPreferences.getBoolean(ENABLE_EDGE_TO_EDGE, false)
)
}
Expand All @@ -101,7 +100,6 @@ class SettingsService @Inject constructor(@ApplicationContext context: Context)
putBoolean(PRESENTATION_IS_MODAL, !value.presentationStyleIsPush)
putBoolean(EMBED_IN_TABBAR, value.embedInTabBar)
putBoolean(DISABLE_EMBED_IN_NAVBAR, !value.embedInNavBar)
putBoolean(USE_XML_VIEWS, value.useXmlViews)
putBoolean(ENABLE_EDGE_TO_EDGE, value.enableEdgeToEdge)
}
}
Expand Down Expand Up @@ -146,7 +144,6 @@ class SettingsService @Inject constructor(@ApplicationContext context: Context)
private const val PRESENTATION_IS_MODAL = "PresentationIsModal"
private const val DISABLE_EMBED_IN_NAVBAR = "DisableEmbedInNavbar"
private const val EMBED_IN_TABBAR = "EmbedInTabbar"
private const val USE_XML_VIEWS = "UseXmlViews"
private const val ENABLE_EDGE_TO_EDGE = "EnableEdgeToEdge"
private const val ONBOARDING_TERMS_OF_SERVICE_URL = "OnboardingTermsOfServiceURL"
private const val ONBOARDING_RECIPIENT_TERMS_OF_SERVICE_STRING = "OnboardingRecipientTermsOfServiceString"
Expand Down Expand Up @@ -196,7 +193,6 @@ data class PresentationSettings(
val presentationStyleIsPush: Boolean = false,
val embedInTabBar: Boolean = false,
val embedInNavBar: Boolean = false,
val useXmlViews: Boolean = false,
val enableEdgeToEdge: Boolean = false,
)

Expand Down

This file was deleted.

Loading
Loading