Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add JvmStatic on showSnackbar function to be able to use it easily in Java #238

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading