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

[FC] Moves Activities and some Panes out of Mavericks #8125

Merged

Conversation

carlosmuvi-stripe
Copy link
Collaborator

@carlosmuvi-stripe carlosmuvi-stripe commented Mar 19, 2024

Summary

First PR removing Mavericks on both parent activities, as well as Consent and Institution Picker (Composable-based panes).

  • AddsResult (replaces Async).
  • Uses SavedStateHandle to save and retrieve fields on process death (replacing @PersistState)
  • DI: MavericksViewModelFactory helps retrieving the parent activity with its ViewModelContext We use that to retrieve the activity viewmodel, that exposes the parent Dagger Component to build screen SubComponents. Replaced by a helper function that retrieves the parent component directly.

Motivation

Testing

  • Tested process death (don't keep activities) - saved bundle contains fields previously annotated with @PersistState.

image

  • Added tests
  • Modified tests
  • Manually verified

Copy link
Contributor

github-actions bot commented Mar 19, 2024

Diffuse output:

OLD: paymentsheet-example-release-master.apk (signature: V1, V2)
NEW: paymentsheet-example-release-pr.apk (signature: V1, V2)

          │             compressed             │           uncompressed            
          ├───────────┬───────────┬────────────┼───────────┬──────────┬────────────
 APK      │ old       │ new       │ diff       │ old       │ new      │ diff       
──────────┼───────────┼───────────┼────────────┼───────────┼──────────┼────────────
      dex │   3.9 MiB │   3.9 MiB │   -6.6 KiB │   8.6 MiB │  8.6 MiB │   +2.5 KiB 
     arsc │   2.2 MiB │   2.5 MiB │ +286.6 KiB │   2.2 MiB │  2.5 MiB │ +286.6 KiB 
 manifest │   5.1 KiB │   5.1 KiB │        0 B │  25.4 KiB │ 25.4 KiB │        0 B 
      res │ 911.1 KiB │ 935.7 KiB │  +24.5 KiB │   1.4 MiB │  1.5 MiB │  +14.1 KiB 
   native │   2.6 MiB │   2.6 MiB │        0 B │     6 MiB │    6 MiB │        0 B 
    asset │     3 MiB │     3 MiB │     -145 B │     3 MiB │    3 MiB │      -82 B 
    other │ 204.3 KiB │ 210.8 KiB │   +6.6 KiB │ 445.3 KiB │  471 KiB │  +25.7 KiB 
──────────┼───────────┼───────────┼────────────┼───────────┼──────────┼────────────
    total │  12.8 MiB │  13.1 MiB │ +310.9 KiB │  21.7 MiB │   22 MiB │ +328.8 KiB 

 DEX     │ old   │ new   │ diff                 
─────────┼───────┼───────┼──────────────────────
   files │     1 │     1 │    0                 
 strings │ 42699 │ 42672 │  -27 (+8691 -8718)   
   types │ 14592 │ 14512 │  -80 (+8484 -8564)   
 classes │ 12341 │ 12262 │  -79 (+7633 -7712)   
 methods │ 60862 │ 60749 │ -113 (+40493 -40606) 
  fields │ 40033 │ 39943 │  -90 (+30276 -30366) 

 ARSC    │ old  │ new  │ diff             
─────────┼──────┼──────┼──────────────────
 configs │  242 │  328 │   +86 (+86 -0)   
 entries │ 6029 │ 7262 │ +1233 (+1233 -0)
APK
      compressed       │      uncompressed      │                                                                    
──────────┬────────────┼───────────┬────────────┤                                                                    
 size     │ diff       │ size      │ diff       │ path                                                               
──────────┼────────────┼───────────┼────────────┼────────────────────────────────────────────────────────────────────
  2.5 MiB │ +286.6 KiB │   2.5 MiB │ +286.6 KiB │ ∆ resources.arsc                                                   
  3.9 MiB │   -6.6 KiB │   8.6 MiB │   +2.5 KiB │ ∆ classes.dex                                                      
 67.8 KiB │   +5.7 KiB │ 152.9 KiB │  +12.9 KiB │ ∆ META-INF/CERT.SF                                                 
 54.3 KiB │   +1.1 KiB │ 152.8 KiB │  +12.9 KiB │ ∆ META-INF/MANIFEST.MF                                             
    503 B │     +503 B │     808 B │     +808 B │ + res/iZ1.xml                                                      
    435 B │     +435 B │     796 B │     +796 B │ + res/F81.xml                                                      
    412 B │     +412 B │     592 B │     +592 B │ + res/eK1.xml                                                      
    354 B │     +354 B │     524 B │     +524 B │ + res/By1.xml                                                      
    150 B │     -351 B │     112 B │     -696 B │ ∆ res/iZ.xml                                                       
    150 B │     -284 B │     112 B │     -684 B │ ∆ res/F8.xml                                                       
          │     -272 B │           │     -120 B │ - META-INF/version-control-info.textproto                          
    150 B │     -260 B │     112 B │     -480 B │ ∆ res/eK.xml                                                       
    248 B │     +248 B │     112 B │     +112 B │ + res/color/material_personalized_hint_foreground_inverse.xml      
    240 B │     +240 B │     112 B │     +112 B │ + res/color/material_on_background_emphasis_high_type.xml          
    238 B │     +238 B │     112 B │     +112 B │ + res/color/mtrl_navigation_bar_colored_ripple_color.xml           
    234 B │     +234 B │     112 B │     +112 B │ + res/color/material_on_background_emphasis_medium.xml             
    234 B │     +234 B │     112 B │     +112 B │ + res/color/material_on_primary_emphasis_high_type.xml             
    232 B │     +232 B │     112 B │     +112 B │ + res/color/material_personalized_hint_foreground.xml              
    232 B │     +232 B │     112 B │     +112 B │ + res/color/mtrl_navigation_bar_colored_item_tint.xml              
    232 B │     +232 B │     112 B │     +112 B │ + res/color/mtrl_tabs_icon_color_selector_colored.xml              
    230 B │     +230 B │     112 B │     +112 B │ + res/color-v31/m3_ref_palette_dynamic_neutral12.xml               
    230 B │     +230 B │     112 B │     +112 B │ + res/color-v31/m3_ref_palette_dynamic_neutral17.xml               
    230 B │     +230 B │     112 B │     +112 B │ + res/color-v31/m3_ref_palette_dynamic_neutral22.xml               
    230 B │     +230 B │     112 B │     +112 B │ + res/color-v31/m3_ref_palette_dynamic_neutral24.xml               
    230 B │     +230 B │     112 B │     +112 B │ + res/color-v31/m3_ref_palette_dynamic_neutral87.xml               
    230 B │     +230 B │     112 B │     +112 B │ + res/color-v31/m3_ref_palette_dynamic_neutral92.xml               
    230 B │     +230 B │     112 B │     +112 B │ + res/color-v31/m3_ref_palette_dynamic_neutral94.xml               
    230 B │     +230 B │     112 B │     +112 B │ + res/color-v31/m3_ref_palette_dynamic_neutral96.xml               
    230 B │     +230 B │     112 B │     +112 B │ + res/color-v31/m3_ref_palette_dynamic_neutral98.xml               
    228 B │     +228 B │     112 B │     +112 B │ + res/color-v31/m3_ref_palette_dynamic_neutral4.xml                
    228 B │     +228 B │     112 B │     +112 B │ + res/color-v31/m3_ref_palette_dynamic_neutral6.xml                
    228 B │     +228 B │     112 B │     +112 B │ + res/color/material_on_primary_emphasis_medium.xml                
    224 B │     +224 B │     112 B │     +112 B │ + res/color/m3_elevated_chip_background_color.xml                  
    220 B │     +220 B │     112 B │     +112 B │ + res/color/material_on_background_disabled.xml                    
    218 B │     
...✂
MANIFEST
              │ old                                     │ new                                     
──────────────┼─────────────────────────────────────────┼─────────────────────────────────────────
 package      │ com.stripe.android.paymentsheet.example │ com.stripe.android.paymentsheet.example 
 version code │ 11                                      │ 11                                      
 version name │ 20.40.1                                 │ 20.40.0                                 

@@ -4,3 +4,3 @@
     android:versionCode=11
-    android:versionName=20.40.1
+    android:versionName=20.40.0
     package=com.stripe.android.paymentsheet.example
DEX
STRINGS:

   old   │ new   │ diff              
  ───────┼───────┼───────────────────
   42699 │ 42672 │ -27 (+8691 -8718) 
  
  +  --> %s
  +  Explicit call timeout was '%d' ns.
  +  asked to inflate view for <
  +  criticalSectionEnterTimeoutMs
  +  eventCleanUpAge
  +  loadBatchSize
  +  maxBlobByteSizePerRow
  +  maxStorageSizeInBytes
  +  requestTimeMs
  +  requestUptimeMs
  + #extension GL_OES_EGL_image_external : require
  precision mediump float;
  varying vec2 %s;
  uniform samplerExternalOES %s;
  void main() {
      gl_FragColor = texture2D(%s, %s);
  }
  
  + #version 300 es
  #extension GL_OES_EGL_image_external : require
  #extension GL_EXT_YUV_target : require
  precision mediump float;
  uniform __samplerExternal2DY2YEXT %s;
  in vec2 %s;
  out vec4 outColor;
  
  vec3 yuvToRgb(vec3 yuv) {
    const vec3 yuvOffset = vec3(0.0625, 0.5, 0.5);
    const mat3 yuvToRgbColorTransform = mat3(
      1.1689f, 1.1689f, 1.1689f,
      0.0000f, -0.1881f, 2.1502f,
      1.6853f, -0.6530f, 0.0000f
    );
    return clamp(yuvToRgbColorTransform * (yuv - yuvOffset), 0.0, 1.0);
  }
  
  void main() {
    vec3 srcYuv = texture(%s, %s).xyz;
    outColor = vec4(yuvToRgb(srcYuv), 1.0);
  }
  + #version 300 es
  in vec4 aPosition;
  in vec4 aTextureCoord;
  uniform mat4 uTexMatrix;
  out vec2 %s;
  void main() {
    gl_Position = aPosition;
    %s = (uTexMatrix * aTextureCoord).xy;
  }
  
  + _this_initializer
  + %s is out of range of [%d, %d] (too high)
  + %s is out of range of [%d, %d] (too low)
  + %s-%s-%s
  + %s-retry [timeout=%s]
  + %s-timeout-giveup [timeout=%s]
  + %s.%sParcelizer
  + %s: Received GOAWAY with ENHANCE_YOUR_CALM. Debug data: %s
  + , async=
  + , formElements=
  + 2.3.0
  + 20.40.0
  + <ByteString@%s size=%d contents=%s>
  + >, but returned null
  + >> CONNECTION %s
  + A2
  + AddressComponent is not properly defined: %s.
  + AddressComponent not properly defined (%s).
  + AndroidBindings/20.40.0
  + Attempt to reopen camera[%s] after error[%s]
  + B2
  + Build: %s
  
  + C2
  + CONNECT %s:%d HTTP/1.1
  + Call timeout set to '%d' ns, due to context deadline.
  + Camera device id is %s. 10 bit dynamic range is not currently supported in %s camera mode.
  + CameraDevice.onError(): %s failed with %s while in %s state. Will attempt recovering from error.
  + CameraDevice.onError(): %s failed with %s while in %s state. Will finish closing camera.
  + CameraX-camerax_io_%d
  + CameraX-core_camera_%d
  + Can't find decompressor for %s
  + Candidate Dynamic range is not within constraints.
  Dynamic range to resolve:
    %s
  Candidate dynamic range:
    %s
  + Cannot convert between a TensorFlowLite tensor with type %s and a Java object of type %s (which is compatible with the TensorFlowLite type %s).
  + Cannot copy from a TensorFlowLite tensor (%s) with shape %s to a Java object with shape %s.
  + Cannot copy to a TensorFlowLite tensor (%s) with shape %s from a Java object with shape %s.
  + Cannot initialize %s. Cycle detected.
  + Class %s is not found.
  + Constraints of dynamic range cannot be combined with existing constraints.
  Dynamic range:
    %s
  Constraints:
    %s
  Existing constraints:
    %s
  + Could not instantiate %s
  + Could not instantiate %s.
  + Creating dialog for Google Play services availability issue. ConnectionResult=%s
  + D2
  + Duration is not valid. See proto definition for valid values. Seconds (%s) must be in range [-315,576,000,000, +315,576,000,000]. Nanos (%s) must be in range [-999,999,999, +999,999,999]. Nanos must have the same sign as seconds
  + E2
  + F2
  + FinancialConnectionsSheetNativeState
  + G2
  + GMS core API Availability. ConnectionResult=%s, tag=%s
  + H2
  + I2
  + Image processing performance profiling, duration: [%d], image count: %d
  + Invalid environment value %d
  + Invalid timeout unit: %s
  + J2
  + K2
  + L2
  + LFFFFFFFFF
  + LLLLZI
  + La1/a0;
  + La1/b0;
  + La1/b;
  + La1/c0;
  + La1/c;
  + La1/d0;
  + La1/d;
  + La1/e0;
  + La1/e;
  + La1/f0;
  + La1/f;
  + La1/g0;
  + La1/g;
  + La1/h0;
  + La1/h;
  + La1/i0;
  + La1/i;
  + La1/j0;
  + La1/j;
  + La1/k0;
  + La1/k;
  + La1/l0;
  + La1/l;
  + La1/m0;
  + La1/m;
  + La1/n0;
  + La1/n;
  + La1/o0;
  + La1/o;
  + La1/p0;
  + La1/p;
  + La1/q0;
  + La1/q;
  + La1/r;
  + La1/s;
  + La1/t;
  + La1/u;
  + La1/v;
  + La1/w;
  + La1/x;
  + La1/y;
  + La1/z;
  + La2/l;
  + La2/m;
  + La2/n;
  + La2/o;
  + La2/p;
  + La2/q;
  + La2/r;
  + La2/s;
  + La6/a0;
  + La6/r;
  + La6/s;
  + La6/t;
  
...✂
ARSC
CONFIGS:

   old │ new │ diff         
  ─────┼─────┼──────────────
   242 │ 328 │ +86 (+86 -0) 
  + dimen-h320dp-port
  + dimen-h550dp-port
  + drawable-anydpi
  + drawable-ldpi
  + plurals-af
  + plurals-am
  + plurals-ar
  + plurals-as
  + plurals-az
  + plurals-b+sr+Latn
  + plurals-be
  + plurals-bg
  + plurals-bn
  + plurals-bs
  + plurals-ca
  + plurals-cs
  + plurals-da
  + plurals-de
  + plurals-el
  + plurals-en-rGB
  + plurals-es
  + plurals-es-r419
  + plurals-es-rUS
  + plurals-et
  + plurals-eu
  + plurals-fa
  + plurals-fi
  + plurals-fr
  + plurals-fr-rCA
  + plurals-gl
  + plurals-gu
  + plurals-hi
  + plurals-hr
  + plurals-hu
  + plurals-hy
  + plurals-in
  + plurals-is
  + plurals-it
  + plurals-iw
  + plurals-ja
  + plurals-ka
  + plurals-kk
  + plurals-km
  + plurals-kn
  + plurals-ko
  + plurals-ky
  + plurals-lo
  + plurals-lt
  + plurals-lv
  + plurals-mk
  + plurals-ml
  + plurals-mn
  + plurals-mr
  + plurals-ms
  + plurals-my
  + plurals-nb
  + plurals-ne
  + plurals-nl
  + plurals-or
  + plurals-pa
  + plurals-pl
  + plurals-pt-rBR
  + plurals-pt-rPT
  + plurals-ro
  + plurals-ru
  + plurals-si
  + plurals-sk
  + plurals-sl
  + plurals-sq
  + plurals-sr
  + plurals-sv
  + plurals-sw
  + plurals-ta
  + plurals-te
  + plurals-th
  + plurals-tl
  + plurals-tr
  + plurals-uk
  + plurals-ur
  + plurals-uz
  + plurals-vi
  + plurals-zh-rCN
  + plurals-zh-rHK
  + plurals-zh-rTW
  + plurals-zu
  + style-ldltr
  

ENTRIES:

   old  │ new  │ diff             
  ──────┼──────┼──────────────────
   6029 │ 7262 │ +1233 (+1233 -0) 
  + anim/abc_fade_in
  + anim/abc_fade_out
  + anim/abc_slide_in_bottom
  + anim/abc_slide_in_top
  + anim/abc_slide_out_bottom
  + anim/abc_slide_out_top
  + anim/design_snackbar_in
  + anim/design_snackbar_out
  + anim/m3_bottom_sheet_slide_in
  + anim/m3_bottom_sheet_slide_out
  + anim/m3_side_sheet_enter_from_left
  + anim/m3_side_sheet_enter_from_right
  + anim/nav_default_enter_anim
  + anim/nav_default_pop_enter_anim
  + animator/m3_btn_elevated_btn_state_list_anim
  + animator/m3_elevated_chip_state_list_anim
  + animator/mtrl_fab_transformation_sheet_collapse_spec
  + animator/nav_default_enter_anim
  + animator/nav_default_pop_enter_anim
  + color/call_notification_answer_color
  + color/call_notification_decline_color
  + color/common_google_signin_btn_tint
  + color/design_bottom_navigation_shadow_color
  + color/design_fab_shadow_end_color
  + color/design_fab_shadow_mid_color
  + color/design_fab_shadow_start_color
  + color/design_fab_stroke_end_inner_color
  + color/design_fab_stroke_end_outer_color
  + color/design_fab_stroke_top_inner_color
  + color/design_fab_stroke_top_outer_color
  + color/dim_foreground_disabled_material_dark
  + color/dim_foreground_disabled_material_light
  + color/dim_foreground_material_dark
  + color/dim_foreground_material_light
  + color/m3_appbar_overlay_color
  + color/m3_assist_chip_stroke_color
  + color/m3_button_ripple_color
  + color/m3_elevated_chip_background_color
  + color/m3_popupmenu_overlay_color
  + color/m3_ref_palette_black
  + color/m3_ref_palette_dynamic_neutral0
  + color/m3_ref_palette_dynamic_neutral100
  + color/m3_ref_palette_dynamic_neutral12
  + color/m3_ref_palette_dynamic_neutral17
  + color/m3_ref_palette_dynamic_neutral22
  + color/m3_ref_palette_dynamic_neutral24
  + color/m3_ref_palette_dynamic_neutral30
  + color/m3_ref_palette_dynamic_neutral4
  + color/m3_ref_palette_dynamic_neutral40
  + color/m3_ref_palette_dynamic_neutral50
  + color/m3_ref_palette_dynamic_neutral6
  + color/m3_ref_palette_dynamic_neutral60
  + color/m3_ref_palette_dynamic_neutral70
  + color/m3_ref_palette_dynamic_neutral80
  + color/m3_ref_palette_dynamic_neutral87
  + color/m3_ref_palette_dynamic_neutral92
  + color/m3_ref_palette_dynamic_neutral94
  + color/m3_ref_palette_dynamic_neutral96
  + color/m3_ref_palette_dynamic_neutral98
  + color/m3_ref_palette_dynamic_neutral99
  + color/m3_ref_palette_dynamic_neutral_variant0
  + color/m3_ref_palette_dynamic_neutral_variant20
  + color/m3_ref_palette_dynamic_neutral_variant40
  + color/m3_ref_palette_dynamic_neutral_variant70
  + color/m3_ref_palette_dynamic_neutral_variant95
  + color/m3_ref_palette_dynamic_neutral_variant99
  + color/m3_ref_palette_dynamic_primary0
  + color/m3_ref_palette_dynamic_primary50
  + color/m3_ref_palette_dynamic_primary60
  + color/m3_ref_palette_dynamic_primary70
  + color/m3_ref_palette_dynamic_primary95
  + color/m3_ref_palette_dynamic_prima
...✂

@carlosmuvi-stripe carlosmuvi-stripe changed the title [POC] Remove Mavericks on Consent screen. [POC] Remove Mavericks on Consent and Institution Picker. Mar 19, 2024
Comment on lines 18 to 19
onSuccess: (T) -> Unit = {},
onFail: (Throwable) -> Unit = {}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some side effect callbacks that should replace the onAsync behavior (IMO code is easier to follow if side effects follow the operation execution)

@carlosmuvi-stripe carlosmuvi-stripe changed the title [POC] Remove Mavericks on Consent and Institution Picker. [FC] Moves Activities and some Panes out of Mavericks Mar 20, 2024
@carlosmuvi-stripe carlosmuvi-stripe force-pushed the carlosmuvi/poc-remove-mavericks branch from f5bc4d0 to ce3643e Compare March 20, 2024 21:35
@carlosmuvi-stripe carlosmuvi-stripe changed the base branch from master to carlosmuvi/i/remove-mavericks March 20, 2024 21:35
Copy link
Collaborator

@tillh-stripe tillh-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the direction that this is going ❤️

initialState: S
) : ViewModel() {

val stateFlow: MutableStateFlow<S> = MutableStateFlow(initialState)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should keep this private and expose a non-mutable StateFlow.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

protected fun setState(reducer: S.() -> S) {
stateFlow.update { state -> state.reducer() }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another super nit!

Suggested change
stateFlow.update { state -> state.reducer() }
stateFlow.update(reducer)

}
}

