精简 META-INF 文件下的一些开源信息 修正视频播放界面在挖孔屏下的显示效果 修正 RegexEdit 正则表达式编写不规范的问题master
@@ -69,6 +69,11 @@ android { | |||
} | |||
} | |||
packagingOptions { | |||
// 剔除这个包下的所有文件(除了签名信息) | |||
exclude 'META-INF/*******' | |||
} | |||
// AOP 配置 | |||
aspectjx { | |||
// 排除一些第三方库的包名(Gson、 LeakCanary 和 AOP 有冲突) |
@@ -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"> | |||
<VideoView | |||
android:id="@+id/vv_player_view_video" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent" | |||
android:layout_gravity="center" | |||
android:keepScreenOn="true" /> | |||
android:layout_gravity="center" /> | |||
<FrameLayout | |||
android:id="@+id/ll_player_view_top" |
@@ -11,7 +11,7 @@ import androidx.annotation.NonNull; | |||
import androidx.recyclerview.widget.LinearLayoutManager; | |||
import androidx.recyclerview.widget.RecyclerView; | |||
import com.hjq.base.action.ContextAction; | |||
import com.hjq.base.action.ResourcesAction; | |||
/** | |||
* author : Android 轮子哥 | |||
@@ -20,7 +20,7 @@ import com.hjq.base.action.ContextAction; | |||
* desc : RecyclerView 适配器基类 | |||
*/ | |||
public abstract class BaseAdapter<VH extends BaseAdapter.ViewHolder> | |||
extends RecyclerView.Adapter<VH> implements ContextAction { | |||
extends RecyclerView.Adapter<VH> implements ResourcesAction { | |||
/** 上下文对象 */ | |||
private final Context mContext; |
@@ -41,6 +41,7 @@ import com.hjq.base.action.ActivityAction; | |||
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 @@ import java.util.List; | |||
* 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<BaseDialog> mListeners = new ListenersWrapper<>(this); | |||
@@ -161,7 +163,7 @@ public class BaseDialog extends AppCompatDialog implements LifecycleOwner, Activ | |||
/** | |||
* 设置背景遮盖层的透明度(前提条件是背景遮盖层开关必须是为开启状态) | |||
*/ | |||
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 @@ public class BaseDialog extends AppCompatDialog implements LifecycleOwner, Activ | |||
} | |||
@SuppressWarnings("unchecked") | |||
public static class Builder<B extends Builder> implements LifecycleOwner, ActivityAction, ClickAction { | |||
public static class Builder<B extends Builder> implements LifecycleOwner, ActivityAction, ResourcesAction, ClickAction { | |||
/** 上下文对象 */ | |||
private final Context mContext; | |||
@@ -617,7 +619,7 @@ public class BaseDialog extends AppCompatDialog implements LifecycleOwner, Activ | |||
/** | |||
* 设置背景遮盖层的透明度(前提条件是背景遮盖层开关必须是为开启状态) | |||
*/ | |||
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); |
@@ -18,6 +18,7 @@ import com.hjq.base.action.ActivityAction; | |||
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 @@ import java.util.Random; | |||
* time : 2018/10/18 | |||
* desc : Fragment 基类 | |||
*/ | |||
public abstract class BaseFragment<A extends BaseActivity> | |||
extends Fragment implements ActivityAction, HandlerAction, ClickAction, BundleAction { | |||
public abstract class BaseFragment<A extends BaseActivity> extends Fragment implements | |||
ActivityAction, ResourcesAction, HandlerAction, ClickAction, BundleAction { | |||
/** Activity 对象 */ | |||
private A mActivity; |
@@ -35,7 +35,7 @@ import androidx.core.widget.PopupWindowCompat; | |||
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 class BasePopupWindow extends PopupWindow | |||
/** | |||
* 设置背景遮盖层的透明度 | |||
*/ | |||
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 @@ public class BasePopupWindow extends PopupWindow | |||
} | |||
@SuppressWarnings("unchecked") | |||
public static class Builder<B extends BasePopupWindow.Builder> implements ContextAction, ClickAction { | |||
public static class Builder<B extends BasePopupWindow.Builder> implements ResourcesAction, ClickAction { | |||
private static final int DEFAULT_ANCHORED_GRAVITY = Gravity.TOP | Gravity.START; | |||
@@ -447,7 +447,7 @@ public class BasePopupWindow extends PopupWindow | |||
/** | |||
* 设置背景遮盖层的透明度 | |||
*/ | |||
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); |
@@ -11,7 +11,12 @@ import android.content.Intent; | |||
* time : 2020/03/08 | |||
* desc : Activity 相关意图 | |||
*/ | |||
public interface ActivityAction extends ContextAction { | |||
public interface ActivityAction { | |||
/** | |||
* 获取 Context | |||
*/ | |||
Context getContext(); | |||
/** | |||
* 获取 Activity |
@@ -17,7 +17,7 @@ import androidx.core.content.ContextCompat; | |||
* time : 2019/09/15 | |||
* desc : Context 意图处理(扩展非 Context 类的方法,禁止 Context 类实现此接口) | |||
*/ | |||
public interface ContextAction { | |||
public interface ResourcesAction { | |||
/** | |||
* 获取 Context |
@@ -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+"; | |||