瀏覽代碼

0.0.50.beta9 ready
- 针对 PopMenu、GuideDialog 针对绑定的 baseView 位置异常情况的处理;
- DialogXValueAnimator 修改为支持屏幕最高刷新率;
- 修复 BottomDialog、FullScreenDialog 滑动继承的一些问题;

Kongzue 1 年之前
父節點
當前提交
1beca4bac5

+ 1 - 0
DialogX/src/main/java/com/kongzue/dialogx/util/BottomDialogTouchEventInterceptor.java

@@ -129,6 +129,7 @@ public class BottomDialogTouchEventInterceptor {
                                     enterAnim.start();
                                 }
                             }
+                            impl.scrollView.lockScroll(false);
                             break;
                     }
                     return false;

+ 1 - 0
DialogX/src/main/java/com/kongzue/dialogx/util/FullScreenDialogTouchEventInterceptor.java

@@ -108,6 +108,7 @@ public class FullScreenDialogTouchEventInterceptor {
                                     enterAnim.start();
                                 }
                             }
+                            ((ScrollController) impl.scrollView).lockScroll(false);
                             break;
                     }
                     return false;

+ 5 - 2
DialogX/src/main/java/com/kongzue/dialogx/util/views/FitSystemBarUtils.java

@@ -472,7 +472,7 @@ public class FitSystemBarUtils {
     }
 
     private int getStatusBarHeight() {
-        if (isFullScreen()) {
+        if (isFullScreen() || getDecorView() == null) {
             return 0;
         }
         WindowInsetsController insetsController = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) ? getDecorView().getWindowInsetsController() : null;
@@ -494,7 +494,7 @@ public class FitSystemBarUtils {
     }
 
     private int getNavigationBarHeight() {
-        if (isFullScreen()) {
+        if (isFullScreen() || getDecorView() == null) {
             return 0;
         }
         WindowInsetsController insetsController = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) ? getDecorView().getWindowInsetsController() : null;
@@ -600,6 +600,9 @@ public class FitSystemBarUtils {
     private int getAppTargetSDKVersion() {
         try {
             Context context = BaseDialog.getApplicationContext();
+            if (context == null) {
+                return -1;
+            }
             PackageManager pm = context.getPackageManager();
             ApplicationInfo applicationInfo = pm.getApplicationInfo(context.getPackageName(), 0);
             int targetSdkVersion = applicationInfo.targetSdkVersion;

+ 1 - 0
app/src/main/java/com/kongzue/dialogxdemo/activity/MainActivity.java

@@ -1309,6 +1309,7 @@ public class MainActivity extends BaseActivity {
                                 recyclerView.setAdapter(adapter);
                             }
                         })
+                        .setScrollableWhenContentLargeThanVisibleRange(false)
                         .show();
             }
         });

+ 1 - 1
app/src/main/res/layout/layout_custom_recycleview.xml

@@ -4,4 +4,4 @@
     android:tag="ScrollController"
     android:orientation="vertical"
     android:layout_width="match_parent"
-    android:layout_height="400dp"/>
+    android:layout_height="wrap_content"/>