google / google/ground-android

[Code health] Rearchitect Map Tasks

Open
#2,601 0 comments 0 reactions 0 assignees View on GitHub
type: code health
Dominant language
Kotlin
Stars
293
Forks
149
Avg merge
1d 16h
Merged PRs (30d)
42

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.