Skip to content

Instantly share code, notes, and snippets.

View T8RIN's full-sized avatar
💻
Coding...

Malik Mukhametzyanov T8RIN

💻
Coding...
View GitHub Profile
import android.annotation.SuppressLint
import androidx.compose.animation.core.FastOutSlowInEasing
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.clickable
@T8RIN
T8RIN / DeclarativeModalBottomSheet.kt
Created February 3, 2025 10:39 — forked from makeevrserg/DeclarativeModalBottomSheet.kt
DeclarativeModalBottomSheet
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.imePadding
@T8RIN
T8RIN / HashUtils.kt
Created December 30, 2024 21:55 — forked from LongClipeus/HashUtils.kt
How to generate checksum hash for a file in Kotlin
import StringUtils.encodeHex
import java.io.File
import java.io.FileInputStream
import java.io.InputStream
import java.security.MessageDigest
object HashUtils {
const val STREAM_BUFFER_LENGTH = 1024
@T8RIN
T8RIN / OpenGLESResizeRenderPass.kt
Created November 22, 2024 20:50 — forked from awxkee/OpenGLESResizeRenderPass.kt
Resing methods OpenGL
package com.android.example.rsmigration
import android.content.Context
import android.graphics.Bitmap
import android.opengl.EGL14
import android.opengl.EGL15
import android.opengl.EGLConfig
import android.opengl.EGLContext
import android.opengl.EGLDisplay
import android.opengl.EGLExt
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.platform.LocalLifecycleOwner
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewmodel.compose.LocalViewModelStoreOwner
import androidx.lifecycle.viewmodel.compose.viewModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
package androidx.lifecycle
internal object ViewModelClearer {
fun ViewModel.clearViewModel() = clear()
fun <T : Any?> T.getPrivateProperty(variableName: String): Any? {
if (this == null) return null
return javaClass.getDeclaredField(variableName).let { field ->
field.isAccessible = true
import androidx.compose.runtime.Composable
import androidx.lifecycle.*
import androidx.lifecycle.ViewModelClearer.clearViewModel
import androidx.lifecycle.ViewModelClearer.getPrivateProperty
import androidx.lifecycle.ViewModelClearer.setAndReturnPrivateProperty
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import java.util.concurrent.ConcurrentSkipListSet