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

import android.os.Bundle;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import com.gingersoft.gsa.cloud.common.service.DataNotificationService;
import com.gingersoft.gsa.delivery_pick_mode.R;

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 -> {
            DataNotificationService.loginfo.setLength(0);
            loadInfo();
        });
        findViewById(R.id.btn_back).setOnClickListener(v ->finish());
    }

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