Skip to content

Commit

Permalink
[FieldService] Fix wrong class name of MapViews, update timer checked…
Browse files Browse the repository at this point in the history
… status
  • Loading branch information
olegoid committed May 15, 2015
1 parent 3ef15a5 commit 9159312
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,12 @@ protected override void OnCreate (Bundle bundle)
phoneButton = view.FindViewById<RelativeLayout> (Resource.Id.assignmentPhoneLayout);
mapButton = view.FindViewById<RelativeLayout> (Resource.Id.assignmentAddressLayout);

assignmentViewModel.LoadTimerEntryAsync ().ContinueWith (_ => {
RunOnUiThread (() => {
timer.Checked = assignmentViewModel.Recording;
});
});

timer.CheckedChange += (sender, e) => {
if (e.IsChecked != assignmentViewModel.Recording) {
if (assignmentViewModel.Recording) {
if (assignmentViewModel.Recording)
assignmentViewModel.PauseAsync ();
} else {
else
assignmentViewModel.RecordAsync ();
}
}
};

Expand All @@ -110,6 +103,7 @@ protected override void OnCreate (Bundle bundle)
if (selected != assignment.Status) {
switch (selected) {
case AssignmentStatus.Hold:
timer.Checked = false;
assignment.Status = selected;
assignmentViewModel.SaveAssignmentAsync (assignment).ContinueWith (_ => RunOnUiThread (ReloadAssignments));
break;
Expand Down Expand Up @@ -221,6 +215,12 @@ void SetActiveAssignmentVisible (bool visible)
phone.Text = assignment.ContactPhone;
address.Text = string.Format ("{0}\n{1}, {2} {3}", assignment.Address, assignment.City, assignment.State, assignment.Zip);
timerText.Text = assignmentViewModel.Hours.ToString (@"hh\:mm\:ss");

assignmentViewModel.LoadTimerEntryAsync ().ContinueWith (_ => {
RunOnUiThread (() => {
timer.Checked = assignmentViewModel.Recording;
});
});
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView
<com.google.android.gms.maps.MapView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="@string/GoogleMapsAPIKey"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/mapViewAssignmentLayout" />
<com.google.android.maps.MapView
<com.google.android.gms.maps.MapView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="@string/GoogleMapsAPIKey"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public Task LoadAssignmentsAsync ()
.ContinueOnCurrentThread (t => {
//Grab the active assignment
var activeAssignment = t.Result.FirstOrDefault (a => a.Status == AssignmentStatus.Active);
if (ActiveAssignment == null)
if (ActiveAssignment == null || activeAssignment == null)
ActiveAssignment = activeAssignment;
else if (ActiveAssignment.Id != activeAssignment.Id)
ActiveAssignment = activeAssignment;
Expand Down

0 comments on commit 9159312

Please sign in to comment.