package com.example.miguel.saludoactivitylabapp;

import android.app.Activity;
import android.content.Context;
import android.widget.TextView;

import saludoactivitylabapp.R;

public class Counters {

    int mOnCreate;
    int mOnStart;
    int mOnResume;
    int mOnRestart;
    int mOnPause;
    int mOnStop;
    int mOnDestroy;

    public void incOnCreate() {
        this.mOnCreate += 1;
    }
    public int getOnCreate(){
       return mOnCreate;
    }

    public void incOnStart() {
        this.mOnStart += 1;
    }
    public int getOnStart(){
        return mOnStart;
    }

    public void incOnResume() {
        this.mOnResume +=1;
    }
    public int getOnResume(){
        return mOnResume;
    }

    public void incOnRestart() {
        this.mOnRestart +=1;
    }
    public int getOnRestart() {return mOnRestart;}

    public void incOnPause() {
        this.mOnPause +=1;
    }
    public int getOnPause() {return mOnPause;}

    public void incOnStop() {
        this.mOnStop +=1;
    }
    public int getOnStop() {return mOnStop;}

    public void incOnDestroy() {this.mOnDestroy +=1;}
    public int getOnDestroy() {return mOnDestroy;}

    public void UpdateUI(Context mContext){
        //OnCreate
        TextView tvOnCreate = (TextView) ((Activity)mContext).findViewById(R.id.tvOnCreate);
        tvOnCreate.setText(Integer.toString(mOnCreate));
        //OnStart
        TextView tvOnStart = (TextView) ((Activity)mContext).findViewById(R.id.tvOnStart);
        tvOnStart.setText(Integer.toString(mOnStart));
        //OnResume
        TextView tvOnResume = (TextView) ((Activity)mContext).findViewById(R.id.tvOnResume);
        tvOnResume.setText(Integer.toString(mOnResume));
        //OnRestart
        TextView tvOnRestart = (TextView) ((Activity)mContext).findViewById(R.id.tvOnRestart);
        tvOnRestart.setText(Integer.toString(mOnRestart));
        //OnPause
        TextView tvOnPause = (TextView) ((Activity)mContext).findViewById(R.id.tvOnPause);
        tvOnPause.setText(Integer.toString(mOnPause));
        //OnStop
        TextView tvOnStop = (TextView) ((Activity)mContext).findViewById(R.id.tvOnStop);
        tvOnStop.setText(Integer.toString(mOnStop));
        //OnDestroy
        TextView tvOnDestroy = (TextView) ((Activity)mContext).findViewById(R.id.tvOnDestroy);
        tvOnDestroy.setText(Integer.toString(mOnDestroy));
    }
}
