mirror of
https://github.com/android10/Android-CleanArchitecture.git
synced 2026-03-13 10:13:41 +08:00
Rename context() method due to existent similar one in android api 23.
This commit is contained in:
@@ -53,7 +53,7 @@ public class UserDetailsPresenterTest extends AndroidTestCase {
|
||||
}
|
||||
|
||||
public void testUserDetailsPresenterInitialize() {
|
||||
given(mockUserDetailsView.getContext()).willReturn(mockContext);
|
||||
given(mockUserDetailsView.context()).willReturn(mockContext);
|
||||
|
||||
userDetailsPresenter.initialize(FAKE_USER_ID);
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ public class UserListPresenterTest extends AndroidTestCase {
|
||||
}
|
||||
|
||||
public void testUserListPresenterInitialize() {
|
||||
given(mockUserListView.getContext()).willReturn(mockContext);
|
||||
given(mockUserListView.context()).willReturn(mockContext);
|
||||
|
||||
userListPresenter.initialize();
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ public class UserDetailsPresenter implements Presenter {
|
||||
}
|
||||
|
||||
private void showErrorMessage(ErrorBundle errorBundle) {
|
||||
String errorMessage = ErrorMessageFactory.create(this.viewDetailsView.getContext(),
|
||||
String errorMessage = ErrorMessageFactory.create(this.viewDetailsView.context(),
|
||||
errorBundle.getException());
|
||||
this.viewDetailsView.showError(errorMessage);
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public class UserListPresenter implements Presenter {
|
||||
}
|
||||
|
||||
private void showErrorMessage(ErrorBundle errorBundle) {
|
||||
String errorMessage = ErrorMessageFactory.create(this.viewListView.getContext(),
|
||||
String errorMessage = ErrorMessageFactory.create(this.viewListView.context(),
|
||||
errorBundle.getException());
|
||||
this.viewListView.showError(errorMessage);
|
||||
}
|
||||
|
||||
@@ -40,5 +40,5 @@ public interface LoadDataView {
|
||||
/**
|
||||
* Get a {@link android.content.Context}.
|
||||
*/
|
||||
Context getContext();
|
||||
Context context();
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public class UserDetailsFragment extends BaseFragment implements UserDetailsView
|
||||
this.showToastMessage(message);
|
||||
}
|
||||
|
||||
@Override public Context getContext() {
|
||||
@Override public Context context() {
|
||||
return getActivity().getApplicationContext();
|
||||
}
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ public class UserListFragment extends BaseFragment implements UserListView {
|
||||
this.showToastMessage(message);
|
||||
}
|
||||
|
||||
@Override public Context getContext() {
|
||||
@Override public Context context() {
|
||||
return this.getActivity().getApplicationContext();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user