Skip to content

Instantly share code, notes, and snippets.

View FunkyMuse's full-sized avatar
🛸
Frying sauces

FunkyMuse

🛸
Frying sauces
View GitHub Profile
@FunkyMuse
FunkyMuse / AssistedInjectPrefsSamle.kt
Created October 19, 2021 08:24
AssistedInject prefs sample
@FragmentScoped
class WalkThroughPrefsProvider @Inject constructor(
private val oneTimePrefFactory: OneTimePref.OneTimePrefFactory
) : OneTimePrefContract by oneTimePrefFactory.create(
WALK_THROUGH_PREFS,
WALK_THROUGH_PREFS_SHOWN_KEY
) {
private companion object {
@FunkyMuse
FunkyMuse / RealmKeyHelper.kt
Created March 18, 2020 12:53
RealmKeyHelper
class KeyHelper<E : RealmModel?>(var classFrom: Class<E>) {
fun getIds(db: Realm, idName: String): IdModel {
val idHelper = RealmIdModel()
val currentID = db.where(classFrom).max(idName)