|
|
@ -1,6 +1,5 @@ |
|
|
|
package io.legado.app.utils |
|
|
|
package io.legado.app.utils |
|
|
|
|
|
|
|
|
|
|
|
import android.content.Context |
|
|
|
|
|
|
|
import android.widget.Toast |
|
|
|
import android.widget.Toast |
|
|
|
import androidx.fragment.app.Fragment |
|
|
|
import androidx.fragment.app.Fragment |
|
|
|
import org.jetbrains.anko.longToast |
|
|
|
import org.jetbrains.anko.longToast |
|
|
@ -14,17 +13,6 @@ import org.jetbrains.anko.toast |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
inline fun Fragment.toast(message: Int) = requireActivity().toast(message) |
|
|
|
inline fun Fragment.toast(message: Int) = requireActivity().toast(message) |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Display the simple Toast message with the [Toast.LENGTH_SHORT] duration. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param message the message text resource. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
inline fun Context.toast(message: Int): Toast = Toast |
|
|
|
|
|
|
|
.makeText(this, message, Toast.LENGTH_SHORT) |
|
|
|
|
|
|
|
.apply { |
|
|
|
|
|
|
|
show() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Display the simple Toast message with the [Toast.LENGTH_SHORT] duration. |
|
|
|
* Display the simple Toast message with the [Toast.LENGTH_SHORT] duration. |
|
|
|
* |
|
|
|
* |
|
|
@ -32,17 +20,6 @@ inline fun Context.toast(message: Int): Toast = Toast |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
inline fun Fragment.toast(message: CharSequence) = requireActivity().toast(message) |
|
|
|
inline fun Fragment.toast(message: CharSequence) = requireActivity().toast(message) |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Display the simple Toast message with the [Toast.LENGTH_SHORT] duration. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param message the message text. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
inline fun Context.toast(message: CharSequence): Toast = Toast |
|
|
|
|
|
|
|
.makeText(this, message, Toast.LENGTH_SHORT) |
|
|
|
|
|
|
|
.apply { |
|
|
|
|
|
|
|
show() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Display the simple Toast message with the [Toast.LENGTH_LONG] duration. |
|
|
|
* Display the simple Toast message with the [Toast.LENGTH_LONG] duration. |
|
|
|
* |
|
|
|
* |
|
|
@ -50,31 +27,9 @@ inline fun Context.toast(message: CharSequence): Toast = Toast |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
inline fun Fragment.longToast(message: Int) = requireActivity().longToast(message) |
|
|
|
inline fun Fragment.longToast(message: Int) = requireActivity().longToast(message) |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Display the simple Toast message with the [Toast.LENGTH_LONG] duration. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param message the message text resource. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
inline fun Context.longToast(message: Int): Toast = Toast |
|
|
|
|
|
|
|
.makeText(this, message, Toast.LENGTH_LONG) |
|
|
|
|
|
|
|
.apply { |
|
|
|
|
|
|
|
show() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Display the simple Toast message with the [Toast.LENGTH_LONG] duration. |
|
|
|
* Display the simple Toast message with the [Toast.LENGTH_LONG] duration. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param message the message text. |
|
|
|
* @param message the message text. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
inline fun Fragment.longToast(message: CharSequence) = requireActivity().longToast(message) |
|
|
|
inline fun Fragment.longToast(message: CharSequence) = requireActivity().longToast(message) |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Display the simple Toast message with the [Toast.LENGTH_LONG] duration. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param message the message text. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
inline fun Context.longToast(message: CharSequence): Toast = Toast |
|
|
|
|
|
|
|
.makeText(this, message, Toast.LENGTH_LONG) |
|
|
|
|
|
|
|
.apply { |
|
|
|
|
|
|
|
show() |
|
|
|
|
|
|
|
} |
|
|
|
|