导航菜单

页面标题

页面副标题

Clash Legends v0.0.1 - TronActivity.java 源代码

正在查看: Clash Legends v0.0.1 应用的 TronActivity.java JAVA 源代码文件

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


package com.clash.legends.ui.activities;

import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.util.Log;
import android.view.Display;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidmads.library.qrgenearator.QRGEncoder;
import androidx.appcompat.app.AppCompatActivity;
import com.clash.legends.models.CurrentUser;
import com.clash.legends.utils.LocaleHelper;
import com.clash.legends.utils.UserLocalStore;
import java.text.DecimalFormat;
import java.text.NumberFormat;

public class TronActivity extends AppCompatActivity {
    TextView addmonytitle;
    ImageView back;
    Bitmap bitmap;
    Context context;
    public TextView dataEdt;
    public ImageView qrCodeIV;
    QRGEncoder qrgEncoder;
    Resources resources;
    TextView trondesc;
    TextView trontimer;
    CurrentUser user;
    UserLocalStore userLocalStore;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(2131558490);
        Context locale = LocaleHelper.setLocale(this);
        this.context = locale;
        this.resources = locale.getResources();
        UserLocalStore userLocalStore = new UserLocalStore(getApplicationContext());
        this.userLocalStore = userLocalStore;
        this.user = userLocalStore.getLoggedInUser();
        this.qrCodeIV = (ImageView) findViewById(2131362432);
        this.dataEdt = (TextView) findViewById(2131362431);
        this.trondesc = (TextView) findViewById(2131363556);
        this.trontimer = (TextView) findViewById(2131363557);
        TextView textView = (TextView) findViewById(2131361894);
        this.addmonytitle = textView;
        textView.setText(this.resources.getString(2131886150));
        this.trondesc.setText(this.resources.getString(2131887047));
        ImageView imageView = (ImageView) findViewById(2131361973);
        this.back = imageView;
        imageView.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                TronActivity.this.m220lambda$onCreate$0$comclashlegendsuiactivitiesTronActivity(view);
            }
        });
        new CountDownTimer(900000L, 1000L) {
            @Override
            public void onTick(long millisUntilFinished) {
                NumberFormat f = new DecimalFormat("00");
                long min = (millisUntilFinished / 60000) % 60;
                long sec = (millisUntilFinished / 1000) % 60;
                TronActivity.this.trontimer.setText(f.format(min) + ":" + f.format(sec));
            }

            @Override
            public void onFinish() {
                TronActivity.this.trontimer.setText("00:00:00");
            }
        }.start();
        Intent intent = getIntent();
        final String tronaddress = intent.getStringExtra("address");
        Log.d("rt", tronaddress);
        WindowManager manager = (WindowManager) getSystemService("window");
        Display display = manager.getDefaultDisplay();
        Point point = new Point();
        display.getSize(point);
        int width = point.x;
        int height = point.y;
        int dimen = width < height ? width : height;
        QRGEncoder qRGEncoder = new QRGEncoder(tronaddress, (Bundle) null, "TEXT_TYPE", (dimen * 8) / 4);
        this.qrgEncoder = qRGEncoder;
        Bitmap bitmap = qRGEncoder.getBitmap();
        this.bitmap = bitmap;
        this.qrCodeIV.setImageBitmap(bitmap);
        this.dataEdt.setText(tronaddress);
        this.dataEdt.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                TronActivity.this.m221lambda$onCreate$1$comclashlegendsuiactivitiesTronActivity(tronaddress, view);
            }
        });
    }

    void m220lambda$onCreate$0$comclashlegendsuiactivitiesTronActivity(View view) {
        onBackPressed();
    }

    void m221lambda$onCreate$1$comclashlegendsuiactivitiesTronActivity(String tronaddress, View v) {
        ClipboardManager clipboard = (ClipboardManager) getApplicationContext().getSystemService("clipboard");
        ClipData clip = ClipData.newPlainText(this.resources.getString(2131886925), tronaddress);
        clipboard.setPrimaryClip(clip);
        Toast.makeText(getApplicationContext(), this.resources.getString(2131886397), 0).show();
    }
}