gnd/src/main/java/com/google/android/gnd/ui/home/mapcontainer/PolygonDrawingViewModel.java
private void addVertex(Point vertex, boolean isNotSelectedByUser) {
    // Clear last vertex if it is unselected
    if (isLastVertexNotSelectedByUser && !vertices.isEmpty()) {
      vertices.remove(vertices.size() - 1);
    }

    // Update selected state
    isLastVertexNotSelectedByUser = isNotSelectedByUser;

    // Add the new vertex
    vertices.add(vertex);

    // Render changes to UI
    updateDrawnPolygonFeature(ImmutableList.copyOf(vertices));
  }
/**
   * Adds a new vertex.
   *
   * @param vertex new position
   * @param isNotSelectedByUser whether the vertex is not selected by the user
   */
Adds a new vertex.
@param vertex new position
@param isNotSelectedByUser whether the vertex is not selected by the user
Adds a new vertex . @param vertex new position @param isNotSelectedByUser whether the vertex is not selected by the user
private void addVertex(Point vertex, boolean isNotSelectedByUser) {
    if (isLastVertexNotSelectedByUser && !vertices.isEmpty()) {
      vertices.remove(vertices.size() - 1);
    }
    isLastVertexNotSelectedByUser = isNotSelectedByUser;
    vertices.add(vertex);
    updateDrawnPolygonFeature(ImmutableList.copyOf(vertices));
  }
private void addVertex ( Point vertex , boolean isNotSelectedByUser ) { if ( isLastVertexNotSelectedByUser && ! vertices . isEmpty ( ) ) { vertices . remove ( vertices . size ( ) - 1 ) ; } isLastVertexNotSelectedByUser = isNotSelectedByUser ; vertices . add ( vertex ) ; updateDrawnPolygonFeature ( ImmutableList . copyOf ( vertices ) ) ; }
Adds a new vertex.
Adds a new vertex .
// Clear last vertex if it is unselected // Update selected state // Add the new vertex // Render changes to UI