package com.vpn.fastestvpnservice.application;

import android.app.Application;
import android.content.Context;
import android.graphics.Bitmap;

import com.vpn.fastestvpnservice.R;
import com.vpn.fastestvpnservice.broadcasts.ConnectivityReceiver;


public class BaseApplication extends Application {

    private static BaseApplication instance;

   /* public static BaseApplication getApplication() {
        return instance;
    }*/

    public void setConnectivityListener(ConnectivityReceiver.ConnectivityReceiverListener listener) {
        ConnectivityReceiver.connectivityReceiverListener = listener;
    }

    @Override
    public void onCreate() {
        super.onCreate();

        // TODO uncomment_this_JC
//        FirebaseApp.initializeApp(this);
//        FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true);
        instance = this;

        // TODO uncomment_this_JC
//        initializeImageloader();

    }

    public static BaseApplication getApplication() {
        return instance;
    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
    }

    public void initializeImageloader() {
        // TODO uncomment_this_JC
//        DisplayImageOptions options = new DisplayImageOptions.Builder()
//                .showImageForEmptyUri(R.drawable.ic_launcher_foreground)
//                .showImageOnFail(R.drawable.ic_launcher_foreground)
//                .showImageOnLoading(R.drawable.ic_launcher_foreground)
//                .resetViewBeforeLoading(true)
//                .cacheInMemory(true)
//                .cacheOnDisc(true)
//                .imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2)
//                .displayer(new FadeInBitmapDisplayer(300))
//                .bitmapConfig(Bitmap.Config.RGB_565).build();
//
//        ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(
//                getApplicationContext()).defaultDisplayImageOptions(options)
//                .build();
//
//        com.nostra13.universalimageloader.core.ImageLoader.getInstance().init(config);
//        L.disableLogging();
    }
}
