10000 GitHub - wudaren/BasePopup: // 打造通用的popupwindow
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

wudaren/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

No packages published

Languages

  • Java 100.0%
0