This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Singleton that contains all `@TypeConverter`s of the app. | |
Mark all inner converters with `@JvmStatic` so Room can use them as regular static functions | |
*/ | |
object Converters { | |
@TypeConverter | |
@JvmStatic | |
fun convertDateFrom(value: Date?): Long? = value?.time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Related SO question: https://stackoverflow.com/questions/47990179/round-corners-itemdecoration/48003946 | |
*/ | |
public class AttachmentMediaCornersDecoration extends RecyclerView.ItemDecoration { | |
private final float radius; | |
private final RectF defaultRectToClip; | |
private final List<Integer> allowedViewTypes = Arrays.asList( | |
AttachmentImageViewItem.VIEW_TYPE, | |
AttachmentVideoViewItem.VIEW_TYPE, | |
AttachmentBlurViewItem.VIEW_TYPE); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
suspend fun <T> Call<T>.await(): T = suspendCancellableCoroutine { cont -> | |
cont.invokeOnCompletion { cancel() } | |
enqueue(object : Callback<T> { | |
override fun onFailure(call: Call<T>, t: Throwable) { | |
cont.resumeWithException(t) | |
} | |
override fun onResponse(call: Call<T>, response: Response<T>) { | |
if (response.isSuccessful) { | |
cont.resume(response.body()!!) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "Run game", | |
"type": "shell", | |
"command": "PATH_TO_YOUR_GADOT_EXEC", // <---- | |
"args": [ | |
"--path", | |
"${workspaceFolder}", |