Skip to content

Instantly share code, notes, and snippets.

View alaegin's full-sized avatar
🏠
Working from home

Alex Egin alaegin

🏠
Working from home
View GitHub Profile
/*
* Copyright 2025 Kyriakos Georgiopoulos
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
/*
* Copyright 2025 Kyriakos Georgiopoulos
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@alaegin
alaegin / TreeComponent.kt
Created April 16, 2025 15:36 — forked from fabiosassu/TreeComponent.kt
Possible implementation of a tree component
package com.example.treecomponent
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
@alaegin
alaegin / pager_example.txt
Created April 24, 2024 13:40 — forked from tasjapr/pager_example.txt
Accompanist pager with coil preloading and indicator
BoxWithConstraints {
val boxWithConstraintsScope = this
val height = (boxWithConstraintsScope.maxWidth - AppTheme.dimensions.padding_16 * 2) / 16 * 9 // Banner width to height ratio should be 16:9
val context = LocalContext.current
val density = LocalDensity.current
ConstraintLayout {
val (pager, indicator) = createRefs()
@alaegin
alaegin / MultiChildStack.kt
Created February 13, 2024 08:41 — forked from aartikov/MultiChildStack.kt
multiChildStack for Decompose
package ru.mobileup.template.core.utils
import com.arkivanov.decompose.Child
import com.arkivanov.decompose.ComponentContext
import com.arkivanov.decompose.router.stack.ChildStack
import com.arkivanov.decompose.router.stack.StackNavigationSource
import com.arkivanov.decompose.router.stack.childStack
import com.arkivanov.decompose.value.MutableValue
import com.arkivanov.decompose.value.Value
import com.arkivanov.essenty.lifecycle.Lifecycle
@alaegin
alaegin / PageLoadStates.kt
Created January 9, 2024 10:28 — forked from tadfisher/PageLoadStates.kt
Basic paging
sealed class PageLoadState(val endOfDataReached: Boolean) {
   data class Error(val error: Throwable) : PageLoadState(false) {
       override fun toString(): String = "Error(error=$error"
   }
   sealed class NotLoading(endOfDataReached: Boolean) : PageLoadState(endOfDataReached) {
       object Complete : NotLoading(true) {
           override fun toString(): String = "Complete"
       }
@alaegin
alaegin / ExposedArrayColumnType.kt
Created January 5, 2024 08:37 — forked from frynet/ExposedArrayColumnType.kt
ExposedSQL: Support for PostgreSQL array column type
import org.jetbrains.exposed.sql.*
import org.jetbrains.exposed.sql.statements.jdbc.JdbcConnectionImpl
import org.jetbrains.exposed.sql.transactions.TransactionManager
import org.jetbrains.exposed.sql.vendors.PostgreSQLDialect
import org.jetbrains.exposed.sql.vendors.currentDialect
import org.postgresql.jdbc.PgArray
inline fun <reified T : Any> Table.listColumn(name: String): Column<List<T>> {
@alaegin
alaegin / CompositeParameterProvider.kt
Created December 22, 2023 09:34 — forked from mrmans0n/CompositeParameterProvider.kt
Simple example that allows you to add 2 PreviewParameterProviders to a Compose preview
import androidx.compose.ui.tooling.preview.PreviewParameterProvider
import kotlin.reflect.KClass
/**
* Creates a [PreviewParameterProvider] based on the classes of two existing providers.
*
* You can create your own easily with Kotlin delegation:
* ```
* class ExampleProvider : PreviewParameterProvider<Pair<Type1, Type2>>
* by compositeProvider(Type1ParameterProvider::class, Type2ParameterProvider::class)
@alaegin
alaegin / AnimationBlurEffect.kt
Created December 20, 2023 09:37 — forked from rodrigomartind/AnimationBlurEffect.kt
Animation Blur Effect in Jetpack Compose
import androidx.compose.animation.core.RepeatMode
import androidx.compose.animation.core.animateFloat
import androidx.compose.animation.core.infiniteRepeatable
import androidx.compose.animation.core.rememberInfiniteTransition
import androidx.compose.animation.core.tween
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.offset