Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.1.9 修复某些手机能够动态设置底部导航导致布局显示不全的问题 fix #108 fix #106 fix #99 fix #101 #117

Merged
merged 4 commits into from
Jun 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Change Log
==========

Version 1.1.9 *(2018-06-20)*
----------------------------

* 修复某些手机能够动态设置底部导航导致布局显示不全的问题 fix #108 fix #106 fix #99 fix #101

Version 1.1.8 *(2017-12-21)*
----------------------------

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.1.3'

// classpath 'com.novoda:bintray-release:0.7.0'
// classpath 'com.novoda:bintray-release:0.8.1'
}
}

Expand Down
16 changes: 8 additions & 8 deletions demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ android {

dependencies {
// 下面两个依赖是必须的
implementation 'com.android.support:support-v4:27.0.2'
implementation 'cn.bingoogolapple:bga-swipebacklayout:1.1.8@aar'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'cn.bingoogolapple:bga-swipebacklayout:1.1.9@aar'
// 上面两个依赖是必须的


// implementation project(':library')


// 下面的依赖不是必须的,只是为了方便演示 demo
implementation 'cn.bingoogolapple:bga-baseadapter:1.2.7@aar'
implementation 'cn.bingoogolapple:bga-refreshlayout:1.1.7@aar'
implementation 'cn.bingoogolapple:bga-progressbar:1.0.0@aar'
implementation 'cn.bingoogolapple:bga-baseadapter:1.2.9@aar'
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.0.2'
implementation 'com.android.support:palette-v7:27.0.2'
implementation 'com.android.support:recyclerview-v7:27.0.2'
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.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'
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#systemProp.http.proxyPort=50451

ANDROID_BUILD_MIN_SDK_VERSION=14
ANDROID_BUILD_TARGET_SDK_VERSION=26
ANDROID_BUILD_SDK_VERSION=26
ANDROID_BUILD_TOOLS_VERSION=26.0.3
ANDROID_BUILD_TARGET_SDK_VERSION=27
ANDROID_BUILD_SDK_VERSION=27
ANDROID_BUILD_TOOLS_VERSION=27.0.3

VERSION_NAME=1.1.8
VERSION_CODE=118
VERSION_NAME=1.1.9
VERSION_CODE=119
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
8 changes: 5 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ android {
}

dependencies {
compileOnly 'com.android.support:support-v4:27.0.2'
compileOnly 'com.android.support:support-v4:27.1.1'
}

// gradle clean build bintrayUpload
//apply from: 'https://raw.githubusercontent.com/bingoogolapple/PublishAar/master/jcenter-release.gradle'
// ./gradlew :library:clean :library:build :library:bintrayUpload -PpublishAar
if (hasProperty("publishAar")) {
apply from: 'https://raw.githubusercontent.com/bingoogolapple/PublishAar/master/jcenter-release.gradle'
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import android.app.Activity;
import android.content.Context;
import android.content.res.TypedArray;
import android.database.ContentObserver;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
Expand All @@ -32,10 +33,10 @@
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.provider.Settings;
import android.support.annotation.ColorInt;
import android.support.annotation.DrawableRes;
import android.support.annotation.FloatRange;
import android.support.annotation.StyleRes;
import android.support.v4.content.ContextCompat;
import android.support.v4.os.ParcelableCompat;
import android.support.v4.os.ParcelableCompatCreatorCallbacks;
Expand All @@ -53,6 +54,7 @@
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.accessibility.AccessibilityEvent;
import android.widget.Toast;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
Expand Down Expand Up @@ -215,12 +217,9 @@ public class BGASwipeBackLayout extends ViewGroup {
* 是否正在滑动
*/
private boolean mIsSliding;
//===========================新增END=======================

/**
* 将该滑动返回控件添加到 Activity 上
*
* @param activity
*/
void attachToActivity(Activity activity) {
mActivity = activity;
Expand All @@ -240,17 +239,13 @@ void attachToActivity(Activity activity) {

/**
* 设置滑动返回是否可用。默认值为 true
*
* @param swipeBackEnable
*/
void setSwipeBackEnable(boolean swipeBackEnable) {
mSwipeBackEnable = swipeBackEnable;
}

/**
* 设置是否仅仅跟踪左侧边缘的滑动返回。默认值为 true
*
* @param isOnlyTrackingLeftEdge
*/
void setIsOnlyTrackingLeftEdge(boolean isOnlyTrackingLeftEdge) {
mIsOnlyTrackingLeftEdge = isOnlyTrackingLeftEdge;
Expand All @@ -274,53 +269,41 @@ void setSwipeBackThreshold(@FloatRange(from = 0.0f, to = 1.0f) float threshold)

/**
* 设置底部导航条是否悬浮在内容上
*
* @param overlap
*/
void setIsNavigationBarOverlap(boolean overlap) {
mIsNavigationBarOverlap = overlap;
}

/**
* 是否正在滑动
*
* @return
*/
boolean isSliding() {
return this.mIsSliding;
}

/**
* 滑动返回是否可用
*
* @return
*/
private boolean isSwipeBackEnable() {
return mSwipeBackEnable && BGASwipeBackManager.getInstance().isSwipeBackEnable();
}

/**
* 设置阴影资源 id
*
* @param shadowResId
*/
void setShadowResId(@DrawableRes int shadowResId) {
mShadowView.setShadowResId(shadowResId);
}

/**
* 设置是否显示滑动返回的阴影效果
*
* @param isNeedShowShadow
*/
void setIsNeedShowShadow(boolean isNeedShowShadow) {
mShadowView.setIsNeedShowShadow(isNeedShowShadow);
}

/**
* 设置阴影区域的透明度是否根据滑动的距离渐变
*
* @param isShadowAlphaGradient
*/
void setIsShadowAlphaGradient(boolean isShadowAlphaGradient) {
mShadowView.setIsShadowAlphaGradient(isShadowAlphaGradient);
Expand Down Expand Up @@ -1793,7 +1776,7 @@ public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event)

@Override
public boolean onRequestSendAccessibilityEvent(ViewGroup host, View child,
AccessibilityEvent event) {
AccessibilityEvent event) {
if (!filter(child)) {
return super.onRequestSendAccessibilityEvent(host, child, event);
}
Expand All @@ -1810,7 +1793,7 @@ public boolean filter(View child) {
* Leave it private here as it's not general-purpose useful.
*/
private void copyNodeInfoNoChildren(AccessibilityNodeInfoCompat dest,
AccessibilityNodeInfoCompat src) {
AccessibilityNodeInfoCompat src) {
final Rect rect = mTmpRect;

src.getBoundsInParent(rect);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import android.app.Activity;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Point;
import android.graphics.Rect;
import android.os.Build;
import android.util.DisplayMetrics;
import android.view.Display;
Expand Down Expand Up @@ -51,6 +53,7 @@ public static int getNavigationBarHeight(Activity activity) {
navigationBarHeight = resources.getDimensionPixelSize(resourceId);
}
return navigationBarHeight;
// return 0;
}

/**
Expand All @@ -70,8 +73,26 @@ public static boolean isPortrait(Activity activity) {
* @return
*/
private static boolean isNavigationBarVisible(Activity activity) {
View decorView = activity.getWindow().getDecorView();
return (decorView.getSystemUiVisibility() & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) != 2;
// View decorView = activity.getWindow().getDecorView();
// return (decorView.getSystemUiVisibility() & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) != 2;

boolean show = false;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
Display display = activity.getWindow().getWindowManager().getDefaultDisplay();
Point point = new Point();
display.getRealSize(point);
View decorView = activity.getWindow().getDecorView();
Configuration conf = activity.getResources().getConfiguration();
if (Configuration.ORIENTATION_LANDSCAPE == conf.orientation) {
View contentView = decorView.findViewById(android.R.id.content);
show = (point.x != contentView.getWidth());
} else {
Rect rect = new Rect();
decorView.getWindowVisibleDisplayFrame(rect);
show = (rect.bottom != point.y);
}
}
return show;
}

/**
Expand Down