Skip to content

ayyb1988/BasePopup

 
 

Repository files navigation

BasePopup

A abstract class for creating custom popupwindow easily.

中文介绍

Download

Click here and copy three java to your project.

HowToUse


Step 1: Create a class whitch extend BasePopupWindow

Step 2: override some methods

etc.

public class DialogPopup extends BasePopupWindow { public DialogPopup(Activity context) { super(context); } @Override protected Animation getShowAnimation() { AnimationSet set=new AnimationSet(false); Animation shakeAnima=new RotateAnimation(0,15,Animation.RELATIVE_TO_SELF,0.5f,Animation.RELATIVE_TO_SELF,0.5f); shakeAnima.setInterpolator(new CycleInterpolator(5)); shakeAnima.setDuration(400); set.addAnimation(getDefaultAlphaAnimation()); set.addAnimation(shakeAnima); return set; } @Override protected View getClickToDismissView() { return mPopupView; } @Override public View getPopupView() { return getPopupViewById(R.layout.popup_dialog); } @Override public View getAnimaView() { return mPopupView.findViewById(R.id.popup_anima); } }

**Step 3:**create the object and show

etc.

 new DialogPopup(context).showPopupWindow();

Some Example

image image image image image image

click the link to show more:

https://github.com/razerdp/BasePopup/blob/master/UpdateLog.md

#License MIT

About

// 打造通用的popupwindow

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Java 100.0%