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. */