Skip to content

Instantly share code, notes, and snippets.

@sofakingforever
sofakingforever / Analytics.kt
Last active February 14, 2019 22:11
Writing SOLID Analytics With Kotlin for Android - Check out the UPDATED GitHub Repo: https://github.com/sofakingforever/kotlin-analytics/
package com.sofakingforever.analytics
// This code demonstrates how you could (should) decouple analytics libraries
// (or anything else) from your business logic code,
// effectively allowing you to add & remove analytics services on-the-fly.
// https://medium.com/@nadavfima/how-to-build-better-analytics-with-kotlin-60ab50ce25ac
class Analytics(private vararg val dispatchers: AnalyticsDispatcher) {
@sofakingforever
sofakingforever / AnimatedStarsView.kt
Last active February 3, 2022 09:21
Draw animated stars on Android view canvas - written in Kotlin - crafted with ❤️ by sofakingforever
package com.sofaking.moonworshipper.view
import android.content.Context
import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.RectF
import android.util.AttributeSet
import android.view.View
import java.util.*
import java.util.concurrent.Executors