google / ground-android

Ground mobile data collection app for Android

Home Page:http://groundplatform.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Code health] Rearchitect Map Tasks

scolsen opened this issue · comments

Our current approach to map task layouts can lead to some view identifier conflict issues, e.g. #2493. In particular we're running into a conflict between identifiers because of the following behavior:

An ID doesn't need to be unique throughout the entire tree, but it must be unique within the part of the tree you search. It might often be the entire tree, so it's best to make it unique when possible.

(see https://developer.android.com/develop/ui/views/layout/declaring-layout).

We currently render all of our map task views dynamically. Each one is a subclass of and abstract map task class. The dynamic view rendering seems to create conflicts between dynamically generated identifiers and existing map view identifiers.

We might be able to simplify things by reducing our use of subclassing and abstraction here. I can imagine a simpler world in which our map tasks have dedicated layouts just as the other tasks possess, this might help with identifier conflicts. We may also need to be smart about reusing/cleaning up existing map views.