internal sealed class Result<out T>(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s not technically a result. Should we call this AsyncState or something more along those lines?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about we just call it Async? Feels simple and short : )

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* retained component) to the factory to facilitate its creation via dependency injection.
*/
@Composable
internal inline fun <reified T : FinancialConnectionsViewModel<S>, S> paneViewModel(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Comment on lines +125 to +127
fun factory(parentComponent: FinancialConnectionsSheetNativeComponent): ViewModelProvider.Factory =
viewModelFactory {
initializer {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smooth 👌

.map { it.viewEffect }
.distinctUntilChanged()
.collect { viewEffect ->
if (viewEffect == null) return@collect
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about a filterNotNull above?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -161,7 +182,7 @@ internal class FinancialConnectionsSheetNativeViewModel @Inject constructor(
*/
fun onResume() = viewModelScope.launch {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need the coroutine scope now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep! still needed for the mutex

.map { it.viewEffect }
.distinctUntilChanged()
.collect { viewEffect ->
if (viewEffect == null) return@collect
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same filterNotNull suggestion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -281,7 +281,7 @@ class FinancialConnectionsSheetViewModelTest {
viewModel.handleOnNewIntent(errorIntent)

// Then
withState(viewModel) {
viewModel.stateFlow.value.let {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can add some FinancialConnectionsViewModel specific test extensions like Mavericks had. What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea! noted for future PRs : )

carlosmuvi-stripe and others added 3 commits March 21, 2024 16:52
…alconnections/core/FinancialConnectionsViewModel.kt

Co-authored-by: Till Hellmund <tillh@stripe.com>
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch

internal abstract class FinancialConnectionsViewModel<S>(
initialState: S
) : ViewModel() {

val stateFlow: MutableStateFlow<S> = MutableStateFlow(initialState)
private val _stateFlow: MutableStateFlow<S> = MutableStateFlow(initialState)
val stateFlow: StateFlow<S> = _stateFlow
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
val stateFlow: StateFlow<S> = _stateFlow
val stateFlow: StateFlow<S> = _stateFlow.asStateFlow()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -5,7 +5,7 @@ import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertNull

class GooglePayResultTest {
class GooglePayAsyncTest {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀 🙈

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlosmuvi-stripe carlosmuvi-stripe marked this pull request as ready for review March 22, 2024 21:11
@carlosmuvi-stripe carlosmuvi-stripe requested review from a team as code owners March 22, 2024 21:11
@carlosmuvi-stripe carlosmuvi-stripe requested review from jaynewstrom-stripe and removed request for a team March 22, 2024 21:11
@carlosmuvi-stripe carlosmuvi-stripe merged commit 8b8043c into carlosmuvi/i/remove-mavericks Mar 22, 2024
11 of 12 checks passed
@carlosmuvi-stripe carlosmuvi-stripe deleted the carlosmuvi/poc-remove-mavericks branch March 22, 2024 23:35
carlosmuvi-stripe added a commit that referenced this pull request Mar 27, 2024
* [FC] Moves Activities and some Panes out of Mavericks (#8125)

* Removes mackericks references on Consent screen.

* Updates files.

* Uses viewmodel factory builder.

* Updates functions.

* Updates execute.

* Updates compose util.

* Adds missing side effects.

* Simplifies code.

* Renames viewmodel.

* Updates async.

* Removes mavericks from institution picker.

* Reverts rename.

* Updates baseline.

* Adds setState and persists state.

* Renames result error to fail.

* Migrates Initial activity out of mavericks.

* Removes persist state.

* Updates tests.

* Regenerates API.

* filterNotNull.

* Nits.

* Updates async.

* use suspend block.

* Update financial-connections/src/main/java/com/stripe/android/financialconnections/core/FinancialConnectionsViewModel.kt

Co-authored-by: Till Hellmund <tillh@stripe.com>

* Tries onAsync.

* Moves activity to stripe ui core.

* PR feedback.

* Regenerates deps.

---------

Co-authored-by: Till Hellmund <tillh@stripe.com>

* [FC] Removes mavericks from repositories and more panes. (#8154)

* Migrates more screens out of mavs.

* Migrates partner auth.

* Removes active auth session field.

* Updates tests.

* Updates attach payment viewmodel.

* PR feedback.

* Api dump.

* [FC] Removes mavericks from all viewmodels and tests (#8155)

* Migrates more screens out of mavs.

* Migrates partner auth.

* Removes active auth session field.

* Updates tests.

* Updates attach payment viewmodel.

* PR feedback.

* Api dump.

* Migrates missing viewmodels.

* Updates dependencies.

* PR feedback.

* Merge master.

* [FC] Removes mavericks dependency (#8160)

* Migrates more screens out of mavs.

* Migrates partner auth.

* Removes active auth session field.

* Updates tests.

* Updates attach payment viewmodel.

* PR feedback.

* Api dump.

* Migrates missing viewmodels.

* Updates dependencies.

* Removes mavericks dependency.

* Merge with integration.

* Uses collect.

* Updates dependencies

* Updates Changelog.

* Update CHANGELOG.md

Co-authored-by: Till Hellmund <tillh@stripe.com>

---------

Co-authored-by: Till Hellmund <tillh@stripe.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants