use of uk.ivanc.archimvvm.viewmodel.MainViewModel in project archi by ivacf.
the class MainViewModelTest method setUp.
@Before
public void setUp() {
githubService = mock(GithubService.class);
dataListener = mock(MainViewModel.DataListener.class);
application = (ArchiApplication) RuntimeEnvironment.application;
// 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());
mainViewModel = new MainViewModel(application, dataListener);
}
use of uk.ivanc.archimvvm.viewmodel.MainViewModel in project archi by ivacf.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = DataBindingUtil.setContentView(this, R.layout.main_activity);
mainViewModel = new MainViewModel(this, this);
binding.setViewModel(mainViewModel);
setSupportActionBar(binding.toolbar);
setupRecyclerView(binding.reposRecyclerView);
}
Aggregations