package xyz.netfly.mobile.view;

import android.view.LayoutInflater;
import android.widget.ImageView;
import androidx.recyclerview.widget.t;
import java.util.ArrayList;
import kotlinx.coroutines.y;
import org.drive_hunter.R;
import xyz.stream.api.entity.CreditsEntity;
import xyz.stream.view.BaseActivity;
import xyz.stream.view.BaseViewModel;
import xyz.stream.view.CustomImageView;
import xyz.stream.view.GridSpacingItemDecoration;
import xyz.stream.view.UiUtils;
import xyz.stream.view.tvrecyclerview.V7GridLayoutManager;

/* JADX INFO: loaded from: classes3.dex */
public class CastAndCrewDetailActivity extends BaseActivity<BaseViewModel, ie.c> {

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public static final /* synthetic */ int f35115f = 0;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public CreditsEntity f35116b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f35117c = 1;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final ArrayList f35118d = new ArrayList();

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public ke.n f35119e;

    @Override // xyz.stream.view.BaseActivity
    public final v3.a getViewBinding() {
        return ie.c.inflate(LayoutInflater.from(this), null, false);
    }

    @Override // xyz.stream.view.BaseActivity
    public final void initView() {
        this.f35116b = (CreditsEntity) getIntent().getParcelableExtra("cast_crew");
        ((ie.c) this.binding).f26716b.addOnOffsetChangedListener(new c(this, 0));
        xyz.stream.utils.e.d().getClass();
        if (xyz.stream.utils.e.e().contains("ar")) {
            ((ie.c) this.binding).f26717c.setScaleX(-1.0f);
        }
        ((ie.c) this.binding).f26717c.setOnClickListener(new com.google.android.material.textfield.b(this, 6));
        if (this.f35116b.getProfilePath() != null) {
            CustomImageView customImageView = ((ie.c) this.binding).f26718d;
            xyz.stream.api.q qVarG = xyz.stream.api.q.g();
            String profilePath = this.f35116b.getProfilePath();
            qVarG.getClass();
            CustomImageView.Request size = CustomImageView.Request.image(xyz.stream.api.q.f(profilePath)).radius(0).size(1080, 1920);
            ImageView.ScaleType scaleType = ImageView.ScaleType.CENTER_CROP;
            customImageView.load(size.scaleType(scaleType));
            CustomImageView customImageView2 = ((ie.c) this.binding).f26720f;
            xyz.stream.api.q qVarG2 = xyz.stream.api.q.g();
            String profilePath2 = this.f35116b.getProfilePath();
            qVarG2.getClass();
            customImageView2.load(CustomImageView.Request.image(xyz.stream.api.q.f(profilePath2)).radius(12).size(340, 425).scaleType(scaleType).placeholder(R.drawable.tv_default_head));
        }
        ((ie.c) this.binding).f26724j.setText(this.f35116b.getName());
        ((ie.c) this.binding).f26722h.setText((this.f35116b.getJob() == null || this.f35116b.getJob().isEmpty()) ? getString(R.string.acting) : this.f35116b.getJob());
        ((ie.c) this.binding).f26723i.setText(getString(R.string.known_for));
        V7GridLayoutManager v7GridLayoutManager = new V7GridLayoutManager(this, 3);
        GridSpacingItemDecoration gridSpacingItemDecoration = new GridSpacingItemDecoration(3, 30, false);
        ((ie.c) this.binding).f26721g.setLayoutManager(v7GridLayoutManager);
        ((ie.c) this.binding).f26721g.addItemDecoration(gridSpacingItemDecoration);
        this.f35117c = 1;
        ((ie.c) this.binding).f26721g.addOnScrollListener(new t(this, 1));
        ke.n nVar = new ke.n(this.f35118d, this);
        this.f35119e = nVar;
        ((ie.c) this.binding).f26721g.setAdapter(nVar);
        this.f35119e.setOnItemListener(new d(this));
        xyz.stream.api.o.f().t(this.f35117c, 12, 0, 0, null, null, null, "release_date", null, null, null, Integer.valueOf(this.f35116b.getPersonId()), new e(this));
    }

    @Override // xyz.stream.view.BaseActivity
    public final void onInit() {
        super.onInit();
        requestWindowFeature(1);
        y.S("MobileCastAndCrewDetailActivity");
        UiUtils.setStatusBar(this);
    }
}
