package com.google.android.material.appbar;

import android.view.View;
import androidx.core.view.y;

/* JADX INFO: compiled from: ViewOffsetHelper.java */
/* JADX INFO: loaded from: classes.dex */
class d {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private final View f3568a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private int f3569b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private int f3570c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private int f3571d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private int f3572e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private boolean f3573f = true;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private boolean f3574g = true;

    public d(View view) {
        this.f3568a = view;
    }

    void a() {
        View view = this.f3568a;
        y.c0(view, this.f3571d - (view.getTop() - this.f3569b));
        View view2 = this.f3568a;
        y.b0(view2, this.f3572e - (view2.getLeft() - this.f3570c));
    }

    public int b() {
        return this.f3571d;
    }

    void c() {
        this.f3569b = this.f3568a.getTop();
        this.f3570c = this.f3568a.getLeft();
    }

    public boolean d(int i3) {
        if (!this.f3574g || this.f3572e == i3) {
            return false;
        }
        this.f3572e = i3;
        a();
        return true;
    }

    public boolean e(int i3) {
        if (!this.f3573f || this.f3571d == i3) {
            return false;
        }
        this.f3571d = i3;
        a();
        return true;
    }
}
