Skip to content

Instantly share code, notes, and snippets.

View alejandro-rios's full-sized avatar

Alejandro Rios alejandro-rios

  • Medellin, Colombia
View GitHub Profile
@alejandro-rios
alejandro-rios / HelloDagger2.kt
Last active September 14, 2019 21:36
Basic Hello World with Dagger 2
class Info(val text: String)
// Module
@Module
class Bag {
@Provides
fun sayHelloDagger2(): Info {
return Info("Hello Dagger 2")
}
}
@alejandro-rios
alejandro-rios / HelloKatana.kt
Last active September 13, 2019 18:54
Basic Hello World with Katana
class Info(val text: String)
// Module
val bag = Module {
singleton { Info("Hello Katana") }
}
// MainActivity
class MainActivity : AppCompatActivity() {
@alejandro-rios
alejandro-rios / HelloKodein.kt
Last active September 13, 2019 18:56
Basic Hello World with Kodein
class Info(val text: String)
// Module
val bag = Kodein.Module("module name") {
bind<Info>() with provider { Info("Hello Kodein") }
}
// MainActivity
class MainActivity : AppCompatActivity(), KodeinAware {
class MainActivity : AppCompatActivity() {
private val viewModel: NetworkStatusViewModel by lazy {
ViewModelProvider(
this,
object : ViewModelProvider.Factory {
override fun <T : ViewModel?> create(modelClass: Class<T>): T {
val networkStatusTracker = NetworkStatusTracker(this@MainActivity)
return NetworkStatusViewModel(networkStatusTracker) as T
}
@alejandro-rios
alejandro-rios / gist:e1bddb45da5dd97c572bea7cde594a38
Created January 5, 2022 21:06
Missing translations for Ucranian language Habitica
Tasks
Skills
Social
Messages
Messages
Party
Purchase Gems
Subscription
Guilds
Challenges