Skip to content
This repository has been archived by the owner on Apr 18, 2022. It is now read-only.

Commit

Permalink
Merge branch 'enhancements'
Browse files Browse the repository at this point in the history
  • Loading branch information
scottwainstock committed Jan 4, 2018
2 parents d325be4 + f33b209 commit 3633f63
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions app/src/main/java/com/pbm/RecentlyAdded.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.json.JSONObject;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
Expand All @@ -34,26 +33,31 @@ public void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.recently_added);

logAnalyticsHit("com.pbm.RecentlyAdded");

enableLoadingSpinnerForView(R.id.recentRelativeLayout);

new Thread(new Runnable() {
public void run() {
try {
getLocationData();
} catch (UnsupportedEncodingException | InterruptedException | ExecutionException | JSONException | ParseException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
RecentlyAdded.super.runOnUiThread(new Runnable() {
@Override
public void run() {
showTable(recentAdds);
while (!getPBMApplication().getIsDataInitialized()) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}

disableLoadingSpinner();
try {
getLocationData();
} catch (InterruptedException | ExecutionException | JSONException | ParseException | IOException e) {
e.printStackTrace();
}
});

runOnUiThread(new Runnable() {
@Override
public void run() {
disableLoadingSpinner();
showTable(recentAdds);
}
});
}
}).start();
}
Expand Down

0 comments on commit 3633f63

Please sign in to comment.