/*
* This file is part of FanshaweConnect.
*
* Copyright 2013 Gabriel Castro (c)
*
* FanshaweConnect is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* FanshaweConnect is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with FanshaweConnect. If not, see <http://www.gnu.org/licenses/>.
*/
package ca.GabrielCastro.fanshaweconnect.activities;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import com.google.analytics.tracking.android.EasyTracker;
import com.readystatesoftware.systembartint.SystemBarTintManager;
import ca.GabrielCastro.fanshaweconnect.R;
public class BaseActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int color = getResources().getColor(R.color.action_bar_red);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
SystemBarTintManager tintManager = new SystemBarTintManager(this);
tintManager.setStatusBarTintEnabled(true);
tintManager.setTintColor(color);
}
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(color));
Drawable icon = getResources().getDrawable(R.drawable.ic_launcher);
icon.setColorFilter(Color.WHITE, PorterDuff.Mode.SRC_ATOP);
getSupportActionBar().setIcon(icon);
}
@Override
protected void onStart() {
super.onStart();
EasyTracker.getInstance(this).activityStart(this);
}
@Override
protected void onStop() {
super.onStop();
EasyTracker.getInstance(this).activityStop(this);
}
}