MaryPopup

介绍:

一个可拖动的弹出视图,多种打开与关闭效果。

运行效果:

使用说明:

intro.gif

从一个view打开

MaryPopup marypopup = MaryPopup.with(context)
                        .cancellable(true)
                        .blackOverlayColor(Color.parseColor("#DD444444"))
                        .backgroundColor(Color.parseColor("#EFF4F5"))
                        .content(R.layout.popup_content)
                        .from(clickedView)
                        .show();
CustomView customView = LayoutInflater...
MaryPopup marypopup = MaryPopup.with(context)
                        .cancellable(true)
                        .blackOverlayColor(Color.parseColor("#DD444444"))
                        .backgroundColor(Color.parseColor("#EFF4F5"))
                        .content(customView)
                        .from(clickedView)
                        .show();

Center

center.gif

MaryPopup marypopup = MaryPopup.with(context)
                        ...
                        .center(true)
                        ...
                        .show();

Draggable

draggable.gif

MaryPopup.with(context)
      ...
      .draggable(true)
      ...
      .show();

scaledown.gif

MaryPopup.with(context)
      ...
      .draggable(true)
      .scaleDownDragging(true);
      ...
      .show();

fadeout.gif

MaryPopup.with(context)
      ...
      .draggable(true)
      .fadeOutDragging(true);
      ...
      .show();

关闭

别忘了处理activity的onBackPress

@Override
public void onBackPressed() {
    if(!marypopup.close(true)){
        super.onBackPressed();
    }
}

下载

 build.gradle

repositories {
  maven { url "http://dl.bintray.com/meetic-android/maven" }
}
compile 'com.meetic.marypopup:marypopup:(last version)'
compile 'com.meetic.dragueur:dragueur:1.0.0'

Dragueur 用来移动view。

已下载
0