Skip to content

Commit

Permalink
chore(SnackbarUtils): Add JvmStatic on showSnackbar function to be ab…
Browse files Browse the repository at this point in the history
…le to use it easily in Java
  • Loading branch information
FabianDevel committed Nov 19, 2024
1 parent 645a1fa commit 00f174f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/com/infomaniak/lib/core/utils/SnackbarUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import com.infomaniak.lib.core.R

object SnackbarUtils {

@JvmStatic
fun Fragment.showSnackbar(
@StringRes title: Int,
anchor: View? = null,
Expand All @@ -40,6 +41,7 @@ object SnackbarUtils {
)
}

@JvmStatic
fun Fragment.showSnackbar(
title: String,
anchor: View? = null,
Expand All @@ -54,6 +56,7 @@ object SnackbarUtils {
)
}

@JvmStatic
fun Activity.showSnackbar(
@StringRes title: Int,
anchor: View? = null,
Expand All @@ -69,6 +72,7 @@ object SnackbarUtils {
)
}

@JvmStatic
fun Activity.showSnackbar(
title: String,
anchor: View? = null,
Expand All @@ -84,6 +88,7 @@ object SnackbarUtils {
)
}

@JvmStatic
fun Activity.showIndefiniteSnackbar(
@StringRes title: Int,
anchor: View? = null,
Expand All @@ -98,6 +103,7 @@ object SnackbarUtils {
onActionClicked = onActionClicked,
)

@JvmStatic
fun showSnackbar(
view: View,
@StringRes title: Int,
Expand All @@ -114,6 +120,7 @@ object SnackbarUtils {
onActionClicked = onActionClicked,
)

@JvmStatic
fun showSnackbar(
view: View,
title: String,
Expand Down

0 comments on commit 00f174f

Please sign in to comment.