From 571b8b7ff7514e2e0e3ab94b3d9c108451779173 Mon Sep 17 00:00:00 2001 From: mardous Date: Sun, 22 Dec 2024 13:39:24 -0400 Subject: [PATCH] remove unused code --- .../wsstatussaver/extensions/FragmentExt.kt | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/app/src/main/java/com/simplified/wsstatussaver/extensions/FragmentExt.kt b/app/src/main/java/com/simplified/wsstatussaver/extensions/FragmentExt.kt index 042c42c..f6bf446 100644 --- a/app/src/main/java/com/simplified/wsstatussaver/extensions/FragmentExt.kt +++ b/app/src/main/java/com/simplified/wsstatussaver/extensions/FragmentExt.kt @@ -14,15 +14,12 @@ package com.simplified.wsstatussaver.extensions import android.content.Intent -import android.view.View import android.view.Window import android.widget.Toast import androidx.annotation.DimenRes import androidx.annotation.IdRes import androidx.annotation.IntegerRes -import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment -import androidx.fragment.app.FragmentActivity import androidx.navigation.findNavController import androidx.navigation.fragment.NavHostFragment @@ -36,15 +33,6 @@ fun Fragment.getIntRes(@IntegerRes int: Int): Int { fun Fragment.findActivityNavController(id: Int) = requireActivity().findNavController(id) -@Suppress("UNCHECKED_CAST") -fun FragmentActivity.whichFragment(containerId: Int): T? { - if (containerId != View.NO_ID) { - val fragment = supportFragmentManager.findFragmentById(containerId) ?: return null - return fragment as T - } - return null -} - @Suppress("UNCHECKED_CAST") fun Fragment.whichFragment(@IdRes id: Int): T { return childFragmentManager.findFragmentById(id) as T @@ -82,10 +70,4 @@ fun Fragment.currentFragment(navHostId: Int): Fragment? { val navHostFragment: NavHostFragment = childFragmentManager.findFragmentById(navHostId) as NavHostFragment return navHostFragment.childFragmentManager.fragments.firstOrNull() -} - -fun AppCompatActivity.currentFragment(navHostId: Int): Fragment? { - val navHostFragment: NavHostFragment = - supportFragmentManager.findFragmentById(navHostId) as NavHostFragment - return navHostFragment.childFragmentManager.fragments.firstOrNull() } \ No newline at end of file