This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.os.Bundle | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.RememberObserver | |
import androidx.compose.runtime.remember | |
import androidx.lifecycle.* | |
import androidx.lifecycle.viewmodel.CreationExtras | |
import androidx.lifecycle.viewmodel.MutableCreationExtras | |
import androidx.lifecycle.viewmodel.compose.LocalViewModelStoreOwner | |
import androidx.lifecycle.viewmodel.compose.viewModel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package io.github.darvld.utils | |
import androidx.compose.animation.* | |
import androidx.compose.animation.core.ExperimentalTransitionApi | |
import androidx.compose.animation.core.MutableTransitionState | |
import androidx.compose.foundation.lazy.LazyListScope | |
import androidx.compose.foundation.lazy.items | |
import androidx.compose.runtime.* | |
import androidx.recyclerview.widget.AsyncListDiffer | |
import androidx.recyclerview.widget.DiffUtil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun SweepGradientImage( | |
imgResId: Int, | |
maxImgSize: Dp = 250.dp, | |
maxImgRotation: Float = -10f | |
) { | |
var animationPlayed by remember { mutableStateOf(false) } | |
val lineOffset by animateFloatAsState( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class Place( | |
val name: String, | |
val resId: Int | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.vishal2376.animations | |
import androidx.compose.animation.Crossfade | |
import androidx.compose.animation.core.animateFloatAsState | |
import androidx.compose.animation.core.tween | |
import androidx.compose.foundation.ExperimentalFoundationApi | |
import androidx.compose.foundation.Image | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.layout.Arrangement | |
import androidx.compose.foundation.layout.Box |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.vishal2376.animations.ui.theme | |
import androidx.compose.animation.animateColorAsState | |
import androidx.compose.animation.core.EaseInOut | |
import androidx.compose.animation.core.animateFloatAsState | |
import androidx.compose.animation.core.tween | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.clickable | |
import androidx.compose.foundation.layout.Arrangement | |
import androidx.compose.foundation.layout.Box |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.reactivex.subjects.PublishSubject | |
import kotlinx.coroutines.CoroutineDispatcher | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.delay | |
import kotlinx.coroutines.flow.Flow | |
import kotlinx.coroutines.flow.flowOn | |
import kotlinx.coroutines.launch | |
import kotlinx.coroutines.newSingleThreadContext | |
import kotlinx.coroutines.suspendCancellableCoroutine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface SettingsSectionScope { | |
fun item( | |
icon: ImageVector? = null, | |
title: String, | |
subtitle: String? = null, | |
endSlot: @Composable () -> Unit = { }, | |
onClick: (() -> Unit)? = null, | |
) | |
@Composable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun ComponentContext.componentCoroutineScope(): CoroutineScope { | |
val scope = CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate) | |
if (lifecycle.state != Lifecycle.State.DESTROYED) { | |
lifecycle.doOnDestroy { | |
scope.cancel() | |
} | |
} else { | |
scope.cancel() | |
} |
NewerOlder