Skip to content

Instantly share code, notes, and snippets.

@fnk0
Last active October 12, 2016 03:47
Show Gist options
  • Save fnk0/3c4d178d3a8c6f6a30db9ff009532bc7 to your computer and use it in GitHub Desktop.
Save fnk0/3c4d178d3a8c6f6a30db9ff009532bc7 to your computer and use it in GitHub Desktop.
MovieDetailsActivity
public class MovieDetailsActivity extends BaseTvActivity {
GlideBackgroundManager mBackgroundManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Retrieve the movie through the intent
Movie movie = getIntent().getExtras().getParcelable(Movie.class.getSimpleName());
MovieDetailsFragment detailsFragment = MovieDetailsFragment.newInstance(movie);
addFragment(detailsFragment); // Method from BaseTvActivity
// Sets the background of the activity to the backdrop of the movie
mBackgroundManager = new GlideBackgroundManager(this);
if (movie != null && movie.getBackdropPath() != null) {
mBackgroundManager.loadImage(HttpClientModule.BACKDROP_URL + movie.getBackdropPath());
} else {
mBackgroundManager.setBackground(ContextCompat.getDrawable(this, R.drawable.material_bg));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment