use of com.cmput301w18t05.taskzilla.request.command.GetAllTasksRequest in project Taskzilla by CMPUT301W18T05.
the class SearchController method getAllRequest.
/**
* This method invokes a get all request, which is then sent
* to the request manager which determines if the app is online or offline,
* before doing the request.
*
* @see RequestManager
*/
public void getAllRequest() {
GetAllTasksRequest request = new GetAllTasksRequest();
RequestManager.getInstance().invokeRequest(ctx, request);
searchResults.clear();
ArrayList<Task> temp;
temp = request.getResult();
System.out.println("Search result is: " + temp);
while (temp != null && temp.size() > 0) {
for (Task t : temp) {
if (!t.getStatus().equalsIgnoreCase("assigned") && !t.getStatus().equalsIgnoreCase("completed")) {
this.searchResults.add(t);
}
}
RequestManager.getInstance().invokeRequest(ctx, request);
temp = request.getResult();
}
view.notifyChange();
}
use of com.cmput301w18t05.taskzilla.request.command.GetAllTasksRequest in project Taskzilla by CMPUT301W18T05.
the class MapActivity method onCreate.
/**
* Activity uses the activity_map.xml layout
* Initializes a map fragment
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.dragdropMap);
mapFragment.getMapAsync(this);
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
getAllTasksRequest = new GetAllTasksRequest();
RequestManager.getInstance().invokeRequest(getApplicationContext(), getAllTasksRequest);
tasks = new ArrayList<>();
while (getAllTasksRequest.getResult().size() > 0) {
tasks.addAll(getAllTasksRequest.getResult());
RequestManager.getInstance().invokeRequest(getApplicationContext(), getAllTasksRequest);
}
}
Aggregations