// Path: app/src/main/java/com/khmelenko/lab/varis/TravisApp.java
// public final class TravisApp extends Application implements HasActivityInjector {
// 
//     @Inject
//     DispatchingAndroidInjector<Activity> mDispatchingActivityInjector;
// 
//     private static Context sContext;
// 
//     public void onCreate() {
//         super.onCreate();
//         sContext = getApplicationContext();
// 
//         BaseComponent baseComponent = DaggerBaseComponent.create();
//         baseComponent.inject(this);
// 
//         AppSettings appSettings = baseComponent.appSettings();
//         String server = appSettings.getServerUrl();
//         if (TextUtils.isEmpty(server)) {
//             appSettings.putServerType(0);
//             appSettings.putServerUrl(Constants.OPEN_SOURCE_TRAVIS_URL);
//         }
//     }
// 
//     /**
//      * Gets application context
//      *
//      * @return Application context
//      */
//     public static Context getAppContext() {
//         return sContext;
//     }
// 
//     /**
//      * Gets application instance
//      *
//      * @return Application instance
//      */
//     public static TravisApp instance() {
//         return (TravisApp) sContext;
//     }
// 
//     @Override
//     public AndroidInjector<Activity> activityInjector() {
//         return mDispatchingActivityInjector;
//     }
// }


import android.content.Context;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.graphics.drawable.AnimatedVectorDrawableCompat;
import android.support.v4.content.ContextCompat;
import com.khmelenko.lab.varis.R;
import com.khmelenko.lab.varis.TravisApp;

        int color = ContextCompat.getColor(context, R.color.secondary_text);
        switch (state) {
            case STATE_CREATED:
            case STATE_STARTED:
                color = ContextCompat.getColor(context, R.color.build_state_started);
                break;
            case STATE_PASSED:
                color = ContextCompat.getColor(context, R.color.build_state_passed);
                break;
            case STATE_CANCELED:
            case STATE_FAILED:
                color = ContextCompat.getColor(context, R.color.build_state_failed);
                break;
            case STATE_ERRORED:
                color = ContextCompat.getColor(context, R.color.build_state_errored);
                break;
        }

        return color;
    }

    /**
     * Gets the image drawable according to the build state
     *
     * @param state Build state
     * @return Image drawable
     */
    @Nullable
    public static Drawable getBuildImage(String state) {
// Path: app/src/main/java/com/khmelenko/lab/varis/TravisApp.java
// public final class TravisApp extends Application implements HasActivityInjector {
// 
//     @Inject
//     DispatchingAndroidInjector<Activity> mDispatchingActivityInjector;
// 
//     private static Context sContext;
// 
//     public void onCreate() {
//         super.onCreate();
//         sContext = getApplicationContext();
// 
//         BaseComponent baseComponent = DaggerBaseComponent.create();
//         baseComponent.inject(this);
// 
//         AppSettings appSettings = baseComponent.appSettings();
//         String server = appSettings.getServerUrl();
//         if (TextUtils.isEmpty(server)) {
//             appSettings.putServerType(0);
//             appSettings.putServerUrl(Constants.OPEN_SOURCE_TRAVIS_URL);
//         }
//     }
// 
//     /**
//      * Gets application context
//      *
//      * @return Application context
//      */
//     public static Context getAppContext() {
//         return sContext;
//     }
// 
//     /**
//      * Gets application instance
//      *
//      * @return Application instance
//      */
//     public static TravisApp instance() {
//         return (TravisApp) sContext;
//     }
// 
//     @Override
//     public AndroidInjector<Activity> activityInjector() {
//         return mDispatchingActivityInjector;
//     }
// }


// Path: app/src/main/java/com/khmelenko/lab/varis/converter/BuildStateHelper.java
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.graphics.drawable.AnimatedVectorDrawableCompat;
import android.support.v4.content.ContextCompat;
import com.khmelenko.lab.varis.R;
import com.khmelenko.lab.varis.TravisApp;


        int color = ContextCompat.getColor(context, R.color.secondary_text);
        switch (state) {
            case STATE_CREATED:
            case STATE_STARTED:
                color = ContextCompat.getColor(context, R.color.build_state_started);
                break;
            case STATE_PASSED:
                color = ContextCompat.getColor(context, R.color.build_state_passed);
                break;
            case STATE_CANCELED:
            case STATE_FAILED:
                color = ContextCompat.getColor(context, R.color.build_state_failed);
                break;
            case STATE_ERRORED:
                color = ContextCompat.getColor(context, R.color.build_state_errored);
                break;
        }

        return color;
    }

    /**
     * Gets the image drawable according to the build state
     *
     * @param state Build state
     * @return Image drawable
     */
    @Nullable
    public static Drawable getBuildImage(String state) {
        Context context = TravisApp.getAppContext();