posm / OpenMapKitAndroid

http://openmapkit.org
BSD 3-Clause "New" or "Revised" License
128 stars 38 forks source link

Deployments #122

Closed hallahan closed 8 years ago

hallahan commented 8 years ago

We need an activity with a RecyclerView that lists all of the available deployments from the server. This activity will have Material Design CardViews inside of a RecyclerView.

Clicking on a card will give you details and actions to retrieve a given deployment. Each card will have a progress bar showing the state of a download.

hallahan commented 8 years ago

We're getting cards in a recycle view showing the name and description of deployments coming from a real-live OpenMapKit Server deployments API.

Don't worry about the email fab on the bottom. It's a stub in case we want to have a button there.

2016-01-10 02 35 25

hallahan commented 8 years ago

Basic UI for Deployment Details

2016-01-11 23 46 27

dalekunce commented 8 years ago

@hallahan these look great. I do especially like the download button on the bottom to download everything.

hallahan commented 8 years ago

We're mostly there. I need to keep track of deployments that have been already downloaded so that the UI doesn't suggest downloading it again. Also, we need to show deployments that have completed the downloads in the UI when the device is offline so that the user can check them out.

hallahan commented 8 years ago

At this point, I'm showing in the Deployments recycler view the deployments saved to external storage, and then the deployments show from the API.

I'm going to revamp the Deployments class to have a List and a HashMap referencing Deployment objects. When we get a deployment from the API that collides with the name of a deployment from disk, we are going to PUT overwrite what came from disk so that we have new info about it.

Internally we're going to reference the constructed Deployment object instead of a JSONObject, and this is cleaner. (The JSONObject is still in there, and is a member of Deployment)

Also, we're going to have a persisted boolean in a Deployment to show that it came from ExternalStorage. We'll have an api boolean if it came from OMK Server.

When I have all of this in there, then we can make a method in Deployment to check to see if the deployment being described by the API has been updated, based on file names and sizes.

hallahan commented 8 years ago

Showing offline deployments has gone smoothly. Next step is to have DeploymentDetails show the right state of the download when the activity is reloaded. I'm going to verify state of a download by looking at the file system and compare with what is stated in the deployment.json.

hallahan commented 8 years ago

For all intensive purposes, we've got full deployment functionality working now. I'm going to pull into master where I'm at. I think we should leave this issue open, because there's a few bugs hanging out there like:

  1. The Checkout FAB sometimes shows when it's not supposed to while a download is happening. Not sure why yet...
  2. If I'm downloading many deployments at once, the list of deployments in DeploymentsActivity hangs, since that also needs an AsyncTask. I need a bigger limit on the thread pool.
  3. Show the list of GeoJSON files in DeploymentDetails activity. #138
hallahan commented 8 years ago

I'm considering 1. and 2. edge cases. Let's file new issues if they come into play. Just completed 3. #138