Skip to content

Instantly share code, notes, and snippets.

View dazza5000's full-sized avatar

dazza5000

View GitHub Profile
@dazza5000
dazza5000 / gist:5748927f3181a22f6578176250c5e088
Last active April 20, 2019 18:59
Events Presenter Test
public class EventsPresenterTest {
private static List<Event> EVENTS = new ArrayList<>();
@Mock
EventsRepository eventsRepository;
@Mock
EventsContract.View eventsView;
private EventsPresenter eventsPresenter;
@dazza5000
dazza5000 / gist:14d78ed1c8de8339ee24e7d23d919447
Last active November 16, 2016 22:22
Events Presenter Implementation
public class EventsPresenter implements EventsContract.Presenter {
private EventsRepository repository;
private EventsContract.View view;
....
public EventsPresenter(EventsRepository repository, EventsContract.View view) {
this.view = view;
this.repository = repository;
@dazza5000
dazza5000 / gist:9d0b582bd0db6b81504cdd3337a055eb
Last active November 16, 2016 20:17
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);
public interface EventsContract {
interface View {
void showEvents(List<Event> events);
void setPizzaCount(int count);
void setTacoCount(int count);
void setBeerCount(int count);
void setTotalCount(int count);
void showFilteringPopUpMenu();
interface Presenter {
void loadEvents();
void loadYummyCounts();
void searchEvents(String searchTerm);
void openEventDetails(Event clickedEvent);
interface View {
void showEvents(List<Event> events);
void setPizzaCount(int count);
void setTacoCount(int count);
void setBeerCount(int count);
@dazza5000
dazza5000 / circle.yml
Last active June 23, 2018 15:02
CircleCI Android Configuration Template - circle.yml
version: 2
jobs:
build:
working_directory: ~/code
docker:
- image: circleci/android:api-27-alpha
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
import android.app.Presentation;
import android.content.Context;
import android.location.Location;
import android.provider.CalendarContract;
import android.widget.Toast;
import java.util.ArrayList;
/**
* Created by mgarner on 12/11/2015.