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 FlipActionScreen() { | |
var flippedState by remember { mutableStateOf(false) } | |
val rotationY by animateFloatAsState( | |
targetValue = if (flippedState) 180f else 0f, | |
animationSpec = spring( | |
dampingRatio = Spring.DampingRatioHighBouncy, | |
stiffness = Spring.StiffnessVeryLow | |
) | |
) |
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 androidx.compose.foundation.layout.Box | |
import androidx.compose.runtime.Composable | |
import androidx.compose.ui.Modifier | |
import androidx.compose.ui.draw.drawWithContent | |
import androidx.compose.ui.geometry.Offset | |
import androidx.compose.ui.graphics.BlendMode | |
import androidx.compose.ui.graphics.Color | |
import androidx.compose.ui.graphics.nativeCanvas | |
@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
import android.annotation.SuppressLint | |
import androidx.compose.animation.animateColor | |
import androidx.compose.animation.core.Animatable | |
import androidx.compose.animation.core.AnimationVector1D | |
import androidx.compose.animation.core.LinearEasing | |
import androidx.compose.animation.core.tween | |
import androidx.compose.animation.core.updateTransition | |
import androidx.compose.foundation.Image | |
import androidx.compose.foundation.gestures.detectTapGestures | |
import androidx.compose.foundation.layout.fillMaxSize |
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 des.c5inco.cardswipecompose | |
import androidx.compose.animation.core.Animatable | |
import androidx.compose.animation.core.CubicBezierEasing | |
import androidx.compose.animation.core.LinearOutSlowInEasing | |
import androidx.compose.animation.core.animateDpAsState | |
import androidx.compose.animation.core.animateFloatAsState | |
import androidx.compose.animation.core.calculateTargetValue | |
import androidx.compose.animation.core.keyframes | |
import androidx.compose.animation.splineBasedDecay |
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
private void savedBitmapFromViewToFile(){ | |
//inflate layout | |
View layout = LayoutInflater.from(this).inflate(R.layout.activity_main, null, false); | |
RelativeLayout mContImage = (RelativeLayout) layout.findViewById(R.id.image_cont); | |
//reference View with image | |
mContImage.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); | |
Bitmap bitmap = Bitmap.createBitmap(mContImage.getMeasuredWidth(), mContImage.getMeasuredHeight(), Bitmap.Config.ARGB_8888); | |
Canvas canvas = new Canvas(bitmap); | |
mContImage.layout(0, 0, mContImage.getMeasuredWidth(), mContImage.getMeasuredHeight()); |