A abstract class for creating custom popupwindow easily.
Click here and copy three java to your project.
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();
click the link to show more:
https://github.com/razerdp/BasePopup/blob/master/UpdateLog.md
#License MIT