package com.dglogik.mobile;

import android.app.ActivityManager;
import android.app.Service;
import android.app.*;
import android.graphics.*;
import android.graphics.drawable.*;
import android.content.Context;
import android.support.annotation.NonNull;

public class Utils {
    public static boolean isServiceRunning(@NonNull Context context, @NonNull Class<? extends Service> clazz) {
        ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);

        for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
            if (service.service.getClassName().equals(clazz.getName())) {
                return true;
            }
        }

        return false;
    }

    @NonNull
    public static Thread startThread(Runnable action) {
        Thread thread = new Thread(action);
        thread.start();
        return thread;
    }

    public static void applyDGTheme(Activity activity) {
        ActionBar bar = activity.getActionBar();
        bar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#4dd0e1")));
    }
}

@@ -1018,24 +1018,55 @@
 ctionBar();%0A
+        if (bar != null) %7B%0A    
         bar.
@@ -1136,16 +1136,27 @@
 e1%22)));%0A
+        %7D%0A%0A
     %7D%0A%7D%0A

Handle ActionBar possibly not existing.