Тёмный

Animations Introduction (Jetpack Compose) 

CodingWithMitch
Подписаться 145 тыс.
Просмотров 8 тыс.
50% 1

The BEST android courses in the world: codingwithmitch.com/
In this video I give you an introduction to animations with jetpack compose. Animations are tricky and there isn't much information out there (yet) because compose is so new. Hopefully this gives you the building blocks you need to build your own animations with compose.
Code: github.com/mitchtabian/MVVMRe...
Follow me:
Instagram: / codingwithmitch
Twitter: / mitch_tabian
.
.

Наука

Опубликовано:

 

31 дек 2020

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 39   
@jamesaidoo
@jamesaidoo 2 года назад
Thanks Mitch for this series. I'm learning compose by following this. I like it more this way because some of the things you use are no longer available, or have been simplified, which makes me find the new way to get it done. I love the challenge. For instance, high level animation APIs have been introduced to achieve this animation with much simplicity. Thanks again.
@juangax100
@juangax100 3 года назад
For those using the compose version 1.0.0-beta05 this is how i could make the animation work, my PulsingDemo.kt is: import androidx.compose.animation.core.* import androidx.compose.foundation.Canvas import androidx.compose.foundation.Image import androidx.compose.foundation.layout.* import androidx.compose.material.MaterialTheme import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Favorite import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.SolidColor import androidx.compose.ui.unit.dp @Composable fun PulsingDemo() { val color = MaterialTheme.colors.primary val infiniteTransition = rememberInfiniteTransition() val pulseMagnitude by infiniteTransition.animateFloat( initialValue = PulseAnimationDefinitions.PULSE_STATE_INITIAL, targetValue = PulseAnimationDefinitions.PULSE_STATE_FINAL, animationSpec = infiniteRepeatable( animation = tween(500, easing = FastOutSlowInEasing), repeatMode = RepeatMode.Restart ) ) Row( modifier = Modifier .fillMaxWidth() .height(55.dp), horizontalArrangement = Arrangement.Center ) { Image( modifier = Modifier .align(Alignment.CenterVertically) .height(pulseMagnitude.dp) .width(pulseMagnitude.dp), imageVector = Icons.Default.Favorite, contentDescription = "") } Canvas( modifier = Modifier .fillMaxWidth() .height(55.dp) ) { drawCircle( radius = pulseMagnitude, brush = SolidColor(color) ) } } object PulseAnimationDefinitions{ const val PULSE_STATE_INITIAL = 40f const val PULSE_STATE_FINAL = 50f }
@vengateshm2122
@vengateshm2122 3 года назад
New year new day gift from mitch with a heart animation.
@smokey4587
@smokey4587 3 года назад
I just came to show you some support and to give you a like. Don't stop doing this, it's very helpful 🤝
@muhammedshahin6299
@muhammedshahin6299 Год назад
Thank you, mitch
@tomandjerryofficial2030
@tomandjerryofficial2030 3 года назад
New Year Engagement. Love it when he isn't that well knowledgeable in animation but makes a video for us. Thanks, Mitch.
@AyorindeAdesugba
@AyorindeAdesugba 3 года назад
Happy new year Mitch 👏
@fixitman5453
@fixitman5453 Месяц назад
Thanks, Mitch! That helped a lot
@shivamsethi3829
@shivamsethi3829 3 года назад
Great content, happy new year
@Shoan3D
@Shoan3D 3 года назад
For a beginner course, I didn't think you would do animations..hehe Thanks a lot Mitch, for animation tutorial. I thought wrong again, I thought you would do animateTo or animateFloat API, first. I think the transition API was the most challenging for me to wrap my head around, understand when you said that you can do a course just on Animations. Grateful for the explanation.
@johnybaby9574
@johnybaby9574 3 года назад
Thanks for your great courses! really
@Hacker-x
@Hacker-x 3 года назад
This time I am watching video while having lunch😋. Thanks Mitch, clear explanation.. Following from Oman. 😎
@ChrisAthanas
@ChrisAthanas 3 года назад
Hoisting the main sails over the sea of composables, final destination? Land of 100k
@ranasaad8583
@ranasaad8583 3 года назад
13:30 thank god you are making this series for us.
@randafahmy9688
@randafahmy9688 3 года назад
Yaaaaaaay I was waiting for this videoooo
@codingwithmitch
@codingwithmitch 3 года назад
Tomorrow is another one on animations
@terencejumba1939
@terencejumba1939 2 года назад
very nice courses
@MrVarsium
@MrVarsium 3 года назад
nice Corona bear @Mitch !
@danyelsh874
@danyelsh874 2 года назад
awesome!
@bakytdjumabaev469
@bakytdjumabaev469 3 года назад
great video!
@hugosalazar6911
@hugosalazar6911 3 года назад
Nice
@Shoan3D
@Shoan3D 3 года назад
Animating engagement
@tonnie7079
@tonnie7079 2 года назад
Not sure if this is an engagement or a question. I got "Unresolved reference: FloatPropKey" and could not follow through the video. I suspect this has been removed as I cannot find any reference of it in the docs. Anyway, I found a workaround.
@abrarwiryawan
@abrarwiryawan 3 года назад
When was floatpropkey got deprecated? I cant found it anywhere
@bboydarknesz
@bboydarknesz 3 года назад
I found it by following this mitch man video, ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-hLERtWC1THw.html @Composable fun PulsingDemo() { val color = MaterialTheme.colors.primary val infiniteTransition = rememberInfiniteTransition() val pulseState = infiniteTransition.animateFloat( initialValue = 40f, targetValue = 50f, animationSpec = infiniteRepeatable( animation = tween( durationMillis = 500, easing = FastOutSlowInEasing ), repeatMode = RepeatMode.Restart ) ) Row( modifier = Modifier .fillMaxWidth() .height(55.dp), horizontalArrangement = Arrangement.Center ) { Image( imageVector = Icons.Default.Favorite, modifier = Modifier.align(CenterVertically) .height(pulseState.value.dp) .width(pulseState.value.dp), contentDescription = null ) } Canvas(modifier = Modifier .fillMaxWidth() .height(55.dp)) { drawCircle( radius = pulseState.value, brush = SolidColor(color) ) } }
@uwaisalqadri6703
@uwaisalqadri6703 3 года назад
cool
@VivekSharma-qw5ky
@VivekSharma-qw5ky 3 года назад
If you guys don't get the import of infiniteRepeatable(), because I didn't get it and searched for that function in TransitionDefinition Class and didn't find it too Use this 👇 pulsePropKey using repeatable( iterations = AnimationConstants.Infinite, animation = tween( durationMillis = 500, easing = FastOutSlowInEasing ), repeatMode = RepeatMode.Restart ) Don't know why I didn't get it, maybe deprecated or something "Compose Things" , Anyone else didn't get it?
@raheemadamboev
@raheemadamboev 3 года назад
I didn't find any animation functions used in the video
@theapache64
@theapache64 3 года назад
Mitch, do we have an official documentation on compose animations?
@codingwithmitch
@codingwithmitch 3 года назад
No it changed again recently. I'll do another update video soon prob. The devs say it shouldn't change too much anymore.
@mehraanakbarii
@mehraanakbarii 3 года назад
Man, i have the experience working with flutter, i am started learning android, should i start learning with jetpack compose ?
@codingwithmitch
@codingwithmitch 3 года назад
The more you know the better generally
@mehraanakbarii
@mehraanakbarii 3 года назад
@@codingwithmitch so u mean learning how to program with xml and layouts is better before start learning compose ? You know i switched from Flutter to native for understanding architectures , i didn't understand Flutter's declarative ui architecture (called bloc) 🤔
@mukeshcse3131
@mukeshcse3131 3 года назад
Happy Pongal(harvest celebration) engagement
@VivekSharma-qw5ky
@VivekSharma-qw5ky 3 года назад
Your screen kinda flickering, when the suggestion window pops up, take a look in the video
@codingwithmitch
@codingwithmitch 3 года назад
Ya it's compose not my screen. I don't know why but the ide looks like it's flickering sometimes
@gillesjack9619
@gillesjack9619 3 года назад
Great starting point for animation. Thanks Mitch. I tried to port this code on "Compose for Desktop". It works if I don't repeat the animation (pulsePropKey using tween) but when I try to repeat infinitely, "infiniteRepeatable" can't be imported. I may miss a dependency or it is not supported yet but if anymore have a solution to this issue, please let us know. Thanks (gist.github.com/u2gilles/30401e93b5d946517fcf58bf7fc1c74f#file-anim01-kt)
@speedboy93640
@speedboy93640 2 года назад
Anime Engagement
Далее
Heart Animation with Jetpack Compose (Toggle Likes)
23:30
Shimmer Loading Animation with Jetpack Compose
43:24
Просмотров 10 тыс.
ОСКАР И ДЖОНИ БРОСИЛИ НАС 😭
01:00
Dark Theme and Light Theme (Jetpack Compose)
31:14
Просмотров 18 тыс.
DO NOT do this in a Software Engineering Interview
7:59
The perfect imperfection of Google's Material You
15:47
🛑 STOP! SAMSUNG НЕ ПОКУПАТЬ!
1:00
Просмотров 360 тыс.
Так ли Хорош Founders Edition RTX 4080 ?
13:00