67 lines
1.7 KiB
Java
67 lines
1.7 KiB
Java
package com.google.android.material.appbar;
|
|
|
|
import android.content.Context;
|
|
import android.util.AttributeSet;
|
|
import android.view.View;
|
|
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
|
|
|
/* loaded from: classes.dex */
|
|
class ViewOffsetBehavior<V extends View> extends CoordinatorLayout.Behavior<V> {
|
|
private ViewOffsetHelper a;
|
|
private int b;
|
|
private int c;
|
|
|
|
public ViewOffsetBehavior() {
|
|
this.b = 0;
|
|
this.c = 0;
|
|
}
|
|
|
|
@Override // androidx.coordinatorlayout.widget.CoordinatorLayout.Behavior
|
|
public boolean a(CoordinatorLayout coordinatorLayout, V v, int i) {
|
|
b(coordinatorLayout, (CoordinatorLayout) v, i);
|
|
if (this.a == null) {
|
|
this.a = new ViewOffsetHelper(v);
|
|
}
|
|
this.a.c();
|
|
int i2 = this.b;
|
|
if (i2 != 0) {
|
|
this.a.b(i2);
|
|
this.b = 0;
|
|
}
|
|
int i3 = this.c;
|
|
if (i3 == 0) {
|
|
return true;
|
|
}
|
|
this.a.a(i3);
|
|
this.c = 0;
|
|
return true;
|
|
}
|
|
|
|
protected void b(CoordinatorLayout coordinatorLayout, V v, int i) {
|
|
coordinatorLayout.c(v, i);
|
|
}
|
|
|
|
public int b() {
|
|
ViewOffsetHelper viewOffsetHelper = this.a;
|
|
if (viewOffsetHelper != null) {
|
|
return viewOffsetHelper.b();
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
public ViewOffsetBehavior(Context context, AttributeSet attributeSet) {
|
|
super(context, attributeSet);
|
|
this.b = 0;
|
|
this.c = 0;
|
|
}
|
|
|
|
public boolean a(int i) {
|
|
ViewOffsetHelper viewOffsetHelper = this.a;
|
|
if (viewOffsetHelper != null) {
|
|
return viewOffsetHelper.b(i);
|
|
}
|
|
this.b = i;
|
|
return false;
|
|
}
|
|
}
|