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
@Database(entities = arrayOf(Note::class, User::class), version = 1) | |
@TypeConverters(Converters::class) | |
abstract class AppDatabse : RoomDatabase() { | |
abstract fun userDAO(): UserDAO | |
abstract fun noteDAO(): NoteDAO | |
} |
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
def parseCommitTxt(commit) { | |
def commitPattern = /^(feat|fix|docs|ci|style|refactor|test|chore)(?:\((.+)\))?: (.+)$/ | |
def commitBody = "git show -s ${commit} --pretty=format:%b".execute().text | |
def commitMsg = commitBody.split("See merge request")[0].trim() | |
def type, scope, subject | |
try { | |
def (_, t, sc, s) = (commitMsg =~ commitPattern)[0] | |
type = t | |
scope = sc | |
subject = s |
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
fun RemoteImage(uri: String, modifier: Modifier = Modifier, default: @Composable () -> Unit) { | |
val bitmapState = remember { mutableStateOf<Bitmap?>(null) } | |
Glide.with(AmbientContext.current).asBitmap().load(uri).into( | |
object : CustomTarget<Bitmap>() { | |
override fun onResourceReady(resource: Bitmap, transition: Transition<in Bitmap>?) { | |
bitmapState.value = resource | |
} | |
override fun onLoadCleared(placeholder: Drawable?) { | |
} |