Android simulated 3G sports portal client event icons surfaced

Source: Internet
Author: User

Recently, when I was playing the 3G sports portal client, I saw the following effect: by clicking the event icon, there will be a larger icon ., very interesting. so I made a copy of it.

This is the source image:

In fact, a scaling animation is added to the icon touch event. The Code is as follows.

Package COM. test; import android. app. activity; import android. OS. bundle; import android. view. motionevent; import android. view. view; import android. view. view. ontouchlistener; import android. view. animation. animation; import android. view. animation. scaleanimation; import android. widget. button; public class animationbuttonactivity extends activity {@ override public void oncreate (bundle savedinstancestate) {super. oncreate (savedinstancestate); setcontentview (R. layout. main); Final button test = (button) findviewbyid (R. id. test_bt); // float F1 = 1.0f; // float F2 = 1.3f; // Int J = 1; // float F3 = 0.5f; // parameter description: // scaling size on X coordinate at the start of Float fromx animation // scaling size on X coordinate at the end of Float tox animation // scaling size on Y coordinate at the start of Float fromy animation/ /scaling size on Y coordinate at the end of Float toy animation // the start position of the int ready txtype animation on the X axis relative to the object position type/float ready txvalue animation relative to the X coordinate of the object // int ready tytype animation in Y axis relative to object position type // float ready tyvalue animation relative to object y coordinate start position final animation logoanimation = new scaleanimation (1.0f, 1.3f, 1.0f, 1.3f, 1, 0.5f, 1, 0.5f); // set the animation interval logoanimation. setduration (100l); test. setontouchlistener (New ontouchlistener () {@ overridepublic Boolean ontouch (view V, motionevent event) {// start the animation test. startanimation (logoanimation); Return false ;}});}}

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.