realityexpander / Tasky

Task manager similar to a lite version of Google Calendar
141 stars 12 forks source link

0021 delete event #23

Closed realityexpander closed 1 year ago

realityexpander commented 1 year ago

Question 1

Can you toggle any AgendaItem or only Tasks?

Question 2

Is it necessary to do a search in UI items for the id before deleting? Or is it OK to simply delete the AgendaItem using the id that was passed in?

https://github.com/realityexpander/Tasky/blob/f7fe15dff26e5bfa31e77a78e2f9c5ab924156c5/app/src/main/java/com/realityexpander/tasky/agenda_feature/presentation/agenda_screen/AgendaViewModel.kt#L212-L235

Question 3

If a person Leaves an Event, does the event show up "crossed out" (like the Task-completed)? Or is there a different appearance in the Agenda screen list for events that the user is not going to?

Question 4

It seems like Android does not let you save a Uri to a database and retrieve it later using Uri.parse() in such a way that you can get access to the original image. After parsing, most of the fields are empty and the access to the image fails.

1 - Is this correct? Im not finding much information about how to handle this other than copying the contents of the Uri image to local cache and using saving the file to that cached image. 2 - Is the only way to make this work is to save the Uri image to local app cache as a new (duplicated) file?

https://github.com/realityexpander/Tasky/blob/7a3ba6e0faf00cf869ee98ce5c561990b1039e4c/app/src/main/java/com/realityexpander/tasky/agenda_feature/data/common/serializers/UriSerializer.kt#L14-L27

realityexpander commented 1 year ago

4. What do you need to save the Uri for? Editing photos is only supported in online mode. If you'd want that, you'd need to save the photo in the app's cache, yes. Even if you could just save the Uri, the user could delete the photo and make it invalid that way. I wouldn't consider saving this as a copy here as a problem, since phones are online quite frequently, and after syncing it can be deleted again.

OK that is what I thought. I will attempt to implement the "offline adding" of photos by saving them to the local cache folder in the App's data/data folder.

Follow up question

I would have thought that the URI would point to the file after being saved and re-parsed back to URI. I would have thought that If the file had not been moved or been deleted it would still be accessible.

But looking online this does not seem to be the case for URI's that are saved as strings and then re-parsed back to URI's.

Is this correct?

philipplackner commented 1 year ago

I think it depends on the type of Uri.. In this app you're dealing with content Uris, for which this is true I think. On the other hand there are file Uris for example for which I don't think this is true, since they rather refer to a file path (in your app's storage)

realityexpander commented 1 year ago

I think it depends on the type of Uri.. In this app you're dealing with content Uris, for which this is true I think. On the other hand there are file Uris for example for which I don't think this is true, since they rather refer to a file path (in your app's storage)

OK thats the conclusion I came to as well and from research online.