From f11f68075775152ebc035cbd39bdbed665a1e0a3 Mon Sep 17 00:00:00 2001 From: Seiko Date: Fri, 13 Aug 2021 14:04:31 +0800 Subject: [PATCH] add fun proxyFragmentFactory/setupReportFragmentManager in Fragivity see: https://github.com/vitaviva/fragivity/issues/51 --- .../java/com/github/fragivity/Fragivity.kt | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/library/src/main/java/com/github/fragivity/Fragivity.kt b/library/src/main/java/com/github/fragivity/Fragivity.kt index 0faa760..554ad68 100644 --- a/library/src/main/java/com/github/fragivity/Fragivity.kt +++ b/library/src/main/java/com/github/fragivity/Fragivity.kt @@ -2,13 +2,27 @@ package com.github.fragivity import android.os.Bundle import androidx.arch.core.util.Function -import androidx.fragment.app.DialogFragment -import androidx.fragment.app.Fragment +import androidx.fragment.app.* import androidx.navigation.fragment.NavHostFragment import com.github.fragivity.dialog.showDialog object Fragivity { + @JvmStatic + fun proxyFragmentFactory(activity: FragmentActivity) { + activity.proxyFragmentFactory() + } + + @JvmStatic + fun proxyFragmentFactory(manager: FragmentManager) { + manager.proxyFragmentFactory() + } + + @JvmStatic + fun setupReportFragmentManager(navHost: NavHostFragment) { + navHost.setupReportFragmentManager() + } + @JvmStatic fun loadRoot( navHost: NavHostFragment,