Skip to content

Instantly share code, notes, and snippets.

View fabirt's full-sized avatar
💻
Learning

Fabian fabirt

💻
Learning
  • Colombia
View GitHub Profile
1. hiltvm (applicable in top-level)
@dagger.hilt.android.lifecycle.HiltViewModel
class $NAME$ @javax.inject.Inject constructor(
$PARAM$
) : androidx.lifecycle.ViewModel() {
$END$
}
2. vmstatefunc (applicable in class)
private val _$NAME$ = androidx.compose.runtime.mutableStateOf<$TYPE$>($INITIAL_VALUE$)
@fabirt
fabirt / README.md
Created April 28, 2021 18:55 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@fabirt
fabirt / YouTubeView.swift
Created April 3, 2021 19:52 — forked from Pobe16/YouTubeView.swift
YouTubeView UIViewRepresentable
import SwiftUI
import UIKit
import YouTubePlayer
final class YouTubeView: UIViewRepresentable {
typealias UIViewType = YouTubePlayerView
@ObservedObject var playerState: YouTubeControlState
@fabirt
fabirt / BorderModifier.kt
Created March 16, 2021 13:19 — forked from gildor/BorderModifier.kt
Example of border modifier for Jetpack Compose
import androidx.compose.runtime.Stable
import androidx.compose.ui.Modifier
import androidx.compose.ui.drawBehind
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Path
import androidx.compose.ui.graphics.drawscope.DrawScope
import androidx.compose.ui.unit.Dp
/**
* Border definition can be extended to provide border style or [androidx.compose.ui.graphics.Brush]