Skip to content

Commit 51bb54c

Browse files
committed
测试状态栏与滑动返回冲突问题
1 parent 64fad2a commit 51bb54c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

swipebackactivity/src/main/java/com/example/swipebackactivity/SwipeBackLayout.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import android.os.Build;
1010
import android.support.v4.view.ViewCompat;
1111
import android.util.AttributeSet;
12+
import android.util.Log;
1213
import android.view.MotionEvent;
1314
import android.view.View;
1415
import android.view.ViewGroup;
@@ -304,7 +305,7 @@ public void setScrollThresHold(float threshold) {
304305
/**
305306
* Set a drawable used for edge shadow.
306307
*
307-
* @param shadow Drawable to use
308+
* @param shadow Drawable to use
308309
* @param edgeFlag Combination of edge flags describing the edge to set
309310
* @see #EDGE_LEFT
310311
* @see #EDGE_RIGHT
@@ -324,7 +325,7 @@ public void setShadow(Drawable shadow, int edgeFlag) {
324325
/**
325326
* Set a drawable used for edge shadow.
326327
*
327-
* @param resId Resource of drawable to use
328+
* @param resId Resource of drawable to use
328329
* @param edgeFlag Combination of edge flags describing the edge to set
329330
* @see #EDGE_LEFT
330331
* @see #EDGE_RIGHT
@@ -460,11 +461,12 @@ public void attachToActivity(Activity activity) {
460461
a.recycle();
461462

462463
ViewGroup decor = (ViewGroup) activity.getWindow().getDecorView();
464+
Log.i("TAG", activity.getClass().getName() + ":" + decor.getChildCount());
463465
ViewGroup decorChild;
464466
//测试状态栏冲突问题
465-
if (Build.VERSION_CODES.KITKAT == Build.VERSION.SDK_INT){
467+
if (Build.VERSION_CODES.KITKAT == Build.VERSION.SDK_INT) {
466468
decorChild = (ViewGroup) decor.getChildAt(1);
467-
}else{
469+
} else {
468470
decorChild = (ViewGroup) decor.getChildAt(0);
469471
}
470472
decorChild.setBackgroundResource(background);

0 commit comments

Comments
 (0)