Skip to content

Commit 2d321c0

Browse files
committed
Last details
1 parent 0a6583d commit 2d321c0

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Sample project created to reinforce some of the main concepts described in the t
55

66
In this repository you are going to find som interesting samples like:
77

8-
* **MVP** and **MVVM** samples.
8+
* **MVP** and **MVVM (whitout data binding engine)** samples.
99
* How to use **fragments**.
1010
* How to use **Dagger to implement dependency injection**.
1111
* Use **resource qualifiers** to change the layout used in **different screen sizes**.
@@ -14,7 +14,7 @@ In this repository you are going to find som interesting samples like:
1414
* How to use **styles and themes**.
1515
* How to **communicate fragments** in the same activity.
1616
* **Butterknife** library usage to **avoid UI duplicated code**.
17-
* Correct **naming** for Android resources.
17+
* Uniform **naming** for Android resources.
1818
* How to use **Navigator** or **ActionCommands** to **implement the navigation** inside the application.
1919
* Use resource custom qualifiers to **split resource files by domain**.
2020
* Different **layout usage**: RelativeLayout, LinearLayout, FrameLayout.

app/src/main/java/com/github/pedrovgs/effectiveandroidui/ui/fragment/TvShowCatalogFragment.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public class TvShowCatalogFragment extends BaseFragment implements TvShowCatalog
119119
refreshAdapter();
120120
}
121121

122-
@Override public void updateTitleWithCountOfVideow(final int counter) {
122+
@Override public void updateTitleWithCountOfTvShows(final int counter) {
123123
String actionBarTitle = getString(R.string.app_name_with_chapter_counter, counter);
124124
getActivity().setTitle(actionBarTitle);
125125
}
@@ -137,11 +137,11 @@ public class TvShowCatalogFragment extends BaseFragment implements TvShowCatalog
137137
getActivity().setTitle(R.string.app_name);
138138
}
139139

140-
@Override public void showTvShowInfo(TvShow tvShow) {
141-
ToastUtils.showError(tvShow.getTitle(), getActivity());
140+
@Override public void showTvShowTitleAsMessage(TvShow tvShow) {
141+
ToastUtils.showShortMessage(tvShow.getTitle(), getActivity());
142142
}
143143

144-
@Override public void showTvShow(final TvShow tvShow) {
144+
@Override public void openTvShow(final TvShow tvShow) {
145145
if (listener != null) {
146146
listener.onTvShowClicked(tvShow);
147147
}

app/src/main/java/com/github/pedrovgs/effectiveandroidui/ui/presenter/TvShowCatalogPresenter.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ public void loadCatalog(final TvShowCollection tvShowCollection) {
8080
}
8181

8282
public void onTvShowThumbnailClicked(final TvShow tvShow) {
83-
view.showTvShow(tvShow);
83+
view.openTvShow(tvShow);
8484
}
8585

8686
public void onTvShowClicked(final TvShow tvShow) {
87-
view.showTvShowInfo(tvShow);
87+
view.showTvShowTitleAsMessage(tvShow);
8888
}
8989

9090
public TvShowCollection getCurrentTvShows() {
@@ -125,7 +125,7 @@ private void showTvShows(Collection<TvShow> tvShows) {
125125
if (view.isReady()) {
126126
view.renderVideos(tvShows);
127127
view.hideLoading();
128-
view.updateTitleWithCountOfVideow(tvShows.size());
128+
view.updateTitleWithCountOfTvShows(tvShows.size());
129129
}
130130
}
131131

@@ -136,7 +136,8 @@ private void checkViewAlreadySetted() {
136136
}
137137

138138
/**
139-
* View interface created to abstract the view implementation used in this presenter.
139+
* View interface created to abstract the view
140+
* implementation used in this presenter.
140141
*/
141142
public interface View {
142143

@@ -146,17 +147,17 @@ public interface View {
146147

147148
void renderVideos(final Collection<TvShow> tvShows);
148149

149-
void updateTitleWithCountOfVideow(final int counter);
150+
void updateTitleWithCountOfTvShows(final int counter);
150151

151152
void showConnectionErrorMessage();
152153

153154
void showEmptyCase();
154155

155156
void showDefaultTitle();
156157

157-
void showTvShowInfo(TvShow tvShow);
158+
void showTvShowTitleAsMessage(TvShow tvShow);
158159

159-
void showTvShow(TvShow tvShow);
160+
void openTvShow(TvShow tvShow);
160161

161162
boolean isReady();
162163

0 commit comments

Comments
 (0)