diff --git a/AndroidProject.apk b/AndroidProject.apk index 23445e50..a3d9dba5 100644 Binary files a/AndroidProject.apk and b/AndroidProject.apk differ diff --git a/app/build.gradle b/app/build.gradle index e8990160..65674619 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -69,6 +69,11 @@ android { } } + packagingOptions { + // 剔除这个包下的所有文件(除了签名信息) + exclude 'META-INF/*******' + } + // AOP 配置 aspectjx { // 排除一些第三方库的包名(Gson、 LeakCanary 和 AOP 有冲突) diff --git a/app/src/main/res/layout/widget_player_view.xml b/app/src/main/res/layout/widget_player_view.xml index a84c8fc2..e2592292 100644 --- a/app/src/main/res/layout/widget_player_view.xml +++ b/app/src/main/res/layout/widget_player_view.xml @@ -5,14 +5,15 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/black" + android:fitsSystemWindows="true" + android:keepScreenOn="true" android:orientation="vertical"> + android:layout_gravity="center" /> - extends RecyclerView.Adapter implements ContextAction { + extends RecyclerView.Adapter implements ResourcesAction { /** 上下文对象 */ private final Context mContext; diff --git a/base/src/main/java/com/hjq/base/BaseDialog.java b/base/src/main/java/com/hjq/base/BaseDialog.java index 734f237c..080fe652 100644 --- a/base/src/main/java/com/hjq/base/BaseDialog.java +++ b/base/src/main/java/com/hjq/base/BaseDialog.java @@ -41,6 +41,7 @@ import com.hjq.base.action.AnimAction; import com.hjq.base.action.ClickAction; import com.hjq.base.action.HandlerAction; +import com.hjq.base.action.ResourcesAction; import java.lang.ref.SoftReference; import java.util.ArrayList; @@ -52,7 +53,8 @@ * time : 2018/11/24 * desc : Dialog 基类 */ -public class BaseDialog extends AppCompatDialog implements LifecycleOwner, ActivityAction, HandlerAction, ClickAction, AnimAction, +public class BaseDialog extends AppCompatDialog implements LifecycleOwner, + ActivityAction, ResourcesAction, HandlerAction, ClickAction, AnimAction, DialogInterface.OnShowListener, DialogInterface.OnCancelListener, DialogInterface.OnDismissListener { private final ListenersWrapper mListeners = new ListenersWrapper<>(this); @@ -161,7 +163,7 @@ public void setBackgroundDimEnabled(boolean enabled) { /** * 设置背景遮盖层的透明度(前提条件是背景遮盖层开关必须是为开启状态) */ - public void setBackgroundDimAmount(@FloatRange(from = 0, to = 1) float dimAmount) { + public void setBackgroundDimAmount(@FloatRange(from = 0.0, to = 1.0) float dimAmount) { Window window = getWindow(); if (window != null) { window.setDimAmount(dimAmount); @@ -400,7 +402,7 @@ protected void onStop() { } @SuppressWarnings("unchecked") - public static class Builder implements LifecycleOwner, ActivityAction, ClickAction { + public static class Builder implements LifecycleOwner, ActivityAction, ResourcesAction, ClickAction { /** 上下文对象 */ private final Context mContext; @@ -617,7 +619,7 @@ public B setBackgroundDimEnabled(boolean enabled) { /** * 设置背景遮盖层的透明度(前提条件是背景遮盖层开关必须是为开启状态) */ - public B setBackgroundDimAmount(@FloatRange(from = 0, to = 1) float dimAmount) { + public B setBackgroundDimAmount(@FloatRange(from = 0.0, to = 1.0) float dimAmount) { mBackgroundDimAmount = dimAmount; if (isCreated()) { mDialog.setBackgroundDimAmount(dimAmount); diff --git a/base/src/main/java/com/hjq/base/BaseFragment.java b/base/src/main/java/com/hjq/base/BaseFragment.java index 2fc99692..80fb79fe 100644 --- a/base/src/main/java/com/hjq/base/BaseFragment.java +++ b/base/src/main/java/com/hjq/base/BaseFragment.java @@ -18,6 +18,7 @@ import com.hjq.base.action.BundleAction; import com.hjq.base.action.ClickAction; import com.hjq.base.action.HandlerAction; +import com.hjq.base.action.ResourcesAction; import java.util.Random; @@ -27,8 +28,8 @@ * time : 2018/10/18 * desc : Fragment 基类 */ -public abstract class BaseFragment - extends Fragment implements ActivityAction, HandlerAction, ClickAction, BundleAction { +public abstract class BaseFragment extends Fragment implements + ActivityAction, ResourcesAction, HandlerAction, ClickAction, BundleAction { /** Activity 对象 */ private A mActivity; diff --git a/base/src/main/java/com/hjq/base/BasePopupWindow.java b/base/src/main/java/com/hjq/base/BasePopupWindow.java index e15d468e..152d0131 100644 --- a/base/src/main/java/com/hjq/base/BasePopupWindow.java +++ b/base/src/main/java/com/hjq/base/BasePopupWindow.java @@ -35,7 +35,7 @@ import com.hjq.base.action.ActivityAction; import com.hjq.base.action.AnimAction; import com.hjq.base.action.ClickAction; -import com.hjq.base.action.ContextAction; +import com.hjq.base.action.ResourcesAction; import com.hjq.base.action.HandlerAction; import java.lang.ref.SoftReference; @@ -226,7 +226,7 @@ public void setOverlapAnchor(boolean overlapAnchor) { /** * 设置背景遮盖层的透明度 */ - public void setBackgroundDimAmount(@FloatRange(from = 0, to = 1) float dimAmount) { + public void setBackgroundDimAmount(@FloatRange(from = 0.0, to = 1.0) float dimAmount) { float alpha = 1 - dimAmount; if (isShowing()) { setActivityAlpha(alpha); @@ -263,7 +263,7 @@ private void setActivityAlpha(float alpha) { } @SuppressWarnings("unchecked") - public static class Builder implements ContextAction, ClickAction { + public static class Builder implements ResourcesAction, ClickAction { private static final int DEFAULT_ANCHORED_GRAVITY = Gravity.TOP | Gravity.START; @@ -447,7 +447,7 @@ public B setAnimStyle(@StyleRes int id) { /** * 设置背景遮盖层的透明度 */ - public B setBackgroundDimAmount(@FloatRange(from = 0, to = 1) float dimAmount) { + public B setBackgroundDimAmount(@FloatRange(from = 0.0, to = 1.0) float dimAmount) { mBackgroundDimAmount = dimAmount; if (isShowing()) { mPopupWindow.setBackgroundDimAmount(dimAmount); diff --git a/base/src/main/java/com/hjq/base/action/ActivityAction.java b/base/src/main/java/com/hjq/base/action/ActivityAction.java index d926f65a..95454e7a 100644 --- a/base/src/main/java/com/hjq/base/action/ActivityAction.java +++ b/base/src/main/java/com/hjq/base/action/ActivityAction.java @@ -11,7 +11,12 @@ * time : 2020/03/08 * desc : Activity 相关意图 */ -public interface ActivityAction extends ContextAction { +public interface ActivityAction { + + /** + * 获取 Context + */ + Context getContext(); /** * 获取 Activity diff --git a/base/src/main/java/com/hjq/base/action/ContextAction.java b/base/src/main/java/com/hjq/base/action/ResourcesAction.java similarity index 97% rename from base/src/main/java/com/hjq/base/action/ContextAction.java rename to base/src/main/java/com/hjq/base/action/ResourcesAction.java index d5ac62d8..eb80923d 100644 --- a/base/src/main/java/com/hjq/base/action/ContextAction.java +++ b/base/src/main/java/com/hjq/base/action/ResourcesAction.java @@ -17,7 +17,7 @@ * time : 2019/09/15 * desc : Context 意图处理(扩展非 Context 类的方法,禁止 Context 类实现此接口) */ -public interface ContextAction { +public interface ResourcesAction { /** * 获取 Context diff --git a/widget/src/main/java/com/hjq/widget/view/RegexEditText.java b/widget/src/main/java/com/hjq/widget/view/RegexEditText.java index a120ba4e..ed4732f2 100644 --- a/widget/src/main/java/com/hjq/widget/view/RegexEditText.java +++ b/widget/src/main/java/com/hjq/widget/view/RegexEditText.java @@ -30,7 +30,7 @@ public class RegexEditText extends AppCompatEditText implements InputFilter { /** 计数(非 0 开头的数字) */ public static final String REGEX_COUNT = "[1-9]\\d*"; /** 用户名(中文、英文、数字) */ - public static final String REGEX_NAME = REGEX_CHINESE + "|" + REGEX_ENGLISH + "|\\d*"; + public static final String REGEX_NAME = "[[\\u4e00-\\u9fa5]|[a-zA-Z]|\\d]*"; /** 非空格的字符(不能输入空格) */ public static final String REGEX_NONNULL = "\\S+";