Android phone defender 11--form pop-up Popupwindow

Source: Internet
Author: User

protected void Showpopupwindow (view view) {View Popupview = View.inflate (this, r.layout.popupwindow_layout, null); TextView Tv_uninstall = (TextView) Popupview.findviewbyid (R.id.tv_uninstall); TextView Tv_start = (TextView) Popupview.findviewbyid (R.id.tv_start); TextView Tv_share = (TextView) Popupview.findviewbyid (r.id.tv_share); Tv_uninstall.setonclicklistener (this); tv_ Start.setonclicklistener (This), Tv_share.setonclicklistener (this);//Transparent animation (Transparent---> Opaque) alphaanimation Alphaanimation = new Alphaanimation (0, 1); alphaanimation.setduration (+); Alphaanimation.setfillafter (true);// Zoom animation Scaleanimation scaleanimation = new Scaleanimation (0, 1, 0, 1, animation.relative_to_self, 0.5f, animation.relative_ To_self, 0.5f); scaleanimation.setduration (+); Alphaanimation.setfillafter (true);//Animation collection Setanimationset Animationset = new Animationset (true);//Add two animation animationset.addanimation (alphaanimation); animationset.addanimation (scaleanimation);//1, create Form object, specify width Mpopupwindow = new Popupwindow (Popupview, LinearlaYout. Layoutparams.wrap_content, LinearLayout.LayoutParams.WRAP_CONTENT, true);//2, set a transparent background (new colordrawable ()) Mpopupwindow.setbackgrounddrawable (New colordrawable ());//3, specify the form position Mpopupwindow.showasdropdown (view, 50,- View.getheight ());//4,popupview Execution Animation popupview.startanimation (animationset);}

  

Android phone defender 11--form pop-up Popupwindow

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.