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

Update to compose 1.7.4. #9511

Closed
wants to merge 3 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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
### Basic Integration
* [REMOVED][9501](https://github.com/stripe/stripe-android/pull/9501) Basic Integration has been removed. [Please use Mobile Payment Element instead](https://docs.stripe.com/payments/mobile/migrating-to-mobile-payment-element-from-basic-integration).

Dependencies updated in [9511](https://github.com/stripe/stripe-android/pull/9511):
* Bumped Accompanist from 0.34.0 to 0.36.0.
* Bumped Compose from 1.5.4 to 1.6.8.
* Bumped Androidx Navigation from 2.7.7 to 2.8.3.

## 20.53.0 - 2024-10-21

### PaymentSheet
Expand Down
24 changes: 12 additions & 12 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ pipelines:
stages:
stage-trigger-run-all:
workflows:
- check: { }
# - check: { }
- test: { }
- run-instrumentation-tests: { }
- run-paymentsheet-instrumentation-tests: { }
- run-example-instrumentation-tests: { }
- run-financial-connections-instrumentation-tests: { }
- run-connections-e2e-payments-tests-on-push: { }
- run-connections-e2e-token-tests-on-push: { }
- run-connections-e2e-data-tests-on-push: { }
- run-cardscan-instrumentation-tests: { }
- run-paymentsheet-end-to-end-tests: { }
- run-paymentsheet-screenshot-tests: { }
- check-dependencies: { }
# - run-instrumentation-tests: { }
# - run-paymentsheet-instrumentation-tests: { }
# - run-example-instrumentation-tests: { }
# - run-financial-connections-instrumentation-tests: { }
# - run-connections-e2e-payments-tests-on-push: { }
# - run-connections-e2e-token-tests-on-push: { }
# - run-connections-e2e-data-tests-on-push: { }
# - run-cardscan-instrumentation-tests: { }
# - run-paymentsheet-end-to-end-tests: { }
# - run-paymentsheet-screenshot-tests: { }
# - check-dependencies: { }
stage-build-connections-debug:
workflows:
- build-connections-debug: { }
Expand Down
10 changes: 5 additions & 5 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ext.versions = [
accompanist : '0.34.0',
accompanist : '0.36.0',
alipay : '15.8.12',
androidGradlePlugin : '8.7.1',
androidTest : '1.6.1',
Expand All @@ -12,15 +12,15 @@ ext.versions = [
androidxAppcompat : '1.7.0',
androidxArchCore : '2.2.0',
androidxBrowser : '1.8.0',
androidxCompose : '1.6.8',
androidxComposeRuntime : '1.6.8',
androidxComposeUi : '1.6.8',
androidxCompose : '1.7.4',
androidxComposeRuntime : '1.7.4',
androidxComposeUi : '1.7.4',
androidxConstraintlayout : '2.1.4',
androidxCore : '1.13.1',
androidxFragment : '1.8.4',
androidxLegacySupport : '1.0.0',
androidxLifecycle : '2.8.6',
androidxNavigation : '2.7.7',
androidxNavigation : '2.8.3',
androidxPreference : '1.2.1',
androidxRecyclerview : '1.3.2',
binaryCompatibilityValidator: '0.16.3',
Expand Down
673 changes: 343 additions & 330 deletions example/dependencies/dependencies.txt

Large diffs are not rendered by default.

673 changes: 343 additions & 330 deletions financial-connections-example/dependencies/dependencies.txt

Large diffs are not rendered by default.

498 changes: 272 additions & 226 deletions financial-connections/dependencies/dependencies.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ import androidx.compose.material.ButtonColors
import androidx.compose.material.ButtonDefaults
import androidx.compose.material.ButtonDefaults.buttonColors
import androidx.compose.material.ButtonElevation
import androidx.compose.material.LocalRippleConfiguration
import androidx.compose.material.ProvideTextStyle
import androidx.compose.material.RippleConfiguration
import androidx.compose.material.Text
import androidx.compose.material.ripple.LocalRippleTheme
import androidx.compose.material.ripple.RippleAlpha
import androidx.compose.material.ripple.RippleTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.getValue
Expand Down Expand Up @@ -92,7 +91,14 @@ internal fun FinancialConnectionsButton(
}
}

CompositionLocalProvider(LocalRippleTheme provides type.rippleTheme()) {
CompositionLocalProvider(
LocalRippleConfiguration provides RippleConfiguration(
color = when (type) {
Primary -> Neutral0
Secondary -> colors.textDefault
}
)
) {
Button(
onClick = {
multipleEventsCutter.processEvent {
Expand Down Expand Up @@ -142,20 +148,6 @@ internal fun FinancialConnectionsButton(
}
}

private fun Type.rippleTheme() = object : RippleTheme {
@Composable
override fun defaultColor() = when (this@rippleTheme) {
Primary -> Neutral0
Secondary -> colors.textDefault
}

@Composable
override fun rippleAlpha(): RippleAlpha = RippleTheme.defaultRippleAlpha(
buttonColors().contentColor(enabled = true).value,
lightTheme = true
)
}

internal object FinancialConnectionsButton {

internal sealed class Type {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ import android.view.Window
import androidx.compose.foundation.text.selection.LocalTextSelectionColors
import androidx.compose.foundation.text.selection.TextSelectionColors
import androidx.compose.material.Colors
import androidx.compose.material.LocalRippleConfiguration
import androidx.compose.material.LocalTextStyle
import androidx.compose.material.MaterialTheme
import androidx.compose.material.ripple.LocalRippleTheme
import androidx.compose.material.ripple.RippleTheme
import androidx.compose.material.RippleConfiguration
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.staticCompositionLocalOf
import androidx.compose.ui.graphics.Color
Expand Down Expand Up @@ -191,21 +190,6 @@ internal val TextSelectionColors: TextSelectionColors
backgroundColor = FinancialConnectionsTheme.colors.textDefault.copy(alpha = 0.4f)
)

@Immutable
private object FinancialConnectionsRippleTheme : RippleTheme {
@Composable
override fun defaultColor() = RippleTheme.defaultRippleColor(
contentColor = FinancialConnectionsTheme.colors.textBrand,
lightTheme = MaterialTheme.colors.isLight,
)

@Composable
override fun rippleAlpha() = RippleTheme.defaultRippleAlpha(
contentColor = FinancialConnectionsTheme.colors.textBrand,
lightTheme = MaterialTheme.colors.isLight,
)
}

@Composable
internal fun FinancialConnectionsTheme(
theme: Theme = Theme.default,
Expand Down Expand Up @@ -234,7 +218,9 @@ internal fun FinancialConnectionsTheme(
CompositionLocalProvider(
LocalTextSelectionColors provides TextSelectionColors,
LocalTextStyle provides LocalTextStyle.current.toCompat(useDefaultLineHeight = true),
LocalRippleTheme provides FinancialConnectionsRippleTheme
LocalRippleConfiguration provides RippleConfiguration(
color = FinancialConnectionsTheme.colors.textBrand
),
) {
content()
}
Expand Down
Loading
Loading