Custom dialog, implemented by the bottom of the pop-up effect (imitation QQ exit, etc.)

Source: Internet
Author: User

Method:

 PublicDialog createdialog (context context, view view) {Dialog Mselectphotodialog=NULL; Mselectphotodialog=NewDialog (context, r.style.transparentframewindowstyle);        Mselectphotodialog.setcontentview (view); Window Window=Mselectphotodialog.getwindow (); //Setting display animationswindow.setwindowanimations (R.style.select_photo_dialog_animstyle); Windowmanager.layoutparams WL=window.getattributes (); Wl.x= 0; Wl.y=getactivity (). Getwindowmanager (). Getdefaultdisplay (). GetHeight (); //The following sentences are used to ensure that the buttons can be horizontally full screenWl.width =ViewGroup.LayoutParams.MATCH_PARENT; Wl.height=ViewGroup.LayoutParams.WRAP_CONTENT; //Set Display locationmselectphotodialog.onwindowattributeschanged (WL); //set the click Perimeter to dissolveMselectphotodialog.setcanceledontouchoutside (true); Mselectphotodialog.show ();}

Style:

<!--animation effect of the Avatar Pop-up window -    <stylename= "Select_photo_dialog_animstyle">        <Itemname= "Android:windowenteranimation">@anim/photo_dialog_in_anim</Item>        <Itemname= "Android:windowexitanimation">@anim/photo_dialog_out_anim</Item>    </style><!--Avatar Popup Style: Borderless background transparent -    <stylename= "Transparentframewindowstyle"Parent= "Android:style/theme.dialog">        <Itemname= "Android:windowbackground">@android: Color/transparent</Item>    </style>
Animation: (a), Photo_dialog_in_anim
<?XML version= "1.0" encoding= "Utf-8"?><Setxmlns:android= "Http://schemas.android.com/apk/res/android" >    <Translateandroid:duration= "$"Android:fromxdelta= "0"Android:fromydelta= "+"Android:toxdelta= "0"Android:toydelta= "0" /></Set>

(ii), Photo_dialog_out_anim

<?XML version= "1.0" encoding= "Utf-8"?><Setxmlns:android= "Http://schemas.android.com/apk/res/android" >    <Translateandroid:duration= "$"Android:fromxdelta= "0"Android:fromydelta= "0"Android:toxdelta= "0"Android:toydelta= "+" /></Set>

Custom dialog, implemented by the bottom of the pop-up effect (imitation QQ exit, etc.)

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.