This file contains hidden or 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.example.simpleegl | |
import android.app.ActivityManager | |
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 |
This file contains hidden or 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
@OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class) | |
@Composable | |
fun TestCropImage() { | |
val context = LocalContext.current | |
val cropView = remember { | |
CropImageView(context).apply { | |
isAutoZoomEnabled = false | |
cropShape = CropImageView.CropShape.RECTANGLE |
This file contains hidden or 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 AnimatedBorderCard( | |
modifier: Modifier = Modifier, | |
shape: Shape = RoundedCornerShape(size = 0.dp), | |
borderWidth: Dp = 2.dp, | |
gradient: Brush = Brush.sweepGradient(listOf(Color.Gray, Color.White)), | |
animationDuration: Int = 10000, | |
onCardClick: () -> Unit = {}, | |
content: @Composable () -> Unit | |
) { |
This file contains hidden or 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 androidx.compose.animation.AnimatedVisibility | |
import androidx.compose.animation.fadeIn | |
import androidx.compose.animation.fadeOut | |
import androidx.compose.foundation.Canvas | |
import androidx.compose.foundation.layout.size | |
import androidx.compose.foundation.lazy.LazyListState | |
import androidx.compose.runtime.Composable | |
import androidx.compose.runtime.DisposableEffect | |
import androidx.compose.runtime.derivedStateOf | |
import androidx.compose.runtime.getValue |
This file contains hidden or 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 androidx.compose.foundation.ExperimentalFoundationApi | |
import androidx.compose.foundation.gestures.snapping.rememberSnapFlingBehavior | |
import androidx.compose.foundation.layout.Box | |
import androidx.compose.foundation.layout.fillMaxWidth | |
import androidx.compose.foundation.layout.height | |
import androidx.compose.foundation.layout.offset | |
import androidx.compose.foundation.lazy.LazyColumn | |
import androidx.compose.foundation.lazy.rememberLazyListState | |
import androidx.compose.material3.Divider | |
import androidx.compose.material3.LocalContentColor |
This file contains hidden or 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.example.myapp.animation | |
import androidx.compose.animation.core.* | |
import androidx.compose.foundation.Image | |
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 | |
import androidx.compose.foundation.layout.size |
This file contains hidden or 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 nz.co.electricbolt.firebase; | |
import android.content.res.AssetFileDescriptor; | |
import android.content.res.ColorStateList; | |
import android.content.res.Configuration; | |
import android.content.res.Resources; | |
import android.content.res.TypedArray; | |
import android.content.res.XmlResourceParser; | |
import android.graphics.Movie; | |
import android.graphics.Typeface; |
This file contains hidden or 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
1. hiltvm (applicable in top-level) | |
@dagger.hilt.android.lifecycle.HiltViewModel | |
class $NAME$ @javax.inject.Inject constructor( | |
$PARAM$ | |
) : androidx.lifecycle.ViewModel() { | |
$END$ | |
} | |
2. vmstatefunc (applicable in class) | |
private val _$NAME$ = androidx.compose.runtime.mutableStateOf<$TYPE$>($INITIAL_VALUE$) |
This file contains hidden or 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 FlowRow( | |
horizontalGap: Dp = 0.dp, | |
verticalGap: Dp = 0.dp, | |
alignment: Alignment.Horizontal = Alignment.Start, | |
content: @Composable () -> Unit, | |
) = Layout(content = content) { measurables, constraints -> | |
val horizontalGapPx = horizontalGap.toPx().roundToInt() | |
val verticalGapPx = verticalGap.toPx().roundToInt() |
This file contains hidden or 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
class MainFragment : Fragment(R.layout.main_fragment) { | |
companion object { | |
fun newInstance() = MainFragment() | |
} | |
private lateinit var viewModel: MainViewModel | |
override fun onCreate(savedInstanceState: Bundle?) { |
NewerOlder