package com.hyperling.apps.the45minuterule;

import android.content.res.Resources;
import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

public class Tips extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tips);

        Resources recs = getResources();

        String[] tips = recs.getStringArray(R.array.tips_tips_array);

        LinearLayout layout = (LinearLayout) findViewById(R.id.layTipsArray);

        int colorCounter = 0;
        for (String tip : tips){
            TextView newTip = new TextView(this);

            newTip.setText(tip);

            newTip.setPadding(8,8,0,4);

            if (colorCounter % 2 == 0){
                newTip.setTextColor(recs.getColor(R.color.colorAccent));
            }
            else{
                newTip.setTextColor(recs.getColor(R.color.colorPrimaryDark));
            }

            layout.addView(newTip);

            colorCounter++;
        }
    }
}
