Skip to content

Instantly share code, notes, and snippets.

@dazza5000
Last active November 16, 2016 20:17
Show Gist options
  • Save dazza5000/9d0b582bd0db6b81504cdd3337a055eb to your computer and use it in GitHub Desktop.
Save dazza5000/9d0b582bd0db6b81504cdd3337a055eb to your computer and use it in GitHub Desktop.
Events View Implementation
public class EventsActivity extends AppCompatActivity
implements EventsContract.View {
private EventsContract.Presenter eventsPresenter;
....
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_events);
eventsPresenter = new EventsPresenter(repository, this);
eventsPresenter.loadEvents();
}
....
@Override // This is an implemention of a View Contract Method
public void showEvents(List<Event> events) {
eventListAdapter.replaceData(events);
mRecyclerView.setVisibility(View.VISIBLE);
mNoEventsView.setVisibility(View.GONE);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment