Skip to content

Instantly share code, notes, and snippets.

@fnk0
Created October 12, 2016 17:35
Show Gist options
  • Save fnk0/be7d30bf3198d2d66aa5811110c37eb9 to your computer and use it in GitHub Desktop.
Save fnk0/be7d30bf3198d2d66aa5811110c37eb9 to your computer and use it in GitHub Desktop.
Setting up the fragment
@Override
public void onActivityCreated(Bundle savedInstanceState) {
...
// The brand color will be used as the background for the Headers fragment
setBrandColor(ContextCompat.getColor(getActivity(), R.color.primary_transparent));
setHeadersState(HEADERS_ENABLED);
setHeadersTransitionOnBackEnabled(true);
// The TMDB logo on the right corner. It is necessary to show based on their API usage policy
setBadgeDrawable(ContextCompat.getDrawable(getActivity(), R.drawable.powered_by));
createDataRows();
....
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment