use of uk.ivanc.archimvp.presenter.RepositoryPresenter in project archi by ivacf.
the class RepositoryActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
presenter = new RepositoryPresenter();
presenter.attachView(this);
setContentView(R.layout.activity_repository);
toolbar = (Toolbar) findViewById(R.id.toolbar);
descriptionText = (TextView) findViewById(R.id.text_repo_description);
homepageText = (TextView) findViewById(R.id.text_homepage);
languageText = (TextView) findViewById(R.id.text_language);
forkText = (TextView) findViewById(R.id.text_fork);
ownerNameText = (TextView) findViewById(R.id.text_owner_name);
ownerEmailText = (TextView) findViewById(R.id.text_owner_email);
ownerLocationText = (TextView) findViewById(R.id.text_owner_location);
ownerImage = (ImageView) findViewById(R.id.image_owner);
ownerLayout = findViewById(R.id.layout_owner);
setSupportActionBar(toolbar);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
Repository repository = getIntent().getParcelableExtra(EXTRA_REPOSITORY);
bindRepositoryData(repository);
presenter.loadOwner(repository.owner.url);
}
use of uk.ivanc.archimvp.presenter.RepositoryPresenter in project archi by ivacf.
the class RepositoryPresenterTest method setUp.
@Before
public void setUp() {
ArchiApplication application = (ArchiApplication) RuntimeEnvironment.application;
githubService = mock(GithubService.class);
// Mock the retrofit service so we don't call the API directly
application.setGithubService(githubService);
// Change the default subscribe schedulers so all observables
// will now run on the same thread
application.setDefaultSubscribeScheduler(Schedulers.immediate());
repositoryPresenter = new RepositoryPresenter();
repositoryMvpView = mock(RepositoryMvpView.class);
when(repositoryMvpView.getContext()).thenReturn(application);
repositoryPresenter.attachView(repositoryMvpView);
}
Aggregations