Skip to content

Commit

Permalink
demo 加入OnDismissListener监听
Browse files Browse the repository at this point in the history
  • Loading branch information
zyyoona7 committed Aug 7, 2017
1 parent 4651360 commit f6de231
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.zyyoona7.easypopup.easypop;

import android.graphics.Color;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;

import com.blankj.utilcode.util.SizeUtils;
Expand All @@ -17,6 +19,7 @@
import com.zyyoona7.lib.VerticalGravity;

public class EasyPopActivity extends BaseActivity implements View.OnClickListener {
private static final String TAG = "EasyPopActivity";

private TitleBar mTitleBar;

Expand Down Expand Up @@ -152,6 +155,12 @@ public void onClick(View v) {
mCirclePop.dismiss();
}
});
mCirclePop.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
Log.e(TAG, "onDismiss: mCirclePop");
}
});
}

private void showCirclePop(View view) {
Expand All @@ -162,6 +171,12 @@ private void initAbovePop() {
mAbovePop = new EasyPopup(this)
.setContentView(R.layout.layout_any)
.setFocusAndOutsideEnable(true)
.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
Log.e(TAG, "onDismiss: mAbovePop");
}
})
.createPopup();
}

Expand Down

0 comments on commit f6de231

Please sign in to comment.