diff --git a/HackVG/app/src/main/java/com/hackvg/android/views/activities/MovieDetailActivity.java b/HackVG/app/src/main/java/com/hackvg/android/views/activities/MovieDetailActivity.java index 4f83e10..336c7f0 100644 --- a/HackVG/app/src/main/java/com/hackvg/android/views/activities/MovieDetailActivity.java +++ b/HackVG/app/src/main/java/com/hackvg/android/views/activities/MovieDetailActivity.java @@ -496,7 +496,10 @@ public void onGenerated(Palette palette) { setHeadersTitlColors(titleAndFabColors); - setVibrantElements(vibrantSwatch); + final Swatch vibrantSwatchColors = (vibrantSwatch != null) + ? vibrantSwatch : titleAndFabColors; + + setVibrantElements(vibrantSwatchColors); } } @@ -504,9 +507,6 @@ private void setVibrantElements(Swatch vibrantSwatch) { mFabButton.getBackground().setColorFilter(vibrantSwatch.getRgb(), PorterDuff.Mode.MULTIPLY); - - - } @OnClick(R.id.activity_detail_fab) diff --git a/HackVG/domain/src/test/java/GetMoviesUsecaseTest.java b/HackVG/domain/src/test/java/GetMoviesUsecaseTest.java index ec26ae7..e964203 100644 --- a/HackVG/domain/src/test/java/GetMoviesUsecaseTest.java +++ b/HackVG/domain/src/test/java/GetMoviesUsecaseTest.java @@ -2,6 +2,7 @@ import com.hackvg.domain.GetMoviesUsecaseController; import com.hackvg.model.MediaDataSource; import com.hackvg.model.entities.MoviesWrapper; +import com.hackvg.model.rest.RestDataSource; import com.squareup.otto.Bus; import org.junit.Before; @@ -21,7 +22,7 @@ public class GetMoviesUsecaseTest { private GetMoviesUsecase getMoviesUsecase; @Mock - private MediaDataSource mockDataSource; + private RestDataSource mockRestDataSource; @Mock private Bus mockUiBus; @@ -32,8 +33,7 @@ public void setUp() { MockitoAnnotations.initMocks(this); getMoviesUsecase = new GetMoviesUsecaseController( - mockDataSource, mockUiBus - ); + mockRestDataSource, mockUiBus); } @Test @@ -41,7 +41,7 @@ public void testMoviesRequestExecution() { getMoviesUsecase.execute(); - verify(mockDataSource, times(1)) + verify(mockRestDataSource, times(1)) .getMovies(); }