HeaderScrollingViewBehavior.java
4.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
package android.support.design.widget;
import android.content.Context;
import android.graphics.Rect;
import android.support.v4.view.GravityCompat;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.WindowInsetsCompat;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.MeasureSpec;
import android.view.ViewGroup.LayoutParams;
import java.util.List;
import m;
abstract class HeaderScrollingViewBehavior
extends ViewOffsetBehavior<View>
{
final Rect a = new Rect();
final Rect b = new Rect();
int c = 0;
private int d;
public HeaderScrollingViewBehavior() {}
public HeaderScrollingViewBehavior(Context paramContext, AttributeSet paramAttributeSet)
{
super(paramContext, paramAttributeSet);
}
float a(View paramView)
{
return 1.0F;
}
abstract View a(List<View> paramList);
int b(View paramView)
{
return paramView.getMeasuredHeight();
}
final int c(View paramView)
{
if (this.d == 0) {
return 0;
}
return m.a((int)(a(paramView) * this.d), 0, this.d);
}
public final int getOverlayTop()
{
return this.d;
}
protected void layoutChild(CoordinatorLayout paramCoordinatorLayout, View paramView, int paramInt)
{
View localView = a(paramCoordinatorLayout.getDependencies(paramView));
if (localView != null)
{
CoordinatorLayout.LayoutParams localLayoutParams = (CoordinatorLayout.LayoutParams)paramView.getLayoutParams();
Rect localRect = this.a;
localRect.set(paramCoordinatorLayout.getPaddingLeft() + localLayoutParams.leftMargin, localView.getBottom() + localLayoutParams.topMargin, paramCoordinatorLayout.getWidth() - paramCoordinatorLayout.getPaddingRight() - localLayoutParams.rightMargin, paramCoordinatorLayout.getHeight() + localView.getBottom() - paramCoordinatorLayout.getPaddingBottom() - localLayoutParams.bottomMargin);
WindowInsetsCompat localWindowInsetsCompat = paramCoordinatorLayout.getLastWindowInsets();
if ((localWindowInsetsCompat != null) && (ViewCompat.getFitsSystemWindows(paramCoordinatorLayout)) && (!ViewCompat.getFitsSystemWindows(paramView)))
{
localRect.left += localWindowInsetsCompat.getSystemWindowInsetLeft();
localRect.right -= localWindowInsetsCompat.getSystemWindowInsetRight();
}
paramCoordinatorLayout = this.b;
int j = localLayoutParams.gravity;
int i = j;
if (j == 0) {
i = 8388659;
}
GravityCompat.apply(i, paramView.getMeasuredWidth(), paramView.getMeasuredHeight(), localRect, paramCoordinatorLayout, paramInt);
paramInt = c(localView);
paramView.layout(paramCoordinatorLayout.left, paramCoordinatorLayout.top - paramInt, paramCoordinatorLayout.right, paramCoordinatorLayout.bottom - paramInt);
this.c = (paramCoordinatorLayout.top - localView.getBottom());
return;
}
super.layoutChild(paramCoordinatorLayout, paramView, paramInt);
this.c = 0;
}
public boolean onMeasureChild(CoordinatorLayout paramCoordinatorLayout, View paramView, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
{
int j = paramView.getLayoutParams().height;
if ((j == -1) || (j == -2))
{
View localView = a(paramCoordinatorLayout.getDependencies(paramView));
if (localView != null)
{
if ((ViewCompat.getFitsSystemWindows(localView)) && (!ViewCompat.getFitsSystemWindows(paramView)))
{
ViewCompat.setFitsSystemWindows(paramView, true);
if (ViewCompat.getFitsSystemWindows(paramView))
{
paramView.requestLayout();
return true;
}
}
int i = View.MeasureSpec.getSize(paramInt3);
paramInt3 = i;
if (i == 0) {
paramInt3 = paramCoordinatorLayout.getHeight();
}
int k = localView.getMeasuredHeight();
int m = b(localView);
if (j == -1) {}
for (i = 1073741824;; i = Integer.MIN_VALUE)
{
paramCoordinatorLayout.onMeasureChild(paramView, paramInt1, paramInt2, View.MeasureSpec.makeMeasureSpec(m + (paramInt3 - k), i), paramInt4);
return true;
}
}
}
return false;
}
public final void setOverlayTop(int paramInt)
{
this.d = paramInt;
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/design/widget/HeaderScrollingViewBehavior.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/