This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final ViewHolder vh = new ViewHolder(v, mDetailsPresenter, mDetailsOverviewLogoPresenter); | |
final View overview = vh.mOverviewFrame; | |
if (mBackgroundColorSet) { | |
overview.setBackgroundColor(mBackgroundColor); | |
} | |
if (mActionsBackgroundColorSet) { | |
overview.findViewById(R.id.details_overview_actions_background) | |
.setBackgroundColor(mActionsBackgroundColor); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomMovieDetailsPresenter extends FullWidthDetailsOverviewRowPresenter { | |
public CustomMovieDetailsPresenter(Presenter detailsPresenter, DetailsOverviewLogoPresenter logoPresenter) { | |
super(detailsPresenter, logoPresenter); | |
} | |
@Override | |
protected void onBindRowViewHolder(RowPresenter.ViewHolder holder, Object item) { | |
super.onBindRowViewHolder(holder, item); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mFullWidthMovieDetailsPresenter.setActionsBackgroundColor(ContextCompat.getColor(getActivity(), R.color.primary_dark)); | |
mFullWidthMovieDetailsPresenter.setBackgroundColor(ContextCompat.getColor(getActivity(), R.color.primary)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MovieDetailsFragment extends DetailsFragment { | |
... | |
private void setUpAdapter() { | |
// Create the FullWidthPresenter | |
mFullWidthMovieDetailsPresenter = new FullWidthDetailsOverviewRowPresenter(new MovieDetailsDescriptionPresenter(), | |
new DetailsOverviewLogoPresenter()); | |
// Handle the transition, the Helper is mainly used because the ActivityTransition is being passed from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MovieDetailsDescriptionPresenter extends Presenter { | |
@Override | |
public ViewHolder onCreateViewHolder(ViewGroup parent) { | |
View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.vh_details, parent, false); | |
return new MovieDetailsViewHolder(v); | |
} | |
@Override | |
public void onBindViewHolder(ViewHolder viewHolder, Object item) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MovieDetailsViewHolder extends Presenter.ViewHolder { | |
@BindView(R.id.movie_title) | |
TextView movieTitleTV; | |
@BindView(R.id.movie_year) | |
TextView movieYearTV; | |
@BindView(R.id.overview) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:orientation="vertical" | |
android:padding="16dp"> | |
<TextView |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<activity android:name=".ui.details.MovieDetailsActivity" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainFragment extends BrowseFragment implements OnItemViewSelectedListener, | |
OnItemViewClickedListener { // Add the OnItemViewClickedListener interface | |
private void createRows() { | |
... | |
// Set the click listener | |
setOnItemViewClickedListener(this); | |
} | |
// Implement the onItemClicked required by the OnItemViewClickedListener interface |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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)); |