Skip to content

Instantly share code, notes, and snippets.

View leshchenko's full-sized avatar

Ruslan Leshchenko leshchenko

  • Ukraine, Cherkassy
View GitHub Profile
@leshchenko
leshchenko / ColoredShadow.kt
Created September 30, 2021 15:19 — forked from cedrickring/ColoredShadow.kt
Draw a colored shadow in Android Jetpack Compose
import androidx.compose.ui.Modifier
import androidx.compose.ui.drawBehind
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Paint
import androidx.compose.ui.graphics.drawscope.drawIntoCanvas
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
fun Modifier.drawColoredShadow(
color: Color,
@leshchenko
leshchenko / NetworkError.kt
Created August 30, 2019 08:33
NetworkError
import com.google.gson.Gson
import com.swishhoop.util.TLog
import retrofit2.HttpException
import java.io.IOException
import java.net.ConnectException
import java.net.SocketTimeoutException
import java.net.UnknownHostException
import kotlin.reflect.KClass
/**
@leshchenko
leshchenko / Bitmask.kt
Created July 29, 2019 08:26
Bitmask filtering
class Bitmask(
mask: Int
) {
private var bitmask = mask
val mask: Int
get() = bitmask
constructor() : this(0)