Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
mardous committed Dec 22, 2024
1 parent 4c1640e commit 571b8b7
Showing 1 changed file with 0 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -36,15 +33,6 @@ fun Fragment.getIntRes(@IntegerRes int: Int): Int {

fun Fragment.findActivityNavController(id: Int) = requireActivity().findNavController(id)

@Suppress("UNCHECKED_CAST")
fun <T : Fragment?> 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 <T> Fragment.whichFragment(@IdRes id: Int): T {
return childFragmentManager.findFragmentById(id) as T
Expand Down Expand Up @@ -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()
}

0 comments on commit 571b8b7

Please sign in to comment.