package com.ss.android.ugc.aweme.views;

import X.0E3;
import X.0EL;
import X.0EQ;
import X.0Gf;
import X.0Gp;
import X.2kf;
import X.JMR;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.bytedance.covode.number.Covode;
import java.util.concurrent.Callable;

public class WrapLinearLayoutManager extends LinearLayoutManager {
    public 0E3 LJFF;
    public JMR LJI;
    public boolean LJII = true;

    static {
        Covode.recordClassIndex(123772);
    }

    public WrapLinearLayoutManager() {
    }

    public WrapLinearLayoutManager(int i) {
        super(i, false);
    }

    public static void LIZ(final 0E3 r3) {
        if (r3 != null) {
            0Gp.LIZ(new Callable<Void>() {
                static {
                    Covode.recordClassIndex(123773);
                }

                /* access modifiers changed from: private */
                /* renamed from: LIZ */
                public Void call() {
                    try {
                        r3.notifyDataSetChanged();
                        return null;
                    } catch (Exception e) {
                        2kf.LIZ(r3.getClass().getName(), e);
                        return null;
                    }
                }
            }, 0Gp.LIZIZ, (0Gf) null);
        }
    }

    private IndexOutOfBoundsException LIZ(IndexOutOfBoundsException indexOutOfBoundsException) {
        if (this.LJFF == null) {
            return indexOutOfBoundsException;
        }
        IndexOutOfBoundsException indexOutOfBoundsException2 = new IndexOutOfBoundsException(this.LJFF.getClass().getName());
        indexOutOfBoundsException2.initCause(indexOutOfBoundsException);
        return indexOutOfBoundsException2;
    }

    public void LIZ(0EQ r2) {
        WrapLinearLayoutManager.super.LIZ(r2);
        JMR jmr = this.LJI;
        if (jmr != null) {
            jmr.LIZ();
        }
    }

    public final void LIZ(0E3 r1, 0E3 r2) {
        WrapLinearLayoutManager.super.LIZ(r1, r2);
        this.LJFF = r2;
    }

    public void LIZJ(0EL r5, 0EQ r6) {
        try {
            WrapLinearLayoutManager.super.LIZJ(r5, r6);
        } catch (IndexOutOfBoundsException e) {
            if (this.LJFF != null) {
                2kf.LIZ(this.LJFF.getClass().getName(), LIZ(e));
            }
        } catch (IllegalArgumentException e2) {
            e = e2;
            if (this.LJFF != null) {
                String name = this.LJFF.getClass().getName();
                if (this.LJFF != null) {
                    e = new IllegalArgumentException(this.LJFF.getClass().getName(), e);
                }
                2kf.LIZ(name, e);
            }
        } catch (NullPointerException e3) {
            if (this.LJFF != null) {
                2kf.LIZ(this.LJFF.getClass().getName(), e3);
                LIZ(this.LJFF);
            }
        }
    }

    public final int LIZ(int i, 0EL r5, 0EQ r6) {
        try {
            return WrapLinearLayoutManager.super.LIZ(i, r5, r6);
        } catch (IndexOutOfBoundsException e) {
            if (this.LJFF == null) {
                return 0;
            }
            2kf.LIZ(this.LJFF.getClass().getName(), LIZ(e));
            return 0;
        }
    }

    public final int LIZIZ(int i, 0EL r6, 0EQ r7) {
        try {
            if (this.LJII) {
                return WrapLinearLayoutManager.super.LIZIZ(i, r6, r7);
            }
            return 1;
        } catch (IndexOutOfBoundsException e) {
            0E3 r0 = this.LJFF;
            if (r0 != null) {
                2kf.LIZ(r0.getClass().getName(), LIZ(e));
            }
            return 0;
        } catch (NullPointerException e2) {
            0E3 r02 = this.LJFF;
            if (r02 != null) {
                2kf.LIZ(r02.getClass().getName(), e2);
                LIZ(this.LJFF);
            }
            return 0;
        }
    }

    public WrapLinearLayoutManager(Context context, AttributeSet attributeSet, int i, int i2) {
        super(context, attributeSet, i, i2);
    }

    public final View LIZ(View view, int i, 0EL r6, 0EQ r7) {
        try {
            return WrapLinearLayoutManager.super.LIZ(view, i, r6, r7);
        } catch (IndexOutOfBoundsException e) {
            if (this.LJFF == null) {
                return null;
            }
            2kf.LIZ(this.LJFF.getClass().getName(), LIZ(e));
            return null;
        }
    }
}
