package com.zjut.gc502.mobilephonesafeprotector.hightools.utils;

import android.app.Activity;
import android.view.View;
import android.widget.TextView;

import com.zjut.gc502.mobilephonesafeprotector.R;

import java.text.BreakIterator;

/**
 * Created by ScienceHistory on 16/4/30.
 */
public class SetTitleUtil {
    public static void setTitleStyle(final Activity context, String titleName, int titleColor) {
        context.findViewById(R.id.ll_titlebar).setBackgroundColor(
                context.getResources().getColor(titleColor));
        ((TextView)context.findViewById(R.id.tv_title)).setText(titleName);
        context.findViewById(R.id.iv_leftbtn).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                context.finish();
            }
        });
    }
}
