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

import X.2xd;
import X.7ku;
import X.8Zd;
import X.8Ze;
import X.8ec;
import X.9Fh;
import X.9Fi;
import X.9Ft;
import X.9Fx;
import X.C4865Ent;
import X.RY1;
import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.Drawable;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.main.uiApiImpl.HomePageUIFrameServiceImpl;
import com.ss.android.ugc.aweme.search.SearchServiceImpl;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class PreDrawableInflate implements IPreDrawableInflate {
    public final Map<String, Object> LIZIZ = new ConcurrentHashMap();
    public final Map<Integer, Drawable> LIZJ = new ConcurrentHashMap();
    public Class<? extends Activity> LIZLLL;

    static {
        Covode.recordClassIndex(83150);
    }

    public boolean meetTrigger() {
        return true;
    }

    public String prefix() {
        return "inflate_";
    }

    public void run(Context context) {
    }

    public int targetProcess() {
        return 1048575;
    }

    public List triggerOtherLegoComponents() {
        return null;
    }

    public 9Fx scenesType() {
        return 9Fx.DEFAULT;
    }

    public 9Ft triggerType() {
        return 9Ft.INFLATE;
    }

    public final Class<? extends Activity> LIZ() {
        Class<? extends Activity> cls = this.LIZLLL;
        if (cls != null) {
            return cls;
        }
        return HomePageUIFrameServiceImpl.LJ().LIZ();
    }

    public String key() {
        return getClass().getSimpleName();
    }

    public final Drawable LIZIZ() {
        Drawable remove = this.LIZJ.remove(-100);
        if (remove == null) {
            return null;
        }
        return remove;
    }

    public final Object LIZ(String str) {
        return this.LIZIZ.get(str);
    }

    private void LIZIZ(int i, Context context) {
        try {
            this.LIZJ.put(Integer.valueOf(i), context.getResources().getDrawable(i));
        } catch (Exception unused) {
        }
    }

    private void LIZJ(int i, Context context) {
        this.LIZJ.put(Integer.valueOf(i), 2xd.LIZ(new C4865Ent(i)).LIZ(context));
    }

    public final Drawable LIZ(int i, Context context) {
        Drawable remove = this.LIZJ.remove(Integer.valueOf(i));
        if (remove == null) {
            return context.getResources().getDrawable(i);
        }
        return remove;
    }

    public final void LIZ(Context context, Activity activity) {
        LIZIZ(2131233275, context);
        LIZIZ(2131230829, context);
        LIZIZ(2131232314, context);
        if (SearchServiceImpl.LJJIIZ().LJIIIZ()) {
            LIZIZ(2131232301, context);
            LIZIZ(2131232299, context);
            LIZIZ(2131232300, context);
        } else {
            LIZIZ(2131232317, context);
            LIZIZ(2131232316, context);
            LIZIZ(2131232319, context);
        }
        LIZJ(2131755678, context);
        LIZJ(2131755274, context);
        LIZJ(2131755273, context);
        LIZIZ(2131232312, context);
        LIZIZ(2131232305, context);
        LIZIZ(2131232308, context);
        LIZIZ(2131232325, context);
        LIZIZ(2131232324, context);
        if (((Boolean) 7ku.LIZLLL.getValue()).booleanValue()) {
            LIZIZ(2131232517, context);
            LIZIZ(2131232288, context);
            LIZIZ(2131233321, context);
            LIZIZ(2131233325, context);
            LIZIZ(2131233988, context);
            LIZIZ(2131232291, context);
            LIZIZ(2131099677, context);
        }
        try {
            this.LIZIZ.put("status_bar_height", Integer.valueOf(context.getResources().getDimensionPixelSize(context.getResources().getIdentifier("status_bar_height", "dimen", "android"))));
        } catch (Exception unused) {
        }
        if (((Boolean) RY1.LIZ.getValue()).booleanValue()) {
            9Fh r0 = 9Fh.LJIILIIL;
            new 9Fi().LIZ(new 8Ze() {
                static {
                    Covode.recordClassIndex(83151);
                }

                public boolean meetTrigger() {
                    return true;
                }

                public String prefix() {
                    return "task_";
                }

                public boolean serialExecute() {
                    return false;
                }

                public int targetProcess() {
                    return 1048575;
                }

                public List triggerOtherLegoComponents() {
                    return null;
                }

                public 9Ft triggerType() {
                    return 8Zd.LIZ(this);
                }

                public 9Fx scenesType() {
                    return 9Fx.DEFAULT;
                }

                public 8ec type() {
                    return 8ec.BOOT_FINISH;
                }

                public String key() {
                    return getClass().getSimpleName();
                }

                public void run(Context context) {
                    PreDrawableInflate preDrawableInflate = PreDrawableInflate.this;
                    preDrawableInflate.LIZIZ.clear();
                    preDrawableInflate.LIZJ.clear();
                }
            });
        }
    }
}
