From 26d544ea41b7a5ab2fa1a3b9ac6b668e69fe4dff Mon Sep 17 00:00:00 2001 From: Laimonas Turauskas Date: Mon, 14 Oct 2024 15:13:51 -0400 Subject: [PATCH] Remove FragmentDelegate.onNewFragment. (#402) --- .../com/instacart/formula/android/FormulaFragment.kt | 9 ++------- .../com/instacart/formula/android/FragmentEnvironment.kt | 7 ------- 2 files changed, 2 insertions(+), 14 deletions(-) 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 8ca13898..3453c7de 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 @@ -17,14 +17,9 @@ class FormulaFragment : Fragment(), BaseFormulaFragment { @JvmStatic fun newInstance(key: FragmentKey): FormulaFragment { - val fragment = FormulaFragment() - fragment.getOrSetArguments().apply { - putParcelable(ARG_CONTRACT, key) + return FormulaFragment().apply { + getOrSetArguments().putParcelable(ARG_CONTRACT, key) } - FormulaAndroid.fragmentEnvironment().fragmentDelegate.onNewInstance( - fragmentId = fragment.formulaFragmentId - ) - return fragment } } diff --git a/formula-android/src/main/java/com/instacart/formula/android/FragmentEnvironment.kt b/formula-android/src/main/java/com/instacart/formula/android/FragmentEnvironment.kt index aec45bcd..8adf2672 100644 --- a/formula-android/src/main/java/com/instacart/formula/android/FragmentEnvironment.kt +++ b/formula-android/src/main/java/com/instacart/formula/android/FragmentEnvironment.kt @@ -14,13 +14,6 @@ data class FragmentEnvironment( */ open class FragmentDelegate { - /** - * Called when new instance of [FormulaFragment] is created. - */ - open fun onNewInstance( - fragmentId: FragmentId - ) = Unit - /** * Instantiates the feature. */