package com.tencent.mm.plugin.gallery.ui;

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.gallery.model.GalleryItem.MediaItem;
import com.tencent.mm.plugin.gallery.ui.a.b;
import com.tencent.mm.sdk.platformtools.r;
import java.util.Iterator;

class AlbumPreviewUI$3 implements b {
    final /* synthetic */ AlbumPreviewUI mPO;

    AlbumPreviewUI$3(AlbumPreviewUI albumPreviewUI) {
        this.mPO = albumPreviewUI;
    }

    public final void W(int i, int i2, int i3) {
        AppMethodBeat.i(21390);
        MediaItem ws = AlbumPreviewUI.a(this.mPO).ws(AlbumPreviewUI.a(this.mPO).mOM.size() + i2);
        if (i3 != 0) {
            AlbumPreviewUI.b(this.mPO, i);
            this.mPO.V(i2, false);
        } else if (ws != null && ws.getType() == 1) {
            AlbumPreviewUI.a(this.mPO, ws);
            AlbumPreviewUI.b(this.mPO, i);
            this.mPO.V(i2, true);
        } else if (ws == null || ws.getType() != 2) {
            AlbumPreviewUI.b(this.mPO, i);
            this.mPO.V(i2, true);
        } else if (AlbumPreviewUI.b(this.mPO, ws)) {
            AlbumPreviewUI.b(this.mPO, i);
            this.mPO.V(i2, true);
        } else {
            AlbumPreviewUI.a(this.mPO).mOI.remove(ws);
            AlbumPreviewUI.a(this.mPO).notifyDataSetChanged();
        }
        Iterator it = AlbumPreviewUI.a(this.mPO).bCw().iterator();
        while (it.hasNext()) {
            if (!r.amo((String) it.next())) {
                AppMethodBeat.o(21390);
                return;
            }
        }
        AlbumPreviewUI.a(this.mPO, true);
        AppMethodBeat.o(21390);
    }
}
