package com.tsi.navi.activity.dialog;

import android.content.Context;
import android.os.Bundle;
import android.widget.EditText;

import androidx.annotation.NonNull;

import com.tsi.navi.R;
import com.tsi.navi.preferences.PrefManager;

public class AppInformationDialog extends BaseDialog {

    public AppInformationDialog(@NonNull Context context, @NonNull IDialogClickListener clickListener) {
        super(context, clickListener);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_app_information);
        setupButton(R.string.dialog_title_app_information, true);

        displayAppInfo();
    }

    private void displayAppInfo() {
        EditText edDeviceId = findViewById(R.id.ed_deviceId);
        if (edDeviceId != null) {
            edDeviceId.setText(PrefManager.getDeviceId(context));
            /*ClipboardManager clipboardManager = (ClipboardManager)getSystemService(CLIPBOARD_SERVICE);
            ClipData clipData = ClipData.newPlainText("label", edDeviceId.getText().toString());
            clipboardManager.setPrimaryClip(clipData);*/
        }

        EditText edAppVersion = findViewById(R.id.ed_app_version);
        if (edAppVersion != null) {
            edAppVersion.setText(PrefManager.getAppVersion(context));
        }

    }
}
