Skip to content

Commit

Permalink
refactor: add Fragment.window util
Browse files Browse the repository at this point in the history
  • Loading branch information
BrayanDSO committed Dec 22, 2024
1 parent 54fe63e commit a76cfe7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions AnkiDroid/src/main/java/com/ichi2/anki/utils/ext/Fragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package com.ichi2.anki.utils.ext

import android.content.SharedPreferences
import android.content.pm.PackageManager
import android.view.Window
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.Fragment
import com.ichi2.anki.preferences.sharedPrefs
Expand All @@ -33,3 +34,6 @@ val Fragment.packageManager: PackageManager
* @see showDialogFragmentImpl
*/
fun Fragment.showDialogFragment(newFragment: DialogFragment) = requireActivity().showDialogFragment(newFragment)

val Fragment.window: Window
get() = requireActivity().window

0 comments on commit a76cfe7

Please sign in to comment.