package com.felipecsl.elifut.util;

import android.annotation.TargetApi;
import android.app.Activity;
import android.os.Build;
import android.support.design.widget.TabLayout;
import android.support.v7.widget.Toolbar;

public final class ColorUtils {
  private ColorUtils() {
  }

  @TargetApi(Build.VERSION_CODES.LOLLIPOP)
  public static void colorizeHeader(Activity activity, Toolbar toolbar, TabLayout tabs,
      int primaryColor, int secondaryColor) {
    toolbar.setBackgroundColor(primaryColor);
    tabs.setBackgroundColor(primaryColor);
    tabs.setSelectedTabIndicatorColor(secondaryColor);
    if (AndroidVersion.isAtLeastLollipop()) {
      activity.getWindow().setStatusBarColor(primaryColor);
    }
  }
}

@@ -95,16 +95,47 @@
 tivity;%0A
+import android.graphics.Color;%0A
 import a
@@ -712,24 +712,31 @@
 tusBarColor(
+darken(
 primaryColor
@@ -731,24 +731,31 @@
 primaryColor
+, 0.9f)
 );%0A    %7D%0A  %7D
@@ -754,11 +754,396 @@
    %7D%0A  %7D
+%0A%0A  /** Returns darker version of specified color */%0A  public static int darken(int color, float factor) %7B%0A    int a = Color.alpha(color);%0A    int r = Color.red(color);%0A    int g = Color.green(color);%0A    int b = Color.blue(color);%0A%0A    return Color.argb(a,%0A        Math.max((int) (r * factor), 0),%0A        Math.max((int) (g * factor), 0),%0A        Math.max((int) (b * factor), 0));%0A  %7D
 %0A%7D%0A

Use 10% darker color for system status bar tinting