From 0fb8834386875cdcd28a432eab91922877cb1529 Mon Sep 17 00:00:00 2001 From: foolchen Date: Wed, 22 Aug 2018 11:19:13 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E4=BA=86=E8=BF=87?= =?UTF-8?q?=E6=97=B6=E8=B0=83=E7=94=A8=EF=BC=8C=E9=80=82=E9=85=8DAndroid?= =?UTF-8?q?=20P=20#134?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/bingoogolapple/swipebacklayout/BGASwipeBackLayout.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/main/java/cn/bingoogolapple/swipebacklayout/BGASwipeBackLayout.java b/library/src/main/java/cn/bingoogolapple/swipebacklayout/BGASwipeBackLayout.java index a3925d9..75046ce 100644 --- a/library/src/main/java/cn/bingoogolapple/swipebacklayout/BGASwipeBackLayout.java +++ b/library/src/main/java/cn/bingoogolapple/swipebacklayout/BGASwipeBackLayout.java @@ -1157,7 +1157,7 @@ private void dimChildView(View v, float mag, int fadeColor) { protected boolean drawChild(Canvas canvas, View child, long drawingTime) { final LayoutParams lp = (LayoutParams) child.getLayoutParams(); boolean result; - final int save = canvas.save(Canvas.CLIP_SAVE_FLAG); + final int save = canvas.save(); if (mCanSlide && !lp.slideable && mSlideableView != null) { // Clip against the slider; no sense drawing what will immediately be covered. From 45ae7f560dd62a1daaa49ec6aded0d8c10016d5a Mon Sep 17 00:00:00 2001 From: bingoogolapple Date: Sat, 27 Oct 2018 17:50:14 +0800 Subject: [PATCH 2/2] fix #122 fix #134 fix #138 --- demo/build.gradle | 11 ++++---- gradle.properties | 27 +++---------------- library/build.gradle | 3 +-- .../swipebacklayout/UIUtil.java | 22 +++------------ 4 files changed, 13 insertions(+), 50 deletions(-) diff --git a/demo/build.gradle b/demo/build.gradle index f3f7726..988e8aa 100644 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -2,7 +2,6 @@ apply plugin: 'com.android.application' android { compileSdkVersion ANDROID_BUILD_SDK_VERSION as int - buildToolsVersion ANDROID_BUILD_TOOLS_VERSION defaultConfig { minSdkVersion ANDROID_BUILD_MIN_SDK_VERSION as int @@ -14,8 +13,8 @@ android { dependencies { // 下面两个依赖是必须的 - implementation 'com.android.support:support-v4:27.1.1' - implementation 'cn.bingoogolapple:bga-swipebacklayout:1.1.9@aar' + implementation 'com.android.support:support-v4:28.0.0' + implementation 'cn.bingoogolapple:bga-swipebacklayout:1.2.0@aar' // 上面两个依赖是必须的 @@ -27,9 +26,9 @@ dependencies { implementation 'cn.bingoogolapple:bga-refreshlayout:1.1.8@aar' implementation 'cn.bingoogolapple:bga-progressbar:1.0.1@aar' implementation 'cn.bingoogolapple:bga-swipeitemlayout:1.0.4@aar' - implementation 'com.android.support:design:27.1.1' - implementation 'com.android.support:palette-v7:27.1.1' - implementation 'com.android.support:recyclerview-v7:27.1.1' + implementation 'com.android.support:design:28.0.0' + implementation 'com.android.support:palette-v7:28.0.0' + implementation 'com.android.support:recyclerview-v7:28.0.0' implementation 'com.jaeger.statusbaruitl:library:1.4.0' debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4' releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4' diff --git a/gradle.properties b/gradle.properties index f079029..90b0625 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,25 +1,6 @@ -## Project-wide Gradle settings. -# -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html -# -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -# Default value: -Xmx1024m -XX:MaxPermSize=256m -# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -# -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true -#Tue Aug 01 00:54:36 CST 2017 -#systemProp.http.proxyHost=localhost -#systemProp.http.proxyPort=50451 - ANDROID_BUILD_MIN_SDK_VERSION=14 -ANDROID_BUILD_TARGET_SDK_VERSION=27 -ANDROID_BUILD_SDK_VERSION=27 -ANDROID_BUILD_TOOLS_VERSION=27.0.3 +ANDROID_BUILD_TARGET_SDK_VERSION=28 +ANDROID_BUILD_SDK_VERSION=28 -VERSION_NAME=1.1.9 -VERSION_CODE=119 \ No newline at end of file +VERSION_NAME=1.2.0 +VERSION_CODE=120 \ No newline at end of file diff --git a/library/build.gradle b/library/build.gradle index dabbbc7..4c546fa 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -2,7 +2,6 @@ apply plugin: 'com.android.library' android { compileSdkVersion ANDROID_BUILD_SDK_VERSION as int - buildToolsVersion ANDROID_BUILD_TOOLS_VERSION defaultConfig { minSdkVersion ANDROID_BUILD_MIN_SDK_VERSION as int @@ -15,7 +14,7 @@ android { } dependencies { - compileOnly 'com.android.support:support-v4:27.1.1' + compileOnly 'com.android.support:support-v4:28.0.0' } // ./gradlew :library:clean :library:build :library:bintrayUpload -PpublishAar diff --git a/library/src/main/java/cn/bingoogolapple/swipebacklayout/UIUtil.java b/library/src/main/java/cn/bingoogolapple/swipebacklayout/UIUtil.java index ca9c32d..bccbd35 100644 --- a/library/src/main/java/cn/bingoogolapple/swipebacklayout/UIUtil.java +++ b/library/src/main/java/cn/bingoogolapple/swipebacklayout/UIUtil.java @@ -41,9 +41,6 @@ private UIUtil() { /** * 获取底部导航栏高度 - * - * @param activity - * @return */ public static int getNavigationBarHeight(Activity activity) { int navigationBarHeight = 0; @@ -58,9 +55,6 @@ public static int getNavigationBarHeight(Activity activity) { /** * 是否为竖屏 - * - * @param activity - * @return */ public static boolean isPortrait(Activity activity) { return activity.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT; @@ -68,9 +62,6 @@ public static boolean isPortrait(Activity activity) { /** * 手机具有底部导航栏时,底部导航栏是否可见 - * - * @param activity - * @return */ private static boolean isNavigationBarVisible(Activity activity) { // View decorView = activity.getWindow().getDecorView(); @@ -85,7 +76,9 @@ private static boolean isNavigationBarVisible(Activity activity) { Configuration conf = activity.getResources().getConfiguration(); if (Configuration.ORIENTATION_LANDSCAPE == conf.orientation) { View contentView = decorView.findViewById(android.R.id.content); - show = (point.x != contentView.getWidth()); + if (contentView != null) { + show = (point.x != contentView.getWidth()); + } } else { Rect rect = new Rect(); decorView.getWindowVisibleDisplayFrame(rect); @@ -97,9 +90,6 @@ private static boolean isNavigationBarVisible(Activity activity) { /** * 检测是否具有底部导航栏 - * - * @param activity - * @return */ private static boolean checkDeviceHasNavigationBar(Activity activity) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { @@ -138,9 +128,6 @@ private static boolean checkDeviceHasNavigationBar(Activity activity) { /** * 获取屏幕高度,包括底部导航栏 - * - * @param activity - * @return */ public static int getRealScreenHeight(Activity activity) { WindowManager windowManager = activity.getWindowManager(); @@ -156,9 +143,6 @@ public static int getRealScreenHeight(Activity activity) { /** * 获取屏幕宽度,不包括右侧导航栏 - * - * @param activity - * @return */ public static int getRealScreenWidth(Activity activity) { WindowManager windowManager = activity.getWindowManager();