Animated-Text-Kit icon indicating copy to clipboard operation
Animated-Text-Kit copied to clipboard

New Animation like Moving Letters Effect 15

Open awhitford opened this issue 4 years ago • 19 comments
trafficstars

@saurabhraj042 requested to add a new animated text like Effect 15

awhitford avatar Mar 11 '21 17:03 awhitford

@awhitford thanks for opening this issue , please assign it to me .

saurabhraj042 avatar Mar 11 '21 17:03 saurabhraj042

@awhitford I have a doubt like in the sample Effect 15 we have two separate Text elements, but in the animated-text kit package most of the animations work with single string at a time and I have been able to recreate Effect 15 for only one String at a time so I just want to confirm if that's we are planning to do .

saurabhraj042 avatar Mar 12 '21 07:03 saurabhraj042

Focus on the effect for 1 text element. What you are really animating is the zoom in effect.

You can consider that Effect 15 is actually TWO animated texts positioned side by side with a delay.

awhitford avatar Mar 12 '21 07:03 awhitford

@saurabhraj042 You can implement it with CustomPainter https://github.com/aagarwal1012/Animated-Text-Kit/blob/master/lib/src/wavy.dart is implemented using CustomPainter

It requires a lot of mathematical calculations but very customizable

SirusCodes avatar Mar 12 '21 07:03 SirusCodes

Uhm... Is a CustomPainter approach really necessary? Isn't this just a reverse Scale Animation? You can likely take the Scale Animation and make some adjustments.

awhitford avatar Mar 12 '21 07:03 awhitford

What I'm thinking is that user will pass a List<String> like ["Buy Now", "On Sale"]

The sequence of animation would be like.

  1. Buy scales in
  2. Now scales in
  3. Buy Now fades out
  4. On scales in
  5. and so on...

This would be better with CustomPainter

SirusCodes avatar Mar 12 '21 07:03 SirusCodes

Oh I realized with CustomPainter user would be able to manage duration of text showing up🤔

SirusCodes avatar Mar 12 '21 07:03 SirusCodes

@SirusCodes It would be wise to contain complexity. I also want to avoid baking too much complexity in a specific animation because a compositional approach that could be used for other animations is preferred.

The AnimatedText class is designed to animate one text string. If you want to string multiple texts, you then specify a List<AnimatedText> elements to AnimatedTextKit.

awhitford avatar Mar 12 '21 07:03 awhitford

@SirusCodes I would be wise to contain complexity. I also want to avoid baking too much complexity in a specific animation because a compositional approach that could be used for other animations is preferred.

Yaa I also feel that CustomPainter will over complicate the animation.

The AnimatedText class is designed to animate one text string. If you want to string multiple texts, you then specify a List<AnimatedText> elements to AnimatedTextKit.

What are you trying to say? AnimatedTextKit is already taking List<AnimatedText> as parameter🤔

SirusCodes avatar Mar 12 '21 07:03 SirusCodes

@awhitford https://codeshare.io/GqgYqX please review this code snippet, I tried keeping it simple and the animation was close to Effect 15

saurabhraj042 avatar Mar 12 '21 07:03 saurabhraj042

@saurabhraj042 can you open a PR with gif of that animation?

SirusCodes avatar Mar 12 '21 08:03 SirusCodes

What are you trying to say? AnimatedTextKit is already taking List<AnimatedText> as parameter🤔

AnimatedTextKit is a small example of a compositional approach because one can mix and match different AnimatedText subclasses.

To be even more clear...

  • My expectation for a new AnimatedText subclass is to animate one text value.
  • If we wanted to match exactly the Effect 15 example, there are 2 concepts that we need to account for:
    1. There are two text animations side by side. We can use a Row.
    2. The right animation is triggered with a bit of a delay. One could use DelayedDisplay -- or we should build something similar that could be used for any animation (not bake delay functionality into a specific animation).

I hope this helps clarify my earlier comments.

awhitford avatar Mar 12 '21 08:03 awhitford

Yes thanks now it's a lot clear 😃

SirusCodes avatar Mar 12 '21 08:03 SirusCodes

@awhitford https://codeshare.io/GqgYqX please review this code snippet, I tried keeping it simple and the animation was close to Effect 15

I think this is meeting my expectations. I'd have to see it in action to be sure, but it looks pretty good.

I wonder if we can come up with a better name for the effect than OutNow. It seems more like a "Zoom In" effect to me, but I'm definitely open to ideas here.

Also, I'm advocating that we do not make a corresponding Kit class for each new animation. (We have them for the old animations for backwards compatibility.)

awhitford avatar Mar 12 '21 08:03 awhitford

@awhitford I will do the changes and make a PR asap !

saurabhraj042 avatar Mar 12 '21 08:03 saurabhraj042

In addition to the new animation class...

  • the README needs to be updated with a sample screenshot of the animation. (I actually do not know how @aagarwal1012 did that -- that's why #202 was created.)
  • the example app needs to be updated to include the new animation.
  • we expect test coverage

awhitford avatar Mar 12 '21 08:03 awhitford

I wonder if we can come up with a better name for the effect than OutNow. It seems more like a "Zoom In" effect to me, but I'm definitely open to ideas here.

How about ZoomInFadeOut?

Also, I'm advocating that we do not make a corresponding Kit class for each new animation. (We have them for the old animations for backwards compatibility.)

Let's wait for the final words from admin.

SirusCodes avatar Mar 12 '21 08:03 SirusCodes

@awhitford What do you mean by test coverage ?

saurabhraj042 avatar Mar 12 '21 13:03 saurabhraj042

Also, I'm advocating that we do not make a corresponding Kit class for each new animation. (We have them for the old animations for backward compatibility.)

I agree with @awhitford, we don't need any kit class from now on.

ZoomInFadeOut looks fine to me @SirusCodes . 😅

aagarwal1012 avatar Mar 12 '21 13:03 aagarwal1012