package com.tencent.mm.plugin.story.ui.view.editor;

import a.f.a.m;
import a.f.b.j;
import a.f.b.k;
import a.l;
import a.v;
import a.y;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView.i;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.story.model.audio.AudioCacheInfo;
import com.tencent.mm.plugin.story.model.audio.AudioCacheInfo.a;

@l(dWo = {1, 1, 13}, dWp = {"\u0000\u0014\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\n¢\u0006\u0002\b\u0006"}, dWq = {"<anonymous>", "", "position", "", "info", "Lcom/tencent/mm/plugin/story/model/audio/AudioCacheInfo;", "invoke"})
final class EditorAudioView$1 extends k implements m<Integer, AudioCacheInfo, y> {
    final /* synthetic */ EditorAudioView sli;

    EditorAudioView$1(EditorAudioView editorAudioView) {
        this.sli = editorAudioView;
        super(2);
    }

    public final /* synthetic */ Object m(Object obj, Object obj2) {
        AppMethodBeat.i(110508);
        int intValue = ((Number) obj).intValue();
        AudioCacheInfo audioCacheInfo = (AudioCacheInfo) obj2;
        j.p(audioCacheInfo, "info");
        if (intValue != EditorAudioView.c(this.sli).getItemCount()) {
            i layoutManager = EditorAudioView.d(this.sli).getLayoutManager();
            if (layoutManager == null) {
                v vVar = new v("null cannot be cast to non-null type android.support.v7.widget.LinearLayoutManager");
                AppMethodBeat.o(110508);
                throw vVar;
            }
            LinearLayoutManager linearLayoutManager = (LinearLayoutManager) layoutManager;
            int iR = linearLayoutManager.iR();
            int iT = linearLayoutManager.iT();
            int i = audioCacheInfo.type;
            a aVar = AudioCacheInfo.rUj;
            if (i == AudioCacheInfo.cyK()) {
                EditorAudioView.d(this.sli).smoothScrollToPosition(intValue);
                this.sli.Fj(intValue);
            } else if (iR <= intValue && iT >= intValue) {
                this.sli.Fj(intValue);
            } else {
                EditorAudioView.d(this.sli).smoothScrollToPosition(intValue);
            }
        }
        y yVar = y.AUy;
        AppMethodBeat.o(110508);
        return yVar;
    }
}
