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

import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.sns.storage.n;
import com.tencent.mm.plugin.sns.ui.as.c;
import com.tencent.mm.plugin.sns.ui.at.b;
import com.tencent.mm.sdk.platformtools.ab;
import java.util.List;
import java.util.Map;

class as$1 implements b {
    final /* synthetic */ c rvE;
    final /* synthetic */ as rvF;

    as$1(as asVar, c cVar) {
        this.rvF = asVar;
        this.rvE = cVar;
    }

    public final void a(List<n> list, Map<Integer, Integer> map, Map<Integer, Integer> map2, Map<Integer, Integer> map3, int i, int i2) {
        AppMethodBeat.i(39200);
        ab.d("MicroMsg.SnsphotoAdapter", "onFinishFixPos");
        as asVar = this.rvF;
        ab.d("MicroMsg.SnsphotoAdapter", "setSnsList the thread id is " + Thread.currentThread().getId());
        if (list == null || list.size() <= 0) {
            AppMethodBeat.o(39200);
            return;
        }
        int i3;
        int i4;
        ab.d("MicroMsg.SnsphotoAdapter", "copy list info");
        int size = list.size();
        asVar.list.clear();
        asVar.rgf.clear();
        asVar.rgg.clear();
        asVar.rvt.clear();
        for (i3 = 0; i3 < size; i3++) {
            asVar.list.add(n.z((n) list.get(i3)));
        }
        for (Integer intValue : map.keySet()) {
            size = intValue.intValue();
            asVar.rgf.put(Integer.valueOf(size), Integer.valueOf(((Integer) map.get(Integer.valueOf(size))).intValue()));
        }
        for (Integer intValue2 : map2.keySet()) {
            size = intValue2.intValue();
            asVar.rgg.put(Integer.valueOf(size), Integer.valueOf(((Integer) map2.get(Integer.valueOf(size))).intValue()));
        }
        for (Integer intValue22 : map3.keySet()) {
            size = intValue22.intValue();
            asVar.rvt.put(Integer.valueOf(size), Integer.valueOf(((Integer) map3.get(Integer.valueOf(size))).intValue()));
        }
        map.clear();
        map2.clear();
        if (asVar.czr) {
            if (asVar.list.size() <= 1) {
                i4 = Integer.MAX_VALUE;
            } else {
                i4 = ((n) asVar.list.get(1)).field_head;
            }
            i3 = i4;
        } else {
            i3 = asVar.list.isEmpty() ? Integer.MAX_VALUE : ((n) asVar.list.get(0)).field_head;
        }
        asVar.rvy = 0;
        i4 = 0;
        while (true) {
            size = i4;
            if (size >= asVar.list.size()) {
                break;
            }
            if (!asVar.czr || size != 0) {
                if (i3 != ((n) asVar.list.get(size)).field_head) {
                    break;
                }
                asVar.rvy = Math.max(asVar.rvy, ((n) asVar.list.get(size)).field_createTime);
            }
            i4 = size + 1;
        }
        if (asVar.list.isEmpty() || (asVar.czr && asVar.list.size() == 1)) {
            asVar.rvy = Integer.MAX_VALUE;
        }
        if (asVar.list.isEmpty()) {
            i3 = 0;
        } else {
            i3 = ((n) asVar.list.get(asVar.list.size() - 1)).field_head;
        }
        asVar.rvz = Integer.MAX_VALUE;
        size = asVar.list.size() - 1;
        while (size >= 0 && r1 != 0 && r1 == ((n) asVar.list.get(size)).field_head) {
            asVar.rvz = Math.min(asVar.rvz, ((n) asVar.list.get(size)).field_createTime);
            size--;
        }
        if (asVar.list.isEmpty()) {
            asVar.rvz = 0;
        }
        asVar.rgi = i;
        asVar.rgh = i2;
        ab.d("MicroMsg.SnsphotoAdapter", "reallyCount " + i + " icount " + i2 + " stTime " + asVar.rvy + " edTIme " + asVar.rvz);
        asVar.notifyDataSetChanged();
        AppMethodBeat.o(39200);
    }

    public final void ctL() {
        AppMethodBeat.i(39201);
        this.rvF.notifyDataSetChanged();
        AppMethodBeat.o(39201);
    }
}
