package com.gingersoft.gsa.other_order_mode.ui.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.TextView;

import com.gingersoft.gsa.other_order_mode.R;
import com.gingersoft.gsa.other_order_mode.service.GetInfoUpdateService;

public class LogActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_log);
        loadInfo();
        findViewById(R.id.btn_clear_log).setOnClickListener(v -> {
            GetInfoUpdateService.loginfo.setLength(0);
            loadInfo();
        });
        findViewById(R.id.btn_back).setOnClickListener(v ->finish());
    }

    private void loadInfo() {
        ((TextView) findViewById(R.id.tv_log)).setText(GetInfoUpdateService.loginfo.toString());
    }
}
