Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Commit

Permalink
Fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
MGaetan89 committed Jul 19, 2015
1 parent 8441866 commit 9221abc
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
import retrofit.client.Response;

public abstract class BaseActivity extends AppCompatActivity implements Callback<GenericResponse>, NavigationView.OnNavigationItemSelectedListener {
private static final float COLOR_DARK_FACTOR = 0.8f;

@Nullable
private AppBarLayout appBarLayout = null;

Expand Down Expand Up @@ -194,6 +196,8 @@ public boolean onOptionsItemSelected(MenuItem item) {
}

public void setPalette(Palette palette) {
// TODO Handle accent color too once TabLayout can have dynamic indicator color
// https://code.google.com/p/android/issues/detail?id=175182
Palette.Swatch swatch = palette.getVibrantSwatch();

if (swatch == null) {
Expand Down Expand Up @@ -334,7 +338,7 @@ private void displayHomeAsUp(boolean displayHomeAsUp) {
private void setThemeColors(int colorPrimary) {
float colorPrimaryDark[] = new float[3];
ColorUtils.colorToHSL(colorPrimary, colorPrimaryDark);
colorPrimaryDark[2] *= 0.8f;
colorPrimaryDark[2] *= COLOR_DARK_FACTOR;

if (this.appBarLayout != null) {
ViewCompat.setBackgroundTintList(this.appBarLayout, ColorStateList.valueOf(colorPrimary));
Expand Down

0 comments on commit 9221abc

Please sign in to comment.