This file contains 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
import androidx.lifecycle.get | |
import androidx.lifecycle.ViewModel | |
import androidx.lifecycle.ViewModelProvider | |
import androidx.lifecycle.ViewModelStore | |
import androidx.lifecycle.ViewModelStoreOwner | |
/** | |
* Returns a property delegate to access the wrapped value, which will be retained for the | |
* duration of the lifecycle of this [ViewModelStoreOwner]. | |
* |
This file contains 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
sealed class Resource<T> { | |
data class Loading<T>(val data: T? = null, val message: Int? = null) : Resource<T>() | |
data class Success<T>(val data: T) : Resource<T>() | |
data class Error<T>(val throwable: Throwable?, val data: T? = null) : Resource<T>() | |
} | |
fun <T> Resource<T>.dataOrNull(): T? = when (this) { | |
is Resource.Loading -> data | |
is Resource.Success -> data | |
is Resource.Error -> data |
This file contains 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
#!/bin/bash | |
APP_DIR=$1 | |
APP_SCRIPT_NAME="$(ls "${APP_DIR}/Contents/MacOS/")" | |
APP_FILE_NAME="$(basename "${APP_DIR}")" | |
CHANNEL_DIR="$(dirname "$(dirname "$1")")" | |
CHANNEL_NAME="$(basename "$CHANNEL_DIR")" | |
TOOLBOX_APP_NAME="$(basename "$(dirname "$CHANNEL_DIR")")" |
This file contains 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
import androidx.compose.foundation.Canvas | |
import androidx.compose.foundation.layout.Arrangement | |
import androidx.compose.foundation.layout.Column | |
import androidx.compose.foundation.layout.Row | |
import androidx.compose.foundation.layout.fillMaxWidth | |
import androidx.compose.foundation.layout.padding | |
import androidx.compose.foundation.layout.size | |
import androidx.compose.material.Slider | |
import androidx.compose.material.Surface | |
import androidx.compose.material.Text |
OlderNewer