Similar Little Red Book label effect (motion Tween)

Source: Internet
Author: User

Yesterday, the eldest boss to decorate a task for our app to do the research, the app has a label exists, similar to the small red Book and Nice's tagging mode, so I try to make that flash a flash of the Mark Point ~

Looking closely at the glittering label of the Little Red Book, came to the conclusion that it was an animated

All right, this is nonsense.

In fact, at the beginning of my thinking is take doctrine, went online to find similar "Little Red Book Tag effect" and so on, and then I found that they use a custom control to complete a such animation. That's it, I'm gorgeous, and I'm just, uh, uh.

Custom controls I'm not familiar with it!!

Learn.

It took half an afternoon to study the custom control, and it was hard to write the animation effect.

The principle of this effect is like this:

Draw a circle with a brush, and use the thread to control the radius of the circle and the transparency of the view.

Wow, so happy oh ~ I made out, oh da.

Excited to use this custom control in my app, unfortunately, the first time when the view is loaded, it does not show that the control window focus state changes once will be displayed, heart plug Ah!! What do we do?

Asked the predecessor, said is the view drawing the question, should be the thread question.

No way, let's change the train of thought.

Isn't there an animation in Android? Give it a try?

So, today, I started researching animations in Android.

I used a motion tween to control the zoom and transparency of an image.

Soon reached the effect I wanted, bang Bang, sparkling mark point to go to the battle, feel the entire app page is alive!!

In fact, particularly simple:

The animation code is as follows:

<?xml version="1.0"encoding="Utf-8"?><SetXmlns:android="http://schemas.android.com/apk/res/android"Android:repeatcount="Infinite">//android:repeatcount="infinite"   Sets the number of animations to repeat (InfiniteRepeat countless times) <scale//Zoom Android:fromxscale="1.0"//Fromxscale,fromyscale The view size at the start of the animation (1.0 indicates the original size) Android:fromyscale="1.0"Android:toxscale="4.0"//Toxscale,toyscale view magnification Android:toyscale="4.0"Android:pivotx="50%"//pivotx,pivoty animation start Datum ( all set to 50% in the center )  android:pivoty="50%"Android:repeatcount="Infinite"android:duration=" +"/>//Duration Animation Duration<Alpha//Transparency Android:fromalpha="1.0"Android:toalpha="0.0"Android:repeatcount="Infinite"android:duration=" +"/> </Set>

Then, to the white dot (imageview) set on this animation can appear in the circle from small to large, gradually transparent effect, like superimposed on it to add a constant white point is a shiny label ~

is not very simple ~

PS: Yesterday my brain was kicked by a donkey. Custom Controls ...

Similar Little Red Book label effect (motion Tween)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.