package com.uiui.zyappstore.activity;

import android.content.Intent;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.constraintlayout.widget.ConstraintLayout;

import com.uiui.zyappstore.R;
import com.uiui.zyappstore.base.BaseActivity;

public class HintActivity extends BaseActivity {
    private ConstraintLayout root;
    private TextView tv_hint;
    private Button bt_confirm;

    @Override
    protected int setLayoutResourceID() {
        return R.layout.activity_hint;
    }

    @Override
    public void initView() {
        root = findViewById(R.id.root);
        tv_hint = findViewById(R.id.tv_hint);
        bt_confirm = findViewById(R.id.bt_confirm);

    }

    @Override
    public void initData() {
        Intent intent = getIntent();
        if (intent != null) {
            String text = intent.getStringExtra("text");
            if (!TextUtils.isEmpty(text)) {
                tv_hint.setText(text);
            }
        }
    }

    @Override
    protected void setListener() {
        root.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

            }
        });

        bt_confirm.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                ApkUtils.openApp(HintActivity.this, "com.uiui.sn");
                finish();
            }
        });
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        // TODO Auto-generated method stub
        if (keyCode == KeyEvent.KEYCODE_BACK) {
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }
}
