package com.ss.android.ugc.aweme.homepage.ui.slide;

import X.1hK;
import X.C4657EkX;
import X.M12;
import X.Qen;
import android.content.Context;
import android.content.ContextWrapper;
import android.graphics.Rect;
import com.bytedance.covode.number.Covode;
import com.bytedance.hox.Hox;

public abstract class AbsTabScrollProfileStrategy implements IXTabScrollProfileStrategy {
    public static boolean LIZ;
    public static final Rect LIZIZ = new Rect();
    public static final C4657EkX LIZJ = new C4657EkX((byte) 0);
    public final String LIZLLL;
    public final 1hK LJ;

    public abstract boolean LIZLLL();

    public final IXTabScrollProfileStrategy LIZIZ() {
        return this;
    }

    public final String LJFF() {
        return this.LIZLLL;
    }

    static {
        Covode.recordClassIndex(83161);
    }

    public final boolean LJ() {
        Context context = this.LJ;
        while (context != null) {
            if (context instanceof 1hK) {
                1hK r1 = (1hK) context;
                if (r1 == null) {
                    return false;
                }
                return Hox.LJ.LIZ(r1).LIZLLL(this.LIZLLL);
            } else if (!(context instanceof ContextWrapper)) {
                return false;
            } else {
                context = ((ContextWrapper) context).getBaseContext();
            }
        }
        return false;
    }

    public AbsTabScrollProfileStrategy(String str, 1hK r2) {
        M12.LIZ(str, r2);
        this.LIZLLL = str;
        this.LJ = r2;
    }

    public final boolean LIZ(float f, float f2) {
        if (!LJ() || LIZJ()) {
            return false;
        }
        int i = (int) f;
        int i2 = (int) f2;
        C4657EkX ekX = LIZJ;
        1hK r2 = this.LJ;
        boolean LIZ2 = Qen.LIZ(r2);
        if (LIZ2 != LIZ) {
            LIZ = LIZ2;
            ekX.LIZ(r2);
        }
        Rect rect = LIZIZ;
        if (rect.isEmpty() || !rect.contains(i, i2)) {
            return false;
        }
        return LIZLLL();
    }
}
