ScrimInsetsFrameLayout.java
4.02 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
package android.support.design.internal;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.annotation.RestrictTo;
import android.support.design.R.style;
import android.support.design.R.styleable;
import android.support.v4.view.OnApplyWindowInsetsListener;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.WindowInsetsCompat;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
@RestrictTo({android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP})
public class ScrimInsetsFrameLayout
extends FrameLayout
{
Drawable a;
Rect b;
private Rect c = new Rect();
public ScrimInsetsFrameLayout(Context paramContext)
{
this(paramContext, null);
}
public ScrimInsetsFrameLayout(Context paramContext, AttributeSet paramAttributeSet)
{
this(paramContext, paramAttributeSet, 0);
}
public ScrimInsetsFrameLayout(Context paramContext, AttributeSet paramAttributeSet, int paramInt)
{
super(paramContext, paramAttributeSet, paramInt);
paramContext = paramContext.obtainStyledAttributes(paramAttributeSet, R.styleable.ScrimInsetsFrameLayout, paramInt, R.style.Widget_Design_ScrimInsetsFrameLayout);
this.a = paramContext.getDrawable(R.styleable.ScrimInsetsFrameLayout_insetForeground);
paramContext.recycle();
setWillNotDraw(true);
ViewCompat.setOnApplyWindowInsetsListener(this, new OnApplyWindowInsetsListener()
{
public final WindowInsetsCompat onApplyWindowInsets(View paramAnonymousView, WindowInsetsCompat paramAnonymousWindowInsetsCompat)
{
if (ScrimInsetsFrameLayout.this.b == null) {
ScrimInsetsFrameLayout.this.b = new Rect();
}
ScrimInsetsFrameLayout.this.b.set(paramAnonymousWindowInsetsCompat.getSystemWindowInsetLeft(), paramAnonymousWindowInsetsCompat.getSystemWindowInsetTop(), paramAnonymousWindowInsetsCompat.getSystemWindowInsetRight(), paramAnonymousWindowInsetsCompat.getSystemWindowInsetBottom());
ScrimInsetsFrameLayout.this.onInsetsChanged(paramAnonymousWindowInsetsCompat);
paramAnonymousView = ScrimInsetsFrameLayout.this;
if ((!paramAnonymousWindowInsetsCompat.hasSystemWindowInsets()) || (ScrimInsetsFrameLayout.this.a == null)) {}
for (boolean bool = true;; bool = false)
{
paramAnonymousView.setWillNotDraw(bool);
ViewCompat.postInvalidateOnAnimation(ScrimInsetsFrameLayout.this);
return paramAnonymousWindowInsetsCompat.consumeSystemWindowInsets();
}
}
});
}
public void draw(@NonNull Canvas paramCanvas)
{
super.draw(paramCanvas);
int i = getWidth();
int j = getHeight();
if ((this.b != null) && (this.a != null))
{
int k = paramCanvas.save();
paramCanvas.translate(getScrollX(), getScrollY());
this.c.set(0, 0, i, this.b.top);
this.a.setBounds(this.c);
this.a.draw(paramCanvas);
this.c.set(0, j - this.b.bottom, i, j);
this.a.setBounds(this.c);
this.a.draw(paramCanvas);
this.c.set(0, this.b.top, this.b.left, j - this.b.bottom);
this.a.setBounds(this.c);
this.a.draw(paramCanvas);
this.c.set(i - this.b.right, this.b.top, i, j - this.b.bottom);
this.a.setBounds(this.c);
this.a.draw(paramCanvas);
paramCanvas.restoreToCount(k);
}
}
protected void onAttachedToWindow()
{
super.onAttachedToWindow();
if (this.a != null) {
this.a.setCallback(this);
}
}
protected void onDetachedFromWindow()
{
super.onDetachedFromWindow();
if (this.a != null) {
this.a.setCallback(null);
}
}
public void onInsetsChanged(WindowInsetsCompat paramWindowInsetsCompat) {}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/design/internal/ScrimInsetsFrameLayout.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/