package com.home.rxtwitch;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.MotionEvent;

import derson.com.multipletheme.colorUi.util.SharedPreferencesMgr;
import rx.subscriptions.CompositeSubscription;

/**
 * Created by xmax on 4/10/16.
 */
public abstract class BaseActivity extends AppCompatActivity{
    protected CompositeSubscription mSubscriptions;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if(SharedPreferencesMgr.getInt("theme", SharedPreferencesMgr.THEME_DAY)
                == SharedPreferencesMgr.THEME_NIGHT) {
            setTheme(R.style.channel_night);
        } else {
            setTheme(R.style.channel_day);
        }
        mSubscriptions = new CompositeSubscription();
    }

    @Override
    protected void onResume() {
        super.onResume();
        //Bugtags.onResume(this);

    }

    @Override
    protected void onPause() {
        super.onPause();
        //Bugtags.onPause(this);

    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        //Bugtags.onDispatchTouchEvent(this, ev);
        return super.dispatchTouchEvent(ev);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mSubscriptions.unsubscribe();
    }
}
