package com.zhihu.matisse.internal.ui;

import android.database.Cursor;
import android.os.Bundle;
import com.zhihu.matisse.internal.entity.Album;
import com.zhihu.matisse.internal.entity.Item;
import java.util.ArrayList;
import ඓ.ᨨ.K.ඓ.ʬ.C0767;
import ඓ.ᨨ.K.ඓ.K.C0778;
import ඓ.ᨨ.K.ඓ.㸾.ʬ.C0783;
import ῲ.ᓣ.K.AbstractC1695;

public class AlbumPreviewActivity extends BasePreviewActivity implements C0767.AbstractC0768 {

    /* renamed from: ݜ  reason: contains not printable characters */
    public C0767 f3340 = new C0767();

    /* renamed from: 䀟  reason: contains not printable characters */
    public boolean f3341;

    @Override // androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.zhihu.matisse.internal.ui.BasePreviewActivity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        if (!C0778.C0779.f3967.f3951) {
            setResult(0);
            finish();
            return;
        }
        this.f3340.m2328(this, this);
        this.f3340.m2329((Album) getIntent().getParcelableExtra("extra_album"), false);
        Item item = (Item) getIntent().getParcelableExtra("extra_item");
        if (this.f3344.f3961) {
            this.f3355.setCheckedNum(this.f3354.m2315(item));
        } else {
            this.f3355.setChecked(this.f3354.m2326(item));
        }
        m1922(item);
    }

    @Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity
    public void onDestroy() {
        super.onDestroy();
        C0767 r0 = this.f3340;
        AbstractC1695 k = r0.f3920;
        if (k != null) {
            k.m4341(2);
        }
        r0.f3919 = null;
    }

    @Override // ඓ.ᨨ.K.ඓ.ʬ.C0767.AbstractC0768
    /* renamed from: K  reason: contains not printable characters */
    public void m1917(Cursor cursor) {
        ArrayList arrayList = new ArrayList();
        while (cursor.moveToNext()) {
            arrayList.add(Item.m1911(cursor));
        }
        if (!arrayList.isEmpty()) {
            C0783 r3 = (C0783) this.f3353.getAdapter();
            r3.f3974.addAll(arrayList);
            r3.m5807();
            if (!this.f3341) {
                this.f3341 = true;
                int indexOf = arrayList.indexOf((Item) getIntent().getParcelableExtra("extra_item"));
                this.f3353.m1002(indexOf, false);
                this.f3349 = indexOf;
            }
        }
    }

    @Override // ඓ.ᨨ.K.ඓ.ʬ.C0767.AbstractC0768
    /* renamed from: 㴹  reason: contains not printable characters */
    public void m1918() {
    }
}
