|
41 | 41 | import com.hjq.base.action.AnimAction; |
42 | 42 | import com.hjq.base.action.ClickAction; |
43 | 43 | import com.hjq.base.action.HandlerAction; |
| 44 | +import com.hjq.base.action.ResourcesAction; |
44 | 45 |
|
45 | 46 | import java.lang.ref.SoftReference; |
46 | 47 | import java.util.ArrayList; |
|
52 | 53 | * time : 2018/11/24 |
53 | 54 | * desc : Dialog 基类 |
54 | 55 | */ |
55 | | -public class BaseDialog extends AppCompatDialog implements LifecycleOwner, ActivityAction, HandlerAction, ClickAction, AnimAction, |
| 56 | +public class BaseDialog extends AppCompatDialog implements LifecycleOwner, |
| 57 | + ActivityAction, ResourcesAction, HandlerAction, ClickAction, AnimAction, |
56 | 58 | DialogInterface.OnShowListener, DialogInterface.OnCancelListener, DialogInterface.OnDismissListener { |
57 | 59 |
|
58 | 60 | private final ListenersWrapper<BaseDialog> mListeners = new ListenersWrapper<>(this); |
@@ -161,7 +163,7 @@ public void setBackgroundDimEnabled(boolean enabled) { |
161 | 163 | /** |
162 | 164 | * 设置背景遮盖层的透明度(前提条件是背景遮盖层开关必须是为开启状态) |
163 | 165 | */ |
164 | | - public void setBackgroundDimAmount(@FloatRange(from = 0, to = 1) float dimAmount) { |
| 166 | + public void setBackgroundDimAmount(@FloatRange(from = 0.0, to = 1.0) float dimAmount) { |
165 | 167 | Window window = getWindow(); |
166 | 168 | if (window != null) { |
167 | 169 | window.setDimAmount(dimAmount); |
@@ -400,7 +402,7 @@ protected void onStop() { |
400 | 402 | } |
401 | 403 |
|
402 | 404 | @SuppressWarnings("unchecked") |
403 | | - public static class Builder<B extends Builder> implements LifecycleOwner, ActivityAction, ClickAction { |
| 405 | + public static class Builder<B extends Builder> implements LifecycleOwner, ActivityAction, ResourcesAction, ClickAction { |
404 | 406 |
|
405 | 407 | /** 上下文对象 */ |
406 | 408 | private final Context mContext; |
@@ -617,7 +619,7 @@ public B setBackgroundDimEnabled(boolean enabled) { |
617 | 619 | /** |
618 | 620 | * 设置背景遮盖层的透明度(前提条件是背景遮盖层开关必须是为开启状态) |
619 | 621 | */ |
620 | | - public B setBackgroundDimAmount(@FloatRange(from = 0, to = 1) float dimAmount) { |
| 622 | + public B setBackgroundDimAmount(@FloatRange(from = 0.0, to = 1.0) float dimAmount) { |
621 | 623 | mBackgroundDimAmount = dimAmount; |
622 | 624 | if (isCreated()) { |
623 | 625 | mDialog.setBackgroundDimAmount(dimAmount); |
|
0 commit comments