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"?> | |
<layout> | |
<data> | |
<variable | |
name="dataSource" | |
type="com.beltranfebrer.databindingcourse.DataSource"/> | |
</data> | |
<com.beltranfebrer.databindingcourse.DataView | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" |
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"?> | |
<layout xmlns:bind="http://schemas.android.com/apk/res-auto" | |
xmlns:app="http://schemas.android.com/apk/res-auto"> | |
<data> | |
<variable | |
name="dataSource" | |
type="com.beltranfebrer.databindingcourse.DataSource"/> | |
<variable | |
name="includeSource" | |
type="com.beltranfebrer.databindingcourse.DataSource"/> |
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
@Implements(CollapsingToolbarLayout.class) | |
public class ShadowCollapsingToolbarLayout extends ShadowFrameLayout { | |
public void __constructor__(Context context, AttributeSet attrs, int defStyleAttr) { | |
} | |
@Implementation | |
public void onAttachedToWindow() { |
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 interface ProfileInteractor { | |
Observable<UserProfile> getProfile(); | |
} |
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 ProfileInteractorTest { | |
private static final String USER = "USERNAME"; | |
ProfileInteractor interactor; | |
@Before | |
public void setUp() { | |
interactor = new ProfileInteractorImpl(...); | |
} | |
@Test |
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 interface ProfileView { | |
void display(UserProfile userProfile); | |
} |
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 ProfileFrameLayout extends FrameLayout implements ProfileView { | |
private ProfilePresenter presenter; | |
@BindView(R.id.text_username) | |
TextView textUsername; | |
@Inject | |
public void setPresenter(ProfilePresenter presenter) { | |
this.presenter = presenter; |
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
@RunWith(RobolectricGradleTestRunner.class) | |
@Config(constants = BuildConfig.class) | |
public class ProfileFrameLayoutTest { | |
private ProfileFrameLayout profileView; | |
@Mock | |
ProfilePresenter presenter; | |
@Before | |
public void setUp() throws Exception { | |
MockitoAnnotations.initMocks(this); |
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 void ProfilePresenter { | |
private final ProfileInteractor interactor; | |
private ProfileView view; | |
public ProfilePresenter(ProfileInteractor interactor) { | |
this.interactor = interactor. | |
} | |
public void attachView(ProfileView view) { | |
this.view = view; |
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 void ProfilePresenterTest { | |
@Mock | |
ProfileInteractor interactor; | |
@Mock | |
ProfileView view; | |
@Before | |
public void setUp() throws Exception { | |
MockitoAnnotations.initMocks(this); | |
when(interactor.getUserProfile()).thenReturn(Observable.just(new UserProfile())); |