package com.tencent.mm.plugin.appbrand.widget.picker;

import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import com.tencent.matrix.trace.core.AppMethodBeat;

class YANumberPicker$1 extends Handler {
    final /* synthetic */ YANumberPicker jmw;

    YANumberPicker$1(YANumberPicker yANumberPicker, Looper looper) {
        this.jmw = yANumberPicker;
        super(looper);
    }

    public final void handleMessage(Message message) {
        int i = 0;
        AppMethodBeat.i(126757);
        switch (message.what) {
            case 1:
                if (YANumberPicker.a(this.jmw).qN.isFinished()) {
                    int c;
                    if (YANumberPicker.d(this.jmw) != 0) {
                        if (YANumberPicker.b(this.jmw) == 0) {
                            YANumberPicker.b(this.jmw, 1);
                        }
                        int e;
                        if (YANumberPicker.d(this.jmw) < (-YANumberPicker.e(this.jmw)) / 2) {
                            e = (int) ((((float) (YANumberPicker.e(this.jmw) + YANumberPicker.d(this.jmw))) * 300.0f) / ((float) YANumberPicker.e(this.jmw)));
                            int i2 = 0;
                            YANumberPicker.a(this.jmw).startScroll(0, YANumberPicker.f(this.jmw), i2, YANumberPicker.d(this.jmw) + YANumberPicker.e(this.jmw), e * 3);
                            c = YANumberPicker.c(this.jmw, (YANumberPicker.f(this.jmw) + YANumberPicker.e(this.jmw)) + YANumberPicker.d(this.jmw));
                            i = e;
                        } else {
                            e = (int) ((((float) (-YANumberPicker.d(this.jmw))) * 300.0f) / ((float) YANumberPicker.e(this.jmw)));
                            YANumberPicker.a(this.jmw).startScroll(0, YANumberPicker.f(this.jmw), 0, YANumberPicker.d(this.jmw), e * 3);
                            c = YANumberPicker.c(this.jmw, YANumberPicker.f(this.jmw) + YANumberPicker.d(this.jmw));
                            i = e;
                        }
                        this.jmw.postInvalidate();
                    } else {
                        YANumberPicker.b(this.jmw, 0);
                        c = YANumberPicker.c(this.jmw, YANumberPicker.f(this.jmw));
                    }
                    Message c2 = YANumberPicker.c(2, YANumberPicker.g(this.jmw), c, message.obj);
                    if (YANumberPicker.h(this.jmw)) {
                        YANumberPicker.i(this.jmw).sendMessageDelayed(c2, (long) (i * 2));
                        AppMethodBeat.o(126757);
                        return;
                    }
                    YANumberPicker.c(this.jmw).sendMessageDelayed(c2, (long) (i * 2));
                    AppMethodBeat.o(126757);
                    return;
                }
                if (YANumberPicker.b(this.jmw) == 0) {
                    YANumberPicker.b(this.jmw, 1);
                }
                YANumberPicker.c(this.jmw).sendMessageDelayed(YANumberPicker.c(1, 0, 0, message.obj), 32);
                AppMethodBeat.o(126757);
                return;
            case 2:
                YANumberPicker.a(this.jmw, message.arg1, message.arg2, message.obj);
                break;
        }
        AppMethodBeat.o(126757);
    }
}
