Explorar el Código

v1.0.2开发:修复权限申请弹窗异常

#Suyghur hace 2 años
padre
commit
ca3b633fcc

+ 8 - 6
library_support/src/main/java/cn/yyxx/support/permission/BasePermissionInterceptor.java

@@ -33,12 +33,14 @@ public class BasePermissionInterceptor implements IPermissionInterceptor {
             showPermissionDialog(activity, permissions);
             return;
         }
-        if (permissions.size() == 1 && Permission.ACCESS_BACKGROUND_LOCATION.equals(permissions.get(0))) {
-            Toast.makeText(activity, "没有授予后台定位权限,请您选择\"始终允许\"", Toast.LENGTH_SHORT).show();
-            PermissionKitActivity.finish(activity);
-            return;
-        }
-        Toast.makeText(activity, "授权失败,请正确授予权限", Toast.LENGTH_SHORT).show();
+//        if (permissions.size() == 1 && Permission.ACCESS_BACKGROUND_LOCATION.equals(permissions.get(0))) {
+//            Toast.makeText(activity, "没有授予后台定位权限,请您选择\"始终允许\"", Toast.LENGTH_SHORT).show();
+//            callback.onDenied(permissions, never);
+//            PermissionKitActivity.finish(activity);
+//            return;
+//        }
+//        Toast.makeText(activity, "授权失败,请正确授予权限", Toast.LENGTH_SHORT).show();
+        callback.onDenied(permissions, never);
         PermissionKitActivity.finish(activity);
     }
 

+ 12 - 10
library_support/src/main/java/cn/yyxx/support/ui/DragViewLayout.java

@@ -3,6 +3,7 @@ package cn.yyxx.support.ui;
 import android.animation.ValueAnimator;
 import android.content.Context;
 import android.graphics.PixelFormat;
+import android.util.Log;
 import android.view.Gravity;
 import android.view.MotionEvent;
 import android.view.View;
@@ -12,6 +13,8 @@ import android.widget.FrameLayout;
 import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 
+import java.util.logging.Logger;
+
 /**
  * @author #Suyghur.
  * Created on 2021/05/12
@@ -19,10 +22,10 @@ import android.widget.RelativeLayout;
 public class DragViewLayout extends FrameLayout {
 
     //view所在位置
-    private int mLastX, mLastY;
+    protected int mLastX, mLastY;
 
     //屏幕宽高
-    private int mScreenWidth, mScreenHeight;
+    protected int mScreenWidth, mScreenHeight;
 
     //view宽高
     protected int mWidth, mHeight;
@@ -31,17 +34,16 @@ public class DragViewLayout extends FrameLayout {
     protected boolean isDrag = false;
 
     //系统最新滑动距离
-    private int mTouchSlop = 0;
-
-    private WindowManager.LayoutParams floatLayoutParams;
-    private WindowManager mWindowManager;
+    protected int mTouchSlop = 0;
 
+    protected WindowManager.LayoutParams floatLayoutParams;
+    protected WindowManager mWindowManager;
 
     //手指触摸位置
-    private float xInScreen;
-    private float yInScreen;
-    private float xInView;
-    private float yInView;
+    protected float xInScreen;
+    protected float yInScreen;
+    protected float xInView;
+    protected float yInView;
 
     public DragViewLayout(Context context) {
         super(context);