Skip to content

Commit

Permalink
Merge branch 'local'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.idea/caches/build_file_checksums.ser
#	.idea/misc.xml
  • Loading branch information
E Kwong MBP committed Aug 9, 2018
2 parents 8521986 + ff525d0 commit 51a29e0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions ekpopwindowlib/src/main/java/com/ekwong/lib/CustomPopWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class CustomPopWindow {

private int mAnimDuration;

private CustomPopWindowDismissListener mDismissListener;
private PopWindowDismissListener mDismissListener;

private OutSideClickListener mOutSideClickListener;

Expand Down Expand Up @@ -66,11 +66,12 @@ public void onAnimationRepeat(Animator animation) {
* @param layoutRes 布局资源
* @param builder 构造者对象
*/
private CustomPopWindow(Context context, int layoutRes, Builder builder) {
private CustomPopWindow(Context context, int layoutRes, final Builder builder) {
LayoutInflater layoutInflater = LayoutInflater.from(context);
mBgView = new FrameLayout(context);
mBgView.setBackgroundColor(context.getResources().getColor(R.color.transparent_fifty_percent));
mBgPopupWindow = new PopupWindow(mBgView, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
mBgPopupWindow = new PopupWindow(mBgView, ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT);
mContentView = layoutInflater.inflate(layoutRes, mBgView, false);
mBgView.setBackgroundColor(builder.mColorOutside);
mBgView.setClickable(builder.mIsOutsideTouchable);
Expand All @@ -91,7 +92,9 @@ public void onClick(View v) {
if (mOutSideClickListener != null) {
mOutSideClickListener.onOutSideClick();
}
dismiss();
if (builder.mIsOutsideTouchable) {
dismiss();
}
}
});
mBgPopupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
Expand All @@ -101,7 +104,7 @@ public void setOutSideClickListener(OutSideClickListener outSideClickListener) {
mOutSideClickListener = outSideClickListener;
}

public void setOnDismissListener(CustomPopWindowDismissListener dismissListener) {
public void setOnDismissListener(PopWindowDismissListener dismissListener) {
mDismissListener = dismissListener;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected void addListener() {
*
* @param listener 监听器对象
*/
public void setOnDismissListener(CustomPopWindowDismissListener listener) {
public void setOnDismissListener(PopWindowDismissListener listener) {
mCustomPopWindow.setOnDismissListener(listener);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* <p>
* 关闭popwindow的监听器
*/
public interface CustomPopWindowDismissListener {
public interface PopWindowDismissListener {

/**
* 关闭时调用
Expand Down

0 comments on commit 51a29e0

Please sign in to comment.