package com.tencent.mm.plugin.mmsight.segment;

import android.graphics.Bitmap;
import android.widget.ImageView;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.memory.o;
import com.tencent.mm.memory.o.b;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.ak;
import java.lang.ref.WeakReference;

class RecyclerThumbSeekBar$b implements Runnable {
    private WeakReference<ImageView> aIp;
    boolean fIa = false;
    private ak handler;
    private int oyB;
    private Bitmap oyC;
    final /* synthetic */ RecyclerThumbSeekBar oyy;

    RecyclerThumbSeekBar$b(RecyclerThumbSeekBar recyclerThumbSeekBar, int i, ImageView imageView, Bitmap bitmap, ak akVar) {
        this.oyy = recyclerThumbSeekBar;
        AppMethodBeat.i(54986);
        this.oyB = i;
        this.aIp = new WeakReference(imageView);
        this.handler = akVar;
        this.oyC = bitmap;
        AppMethodBeat.o(54986);
    }

    public final void run() {
        AppMethodBeat.i(54987);
        if (this.fIa) {
            o.fdT.f(this.oyC);
            AppMethodBeat.o(54987);
        } else if (((ImageView) this.aIp.get()) == null) {
            o.fdT.f(this.oyC);
            AppMethodBeat.o(54987);
        } else {
            try {
                d bQd = RecyclerThumbSeekBar.g(this.oyy).bQd();
                if (this.oyC == null) {
                    this.oyC = o.fdT.a(new b(bQd.getScaledWidth(), bQd.getScaledHeight()));
                }
                bQd.reuseBitmap(this.oyC);
                if (!this.fIa) {
                    this.oyC = bQd.getFrameAtTime((long) this.oyB);
                }
                RecyclerThumbSeekBar.g(this.oyy).a(bQd);
                if (this.oyC == null || this.fIa || this.aIp.get() == null) {
                    o.fdT.f(this.oyC);
                    AppMethodBeat.o(54987);
                    return;
                }
                this.handler.post(new RecyclerThumbSeekBar$a(this.oyy, this.oyC, (ImageView) this.aIp.get(), this));
                AppMethodBeat.o(54987);
            } catch (Exception e) {
                ab.e("RecyclerThumbSeekBar", "get bitmap error " + e.getMessage());
                o.fdT.f(this.oyC);
                AppMethodBeat.o(54987);
            }
        }
    }
}
