导航菜单

页面标题

页面副标题

爱心e站 v1.0.0 - SignViewActivity.java 源代码

正在查看: 爱心e站 v1.0.0 应用的 SignViewActivity.java JAVA 源代码文件

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


package com.newheyd.JZKFcanjiren.Activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
import com.newheyd.JZKFcanjiren.BaseActivity;
import com.newheyd.JZKFcanjiren.R;
import com.newheyd.JZKFcanjiren.Utils.FileUtil;
import com.newheyd.JZKFcanjiren.Utils.ImageUtil;
import com.newheyd.JZKFcanjiren.Utils.StastisticUtil;
import com.newheyd.JZKFcanjiren.Utils.locationUtil.LocationAddrUtil;
import com.newheyd.JZKFcanjiren.View.SignView;
import com.newheyd.JZKFcanjiren.model.BaseResult;
import com.newheyd.JZKFcanjiren.net.NewHYTask;
import java.io.File;
import java.util.HashMap;

public class SignViewActivity extends BaseActivity {
    private SignView signView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_sign_view);
        super.onCreate(savedInstanceState);
        goStatistics();
    }

    public void goStatistics() {
        HashMap<String, String> map = LocationAddrUtil.getInstance().getLocationParam(this.mContext);
        StastisticUtil.getInstance().onEvent(this.mContext, "SignViewActivity", map);
    }

    @Override
    public void onResponseBefore(NewHYTask task) {
    }

    @Override
    public void onResponseAfter(NewHYTask task) {
    }

    @Override
    public void onResponseSuccessful(NewHYTask task, BaseResult object) {
    }

    @Override
    public void onResponseError(NewHYTask task, BaseResult object) {
    }

    @Override
    public void onServerError(NewHYTask task, int failedType) {
    }

    @Override
    public void initViews() {
        this.signView = (SignView) findViewById(R.id.main_sign);
    }

    @Override
    public void setListener() {
        findViewById(R.id.btn_save).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String s = ImageUtil.getStorePath(SignViewActivity.this.mContext);
                File file = new File(s);
                if (file.exists()) {
                    FileUtil.deleteFile(s);
                } else {
                    file.mkdir();
                }
                String name = String.valueOf(System.currentTimeMillis());
                String imageName = s + "/" + name + ".jpg";
                boolean b = SignViewActivity.this.signView.saveImageToFile(imageName);
                if (b) {
                    Toast.makeText(SignViewActivity.this.mContext, "保存成功", 0).show();
                    Intent intent = new Intent();
                    intent.putExtra("imageUrl", imageName);
                    SignViewActivity.this.setResult(-1, intent);
                    SignViewActivity.this.finish();
                }
            }
        });
        findViewById(R.id.btn_clear).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                SignViewActivity.this.signView.clearPath();
            }
        });
    }
}