From 275064f57b656e5cf54409a41ec1b2739dfbde1f Mon Sep 17 00:00:00 2001 From: Laimonas Turauskas Date: Thu, 30 Nov 2023 13:18:34 -0800 Subject: [PATCH] PR feedback. --- .../instacart/formula/android/compose/ComposeViewFactory.kt | 2 +- .../main/java/com/instacart/formula/android/FeatureView.kt | 2 +- .../java/com/instacart/formula/android/FormulaFragment.kt | 4 ++-- .../formula/android/views/FeatureViewBindFunction.kt | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/formula-android-compose/src/main/java/com/instacart/formula/android/compose/ComposeViewFactory.kt b/formula-android-compose/src/main/java/com/instacart/formula/android/compose/ComposeViewFactory.kt index fdd302fa..e32a4573 100644 --- a/formula-android-compose/src/main/java/com/instacart/formula/android/compose/ComposeViewFactory.kt +++ b/formula-android-compose/src/main/java/com/instacart/formula/android/compose/ComposeViewFactory.kt @@ -33,7 +33,7 @@ abstract class ComposeViewFactory : ViewFactory { firstRender = false state.environment.eventListener?.onFirstModelRendered( fragmentId = state.fragmentId, - durationInMillis = end - state.initialized, + durationInMillis = end - state.initializedAtMillis, ) } } diff --git a/formula-android/src/main/java/com/instacart/formula/android/FeatureView.kt b/formula-android/src/main/java/com/instacart/formula/android/FeatureView.kt index 18022a5c..f4b24a53 100644 --- a/formula-android/src/main/java/com/instacart/formula/android/FeatureView.kt +++ b/formula-android/src/main/java/com/instacart/formula/android/FeatureView.kt @@ -22,7 +22,7 @@ class FeatureView( val lifecycleCallbacks: FragmentLifecycleCallback? = null, ) { class State( - val initialized: Long, + val initializedAtMillis: Long, val fragmentId: FragmentId, val environment: FragmentEnvironment, val observable: Observable, diff --git a/formula-android/src/main/java/com/instacart/formula/android/FormulaFragment.kt b/formula-android/src/main/java/com/instacart/formula/android/FormulaFragment.kt index 537ea44d..2ad51618 100644 --- a/formula-android/src/main/java/com/instacart/formula/android/FormulaFragment.kt +++ b/formula-android/src/main/java/com/instacart/formula/android/FormulaFragment.kt @@ -30,7 +30,7 @@ class FormulaFragment : Fragment(), BaseFormulaFragment { requireArguments().getParcelable(ARG_CONTRACT)!! } - private val initialized = SystemClock.uptimeMillis() + private val initializedAtMillis = SystemClock.uptimeMillis() private var featureView: FeatureView? = null private val stateRelay: BehaviorRelay = BehaviorRelay.create() @@ -53,7 +53,7 @@ class FormulaFragment : Fragment(), BaseFormulaFragment { super.onViewCreated(view, savedInstanceState) featureView?.let { value -> val state = FeatureView.State( - initialized = initialized, + initializedAtMillis = initializedAtMillis, fragmentId = getFormulaFragmentId(), environment = FormulaFragmentDelegate.fragmentEnvironment(), observable = stateRelay, diff --git a/formula-android/src/main/java/com/instacart/formula/android/views/FeatureViewBindFunction.kt b/formula-android/src/main/java/com/instacart/formula/android/views/FeatureViewBindFunction.kt index bffeca27..56f083e5 100644 --- a/formula-android/src/main/java/com/instacart/formula/android/views/FeatureViewBindFunction.kt +++ b/formula-android/src/main/java/com/instacart/formula/android/views/FeatureViewBindFunction.kt @@ -28,7 +28,7 @@ internal class FeatureViewBindFunction( firstRender = false environment.eventListener?.onFirstModelRendered( fragmentId = state.fragmentId, - durationInMillis = end - state.initialized, + durationInMillis = end - state.initializedAtMillis, ) } } catch (exception: Exception) {