|
@@ -46,11 +46,11 @@ import com.kongzue.dialogx.util.views.MaxRelativeLayout;
|
|
|
* @createTime: 2020/10/6 15:17
|
|
|
*/
|
|
|
public class FullScreenDialog extends BaseDialog {
|
|
|
-
|
|
|
+
|
|
|
public static int overrideEnterDuration = -1;
|
|
|
public static int overrideExitDuration = -1;
|
|
|
public static BOOLEAN overrideCancelable;
|
|
|
-
|
|
|
+
|
|
|
protected OnBindView<FullScreenDialog> onBindView;
|
|
|
protected OnBackPressedListener<FullScreenDialog> onBackPressedListener;
|
|
|
protected BOOLEAN privateCancelable;
|
|
@@ -58,36 +58,36 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
protected float backgroundRadius = -1;
|
|
|
protected boolean allowInterceptTouch = true;
|
|
|
protected DialogXAnimInterface<FullScreenDialog> dialogXAnimImpl;
|
|
|
-
|
|
|
+
|
|
|
protected DialogLifecycleCallback<FullScreenDialog> dialogLifecycleCallback;
|
|
|
protected OnBackgroundMaskClickListener<FullScreenDialog> onBackgroundMaskClickListener;
|
|
|
-
|
|
|
+
|
|
|
protected FullScreenDialog me = this;
|
|
|
-
|
|
|
+
|
|
|
protected FullScreenDialog() {
|
|
|
super();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private View dialogView;
|
|
|
-
|
|
|
+
|
|
|
public static FullScreenDialog build() {
|
|
|
return new FullScreenDialog();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public static FullScreenDialog build(OnBindView<FullScreenDialog> onBindView) {
|
|
|
return new FullScreenDialog(onBindView);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog(OnBindView<FullScreenDialog> onBindView) {
|
|
|
this.onBindView = onBindView;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public static FullScreenDialog show(OnBindView<FullScreenDialog> onBindView) {
|
|
|
FullScreenDialog fullScreenDialog = new FullScreenDialog(onBindView);
|
|
|
fullScreenDialog.show();
|
|
|
return fullScreenDialog;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog show() {
|
|
|
if (isHide && getDialogView() != null && isShow) {
|
|
|
if (hideWithExitAnim && getDialogImpl() != null) {
|
|
@@ -107,7 +107,7 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
show(dialogView);
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public void show(Activity activity) {
|
|
|
super.beforeShow();
|
|
|
if (getDialogView() == null) {
|
|
@@ -117,25 +117,25 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
}
|
|
|
show(activity, dialogView);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
protected DialogImpl dialogImpl;
|
|
|
-
|
|
|
+
|
|
|
public class DialogImpl implements DialogConvertViewInterface {
|
|
|
-
|
|
|
+
|
|
|
private FullScreenDialogTouchEventInterceptor fullScreenDialogTouchEventInterceptor;
|
|
|
-
|
|
|
+
|
|
|
public ActivityScreenShotImageView imgZoomActivity;
|
|
|
public DialogXBaseRelativeLayout boxRoot;
|
|
|
public RelativeLayout boxBkg;
|
|
|
public MaxRelativeLayout bkg;
|
|
|
public RelativeLayout boxCustom;
|
|
|
public ScrollController scrollView;
|
|
|
-
|
|
|
+
|
|
|
public DialogImpl setScrollView(ScrollController scrollView) {
|
|
|
this.scrollView = scrollView;
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public DialogImpl(View convertView) {
|
|
|
if (convertView == null) return;
|
|
|
imgZoomActivity = convertView.findViewById(R.id.img_zoom_activity);
|
|
@@ -143,7 +143,7 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
boxBkg = convertView.findViewById(R.id.box_bkg);
|
|
|
bkg = convertView.findViewById(R.id.bkg);
|
|
|
boxCustom = convertView.findViewById(R.id.box_custom);
|
|
|
-
|
|
|
+
|
|
|
if (hideZoomBackground) {
|
|
|
dialogView.setBackgroundResource(R.color.black20);
|
|
|
imgZoomActivity.setVisibility(View.GONE);
|
|
@@ -155,10 +155,15 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
dialogImpl = this;
|
|
|
refreshView();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public float bkgEnterAimY = -1;
|
|
|
private long enterAnimDurationTemp = 300;
|
|
|
-
|
|
|
+ protected int enterY;
|
|
|
+
|
|
|
+ public float getEnterY() {
|
|
|
+ return boxRoot.getSafeHeight() - enterY > 0 ? boxRoot.getSafeHeight() - enterY : 0;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void init() {
|
|
|
boxRoot.setParentDialog(me);
|
|
@@ -167,14 +172,14 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
public void onShow() {
|
|
|
isShow = true;
|
|
|
preShow = false;
|
|
|
-
|
|
|
+
|
|
|
lifecycle.setCurrentState(Lifecycle.State.CREATED);
|
|
|
onDialogShow();
|
|
|
-
|
|
|
+
|
|
|
getDialogLifecycleCallback().onShow(me);
|
|
|
FullScreenDialog.this.onShow(me);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public void onDismiss() {
|
|
|
isShow = false;
|
|
@@ -187,7 +192,7 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
System.gc();
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
boxRoot.setOnBackPressedListener(new DialogXBaseRelativeLayout.PrivateBackPressedListener() {
|
|
|
@Override
|
|
|
public boolean onBackPressed() {
|
|
@@ -203,9 +208,9 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
return true;
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
fullScreenDialogTouchEventInterceptor = new FullScreenDialogTouchEventInterceptor(me, dialogImpl);
|
|
|
-
|
|
|
+
|
|
|
enterAnimDurationTemp = 300;
|
|
|
if (overrideEnterDuration >= 0) {
|
|
|
enterAnimDurationTemp = overrideEnterDuration;
|
|
@@ -214,7 +219,7 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
enterAnimDurationTemp = enterAnimDuration;
|
|
|
}
|
|
|
boxRoot.setBkgAlpha(0f);
|
|
|
-
|
|
|
+
|
|
|
bkg.setY(boxRoot.getHeight());
|
|
|
boxRoot.post(new Runnable() {
|
|
|
@Override
|
|
@@ -223,45 +228,44 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
lifecycle.setCurrentState(Lifecycle.State.RESUMED);
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
boxRoot.setOnSafeInsetsChangeListener(new OnSafeInsetsChangeListener() {
|
|
|
@Override
|
|
|
public void onChange(Rect unsafeRect) {
|
|
|
- if (unsafeRect.bottom > dip2px(100)) {
|
|
|
- ObjectAnimator enterAnim = ObjectAnimator.ofFloat(bkg, "y", bkg.getY(), 0);
|
|
|
- enterAnim.setDuration(enterAnimDurationTemp);
|
|
|
- enterAnim.start();
|
|
|
- }
|
|
|
+ bkg.setY(getEnterY());
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
bkg.setOnYChanged(new MaxRelativeLayout.OnYChanged() {
|
|
|
@Override
|
|
|
public void y(float y) {
|
|
|
- float zoomScale = 1 - (boxRoot.getHeight() - y) * 0.00002f;
|
|
|
+ float realY = y + bkg.getTop();
|
|
|
+ float zoomScale = 1 - (boxRoot.getHeight() - realY) * 0.00002f;
|
|
|
if (zoomScale > 1) zoomScale = 1;
|
|
|
if (!hideZoomBackground) {
|
|
|
imgZoomActivity.setScaleX(zoomScale);
|
|
|
imgZoomActivity.setScaleY(zoomScale);
|
|
|
-
|
|
|
- imgZoomActivity.setRadius(dip2px(15) * ((boxRoot.getHeight() - y) / boxRoot.getHeight()));
|
|
|
+
|
|
|
+ imgZoomActivity.setRadius(dip2px(15) * ((boxRoot.getHeight() - realY) / boxRoot.getHeight()));
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
onDialogInit();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private void showEnterAnim(int customViewHeight) {
|
|
|
+ if (getMaxHeight() != 0) {
|
|
|
+ customViewHeight = Math.min(getMaxHeight() - boxRoot.getUnsafePlace().bottom, customViewHeight);
|
|
|
+ }
|
|
|
+ enterY = customViewHeight;
|
|
|
bkgEnterAimY = boxRoot.getSafeHeight() - customViewHeight;
|
|
|
if (bkgEnterAimY < 0) bkgEnterAimY = 0;
|
|
|
-
|
|
|
ObjectAnimator enterAnim = ObjectAnimator.ofFloat(bkg, "y", boxRoot.getHeight(), bkgEnterAimY);
|
|
|
enterAnim.setDuration(enterAnimDurationTemp);
|
|
|
enterAnim.setInterpolator(new DecelerateInterpolator());
|
|
|
enterAnim.start();
|
|
|
bkg.setVisibility(View.VISIBLE);
|
|
|
-
|
|
|
+
|
|
|
ValueAnimator bkgAlpha = ValueAnimator.ofFloat(0f, 1f);
|
|
|
bkgAlpha.setDuration(enterAnimDurationTemp);
|
|
|
bkgAlpha.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
|
@@ -273,22 +277,22 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
});
|
|
|
bkgAlpha.start();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public void refreshView() {
|
|
|
if (boxRoot == null || getTopActivity() == null) {
|
|
|
return;
|
|
|
}
|
|
|
- boxRoot.setRootPadding(screenPaddings[0],screenPaddings[1],screenPaddings[2],screenPaddings[3]);
|
|
|
+ boxRoot.setRootPadding(screenPaddings[0], screenPaddings[1], screenPaddings[2], screenPaddings[3]);
|
|
|
if (backgroundColor != -1) {
|
|
|
tintColor(bkg, backgroundColor);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
bkg.setMaxWidth(getMaxWidth());
|
|
|
bkg.setMaxHeight(getMaxHeight());
|
|
|
bkg.setMinimumWidth(getMinWidth());
|
|
|
bkg.setMinimumHeight(getMinHeight());
|
|
|
-
|
|
|
+
|
|
|
if (isCancelable()) {
|
|
|
boxRoot.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@@ -316,7 +320,7 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
bkg.setClipToOutline(true);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (onBindView != null) {
|
|
|
onBindView.bindParent(boxCustom, me);
|
|
|
if (onBindView.getCustomView() instanceof ScrollController) {
|
|
@@ -328,7 +332,7 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (hideZoomBackground) {
|
|
|
dialogView.setBackgroundResource(R.color.black20);
|
|
|
imgZoomActivity.setVisibility(View.GONE);
|
|
@@ -336,17 +340,17 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
dialogView.setBackgroundResource(R.color.black);
|
|
|
imgZoomActivity.setVisibility(View.VISIBLE);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
fullScreenDialogTouchEventInterceptor.refresh(me, this);
|
|
|
-
|
|
|
+
|
|
|
onDialogRefreshUI();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public void doDismiss(View v) {
|
|
|
if (v != null) v.setEnabled(false);
|
|
|
if (getTopActivity() == null) return;
|
|
|
-
|
|
|
+
|
|
|
if (!dismissAnimFlag) {
|
|
|
dismissAnimFlag = true;
|
|
|
getDialogXAnimImpl().doExitAnim(me, new ObjectRunnable<Float>() {
|
|
@@ -365,7 +369,7 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public void preDismiss() {
|
|
|
if (isCancelable()) {
|
|
|
doDismiss(boxRoot);
|
|
@@ -377,13 +381,13 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
if (exitAnimDuration >= 0) {
|
|
|
exitAnimDurationTemp = exitAnimDuration;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
ObjectAnimator exitAnim = ObjectAnimator.ofFloat(bkg, "y", bkg.getY(), bkgEnterAimY);
|
|
|
exitAnim.setDuration(exitAnimDurationTemp);
|
|
|
exitAnim.start();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
protected DialogXAnimInterface<FullScreenDialog> getDialogXAnimImpl() {
|
|
|
if (dialogXAnimImpl == null) {
|
|
|
dialogXAnimImpl = new DialogXAnimInterface<FullScreenDialog>() {
|
|
@@ -398,7 +402,7 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
showEnterAnim(customViewHeight);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private boolean isMatchParentHeightCustomView() {
|
|
|
if (onBindView != null && onBindView.getCustomView() != null) {
|
|
|
ViewGroup.LayoutParams lp = onBindView.getCustomView().getLayoutParams();
|
|
@@ -408,7 +412,7 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public void doExitAnim(FullScreenDialog dialog, ObjectRunnable<Float> animProgress) {
|
|
|
long exitAnimDurationTemp = 300;
|
|
@@ -418,11 +422,11 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
if (exitAnimDuration >= 0) {
|
|
|
exitAnimDurationTemp = exitAnimDuration;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
ObjectAnimator exitAnim = ObjectAnimator.ofFloat(bkg, "y", bkg.getY(), boxBkg.getHeight());
|
|
|
exitAnim.setDuration(exitAnimDurationTemp);
|
|
|
exitAnim.start();
|
|
|
-
|
|
|
+
|
|
|
ValueAnimator bkgAlpha = ValueAnimator.ofFloat(1f, 0f);
|
|
|
bkgAlpha.setDuration(exitAnimDurationTemp);
|
|
|
bkgAlpha.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
|
@@ -438,12 +442,12 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
return dialogXAnimImpl;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public String dialogKey() {
|
|
|
return getClass().getSimpleName() + "(" + Integer.toHexString(hashCode()) + ")";
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public void refreshUI() {
|
|
|
if (getDialogImpl() == null) return;
|
|
|
runOnMain(new Runnable() {
|
|
@@ -453,7 +457,7 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public void dismiss() {
|
|
|
runOnMain(new Runnable() {
|
|
|
@Override
|
|
@@ -463,38 +467,38 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public DialogLifecycleCallback<FullScreenDialog> getDialogLifecycleCallback() {
|
|
|
return dialogLifecycleCallback == null ? new DialogLifecycleCallback<FullScreenDialog>() {
|
|
|
} : dialogLifecycleCallback;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setDialogLifecycleCallback(DialogLifecycleCallback<FullScreenDialog> dialogLifecycleCallback) {
|
|
|
this.dialogLifecycleCallback = dialogLifecycleCallback;
|
|
|
if (isShow) dialogLifecycleCallback.onShow(me);
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public OnBackPressedListener<FullScreenDialog> getOnBackPressedListener() {
|
|
|
return (OnBackPressedListener<FullScreenDialog>) onBackPressedListener;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setOnBackPressedListener(OnBackPressedListener<FullScreenDialog> onBackPressedListener) {
|
|
|
this.onBackPressedListener = onBackPressedListener;
|
|
|
refreshUI();
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setStyle(DialogXStyle style) {
|
|
|
this.style = style;
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setTheme(DialogX.THEME theme) {
|
|
|
this.theme = theme;
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public boolean isCancelable() {
|
|
|
if (privateCancelable != null) {
|
|
|
return privateCancelable == BOOLEAN.TRUE;
|
|
@@ -504,78 +508,78 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
}
|
|
|
return cancelable;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setCancelable(boolean cancelable) {
|
|
|
this.privateCancelable = cancelable ? BOOLEAN.TRUE : BOOLEAN.FALSE;
|
|
|
refreshUI();
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public DialogImpl getDialogImpl() {
|
|
|
return dialogImpl;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setCustomView(OnBindView<FullScreenDialog> onBindView) {
|
|
|
this.onBindView = onBindView;
|
|
|
refreshUI();
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public View getCustomView() {
|
|
|
if (onBindView == null) return null;
|
|
|
return onBindView.getCustomView();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog removeCustomView() {
|
|
|
this.onBindView.clean();
|
|
|
refreshUI();
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public int getBackgroundColor() {
|
|
|
return backgroundColor;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setBackgroundColor(@ColorInt int backgroundColor) {
|
|
|
this.backgroundColor = backgroundColor;
|
|
|
refreshUI();
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setBackgroundColorRes(@ColorRes int backgroundColorRes) {
|
|
|
this.backgroundColor = getColor(backgroundColorRes);
|
|
|
refreshUI();
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public long getEnterAnimDuration() {
|
|
|
return enterAnimDuration;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setEnterAnimDuration(long enterAnimDuration) {
|
|
|
this.enterAnimDuration = enterAnimDuration;
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public long getExitAnimDuration() {
|
|
|
return exitAnimDuration;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setExitAnimDuration(long exitAnimDuration) {
|
|
|
this.exitAnimDuration = exitAnimDuration;
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public boolean isHideZoomBackground() {
|
|
|
return hideZoomBackground;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setHideZoomBackground(boolean hideZoomBackground) {
|
|
|
this.hideZoomBackground = hideZoomBackground;
|
|
|
refreshUI();
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public void restartDialog() {
|
|
|
if (dialogView != null) {
|
|
@@ -591,9 +595,9 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
if (dialogView != null) dialogView.setTag(me);
|
|
|
show(dialogView);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private boolean isHide;
|
|
|
-
|
|
|
+
|
|
|
public void hide() {
|
|
|
isHide = true;
|
|
|
hideWithExitAnim = false;
|
|
@@ -601,9 +605,9 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
getDialogView().setVisibility(View.GONE);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
protected boolean hideWithExitAnim;
|
|
|
-
|
|
|
+
|
|
|
public void hideWithExitAnim() {
|
|
|
hideWithExitAnim = true;
|
|
|
isHide = true;
|
|
@@ -619,85 +623,85 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
protected void shutdown() {
|
|
|
dismiss();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setMaxWidth(int maxWidth) {
|
|
|
this.maxWidth = maxWidth;
|
|
|
refreshUI();
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setMaxHeight(int maxHeight) {
|
|
|
this.maxHeight = maxHeight;
|
|
|
refreshUI();
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setMinHeight(int minHeight) {
|
|
|
this.minHeight = minHeight;
|
|
|
refreshUI();
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setMinWidth(int minWidth) {
|
|
|
this.minWidth = minWidth;
|
|
|
refreshUI();
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setDialogImplMode(DialogX.IMPL_MODE dialogImplMode) {
|
|
|
this.dialogImplMode = dialogImplMode;
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public OnBackgroundMaskClickListener<FullScreenDialog> getOnBackgroundMaskClickListener() {
|
|
|
return onBackgroundMaskClickListener;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setOnBackgroundMaskClickListener(OnBackgroundMaskClickListener<FullScreenDialog> onBackgroundMaskClickListener) {
|
|
|
this.onBackgroundMaskClickListener = onBackgroundMaskClickListener;
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setRadius(float radiusPx) {
|
|
|
backgroundRadius = radiusPx;
|
|
|
refreshUI();
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public float getRadius() {
|
|
|
return backgroundRadius;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public boolean isAllowInterceptTouch() {
|
|
|
return allowInterceptTouch;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setAllowInterceptTouch(boolean allowInterceptTouch) {
|
|
|
this.allowInterceptTouch = allowInterceptTouch;
|
|
|
refreshUI();
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public DialogXAnimInterface<FullScreenDialog> getDialogXAnimImpl() {
|
|
|
return dialogXAnimImpl;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setDialogXAnimImpl(DialogXAnimInterface<FullScreenDialog> dialogXAnimImpl) {
|
|
|
this.dialogXAnimImpl = dialogXAnimImpl;
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setRootPadding(int padding) {
|
|
|
this.screenPaddings = new int[]{padding, padding, padding, padding};
|
|
|
refreshUI();
|
|
|
return this;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
public FullScreenDialog setRootPadding(int paddingLeft, int paddingTop, int paddingRight, int paddingBottom) {
|
|
|
this.screenPaddings = new int[]{paddingLeft, paddingTop, paddingRight, paddingBottom};
|
|
|
refreshUI();
|
|
@@ -708,15 +712,14 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
* 用于使用 new 构建实例时,override 的生命周期事件
|
|
|
* 例如:
|
|
|
* new FullScreenDialog() {
|
|
|
- * @Override
|
|
|
- * public void onShow(FullScreenDialog dialog) {
|
|
|
- * //...
|
|
|
- * }
|
|
|
- * }
|
|
|
*
|
|
|
* @param dialog self
|
|
|
+ * @Override public void onShow(FullScreenDialog dialog) {
|
|
|
+ * //...
|
|
|
+ * }
|
|
|
+ * }
|
|
|
*/
|
|
|
- public void onShow(FullScreenDialog dialog){
|
|
|
+ public void onShow(FullScreenDialog dialog) {
|
|
|
|
|
|
}
|
|
|
|
|
@@ -724,23 +727,23 @@ public class FullScreenDialog extends BaseDialog {
|
|
|
* 用于使用 new 构建实例时,override 的生命周期事件
|
|
|
* 例如:
|
|
|
* new FullScreenDialog() {
|
|
|
- * @Override
|
|
|
- * public boolean onDismiss(FullScreenDialog dialog) {
|
|
|
- * WaitDialog.show("Please Wait...");
|
|
|
- * if (dialog.getButtonSelectResult() == BUTTON_SELECT_RESULT.BUTTON_OK) {
|
|
|
- * //点击了OK的情况
|
|
|
- * //...
|
|
|
- * } else {
|
|
|
- * //其他按钮点击、对话框dismiss的情况
|
|
|
- * //...
|
|
|
- * }
|
|
|
- * return false;
|
|
|
- * }
|
|
|
- * }
|
|
|
+ *
|
|
|
* @param dialog self
|
|
|
+ * @Override public boolean onDismiss(FullScreenDialog dialog) {
|
|
|
+ * WaitDialog.show("Please Wait...");
|
|
|
+ * if (dialog.getButtonSelectResult() == BUTTON_SELECT_RESULT.BUTTON_OK) {
|
|
|
+ * //点击了OK的情况
|
|
|
+ * //...
|
|
|
+ * } else {
|
|
|
+ * //其他按钮点击、对话框dismiss的情况
|
|
|
+ * //...
|
|
|
+ * }
|
|
|
+ * return false;
|
|
|
+ * }
|
|
|
+ * }
|
|
|
*/
|
|
|
//用于使用 new 构建实例时,override 的生命周期事件
|
|
|
- public void onDismiss(FullScreenDialog dialog){
|
|
|
+ public void onDismiss(FullScreenDialog dialog) {
|
|
|
|
|
|
}
|
|
|
}
|