导航菜单

页面标题

页面副标题

大众借. v4.1.2 - R0ACT.java 源代码

正在查看: 大众借. v4.1.2 应用的 R0ACT.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.shiliuj.ui.activitys;

import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.OnClick;
import com.base.commonlibrary.utils.ACacheUtil;
import com.base.commonlibrary.views.TitleLayout;
import com.shiliuj.mjyp.app.api.AppConfig;
import com.shiliuj.mjyp.app.base.BaseBindActivity;
import com.shiliuj.ui.lockView.LockPatternIndicator;
import com.shiliuj.ui.lockView.LockPatternUtil;
import com.shiliuj.ui.lockView.LockPatternView;
import java.util.ArrayList;
import java.util.List;

public class R0ACT extends BaseBindActivity {
    private static final long DELAYTIME = 600;
    private ACacheUtil aCache;

    @BindView(2131296671)
    LockPatternIndicator lockPatternIndicator;

    @BindView(2131296672)
    LockPatternView lockPatternView;

    @BindView(2131296688)
    TextView messageTv;

    @BindView(2131296806)
    Button resetBtn;

    @BindView(2131296998)
    TitleLayout title;
    private List<LockPatternView.Cell> mChosenPattern = null;
    private LockPatternView.OnPatternListener patternListener = new LockPatternView.OnPatternListener() {
        public void onPatternStart() {
            R0ACT.this.lockPatternView.removePostClearPatternRunnable();
            R0ACT.this.lockPatternView.setPattern(LockPatternView.DisplayMode.DEFAULT);
        }

        public void onPatternComplete(List<LockPatternView.Cell> list) {
            if (R0ACT.this.mChosenPattern != null || list.size() < AppConfig.GESTURE_point.intValue()) {
                if (R0ACT.this.mChosenPattern != null || list.size() >= AppConfig.GESTURE_point.intValue()) {
                    if (R0ACT.this.mChosenPattern != null) {
                        if (R0ACT.this.mChosenPattern.equals(list)) {
                            R0ACT.this.updateStatus(Status.CONFIRMCORRECT, list);
                            return;
                        } else {
                            R0ACT.this.updateStatus(Status.CONFIRMERROR, list);
                            return;
                        }
                    }
                    return;
                }
                R0ACT.this.updateStatus(Status.LESSERROR, list);
                return;
            }
            R0ACT.this.mChosenPattern = new ArrayList(list);
            R0ACT.this.updateStatus(Status.CORRECT, list);
        }
    };

    protected boolean canLoadMore() {
        return false;
    }

    public int getLayoutId() {
        return 2131492923;
    }

    public void initPresenter() {
    }

    protected void loadMore() {
    }

    protected void refresh() {
    }

    public void initView(Bundle bundle) {
        this.aCache = ACacheUtil.get(this);
        this.lockPatternView.setOnPatternListener(this.patternListener);
    }

    public void updateStatus(Status status, List<LockPatternView.Cell> list) {
        this.messageTv.setTextColor(getResources().getColor(status.colorId));
        this.messageTv.setText(status.strId);
        int i = AnonymousClass2.$SwitchMap$com$shiliuj$ui$activitys$R0ACT$Status[status.ordinal()];
        if (i == 1) {
            this.lockPatternView.setPattern(LockPatternView.DisplayMode.DEFAULT);
            return;
        }
        if (i == 2) {
            updateLockPatternIndicator();
            this.lockPatternView.setPattern(LockPatternView.DisplayMode.DEFAULT);
            return;
        }
        if (i == 3) {
            this.lockPatternView.setPattern(LockPatternView.DisplayMode.DEFAULT);
            return;
        }
        if (i == 4) {
            this.lockPatternView.setPattern(LockPatternView.DisplayMode.ERROR);
            this.lockPatternView.postClearPatternRunnable(DELAYTIME);
        } else {
            if (i != 5) {
                return;
            }
            saveChosenPattern(list);
            this.lockPatternView.setPattern(LockPatternView.DisplayMode.DEFAULT);
            setLockPatternSuccess();
        }
    }

    static class AnonymousClass2 {
        static final int[] $SwitchMap$com$shiliuj$ui$activitys$R0ACT$Status;

        static {
            int[] iArr = new int[Status.values().length];
            $SwitchMap$com$shiliuj$ui$activitys$R0ACT$Status = iArr;
            try {
                iArr[Status.DEFAULT.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                $SwitchMap$com$shiliuj$ui$activitys$R0ACT$Status[Status.CORRECT.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                $SwitchMap$com$shiliuj$ui$activitys$R0ACT$Status[Status.LESSERROR.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                $SwitchMap$com$shiliuj$ui$activitys$R0ACT$Status[Status.CONFIRMERROR.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                $SwitchMap$com$shiliuj$ui$activitys$R0ACT$Status[Status.CONFIRMCORRECT.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
        }
    }

    private void updateLockPatternIndicator() {
        List<LockPatternView.Cell> list = this.mChosenPattern;
        if (list == null) {
            return;
        }
        this.lockPatternIndicator.setIndicator(list);
    }

    @OnClick({2131296806})
    void resetLockPattern() {
        this.mChosenPattern = null;
        this.lockPatternIndicator.setDefaultIndicator();
        updateStatus(Status.DEFAULT, null);
        this.lockPatternView.setPattern(LockPatternView.DisplayMode.DEFAULT);
    }

    private void setLockPatternSuccess() {
        showShortToast(getResources().getString(2131689749));
        finish();
    }

    private void saveChosenPattern(List<LockPatternView.Cell> list) {
        this.aCache.put("GESTURE_PASSWORD", LockPatternUtil.patternToHash(list));
    }

    private enum Status {
        DEFAULT(2131689620, 2131099703),
        CORRECT(2131689619, 2131099703),
        LESSERROR(2131689621, 2131099901),
        CONFIRMERROR(2131689618, 2131099901),
        CONFIRMCORRECT(2131689617, 2131099703);

        private int colorId;
        private int strId;

        Status(int i, int i2) {
            this.strId = i;
            this.colorId = i2;
        }
    }
}