Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render the draw vertex to be open to prevent occluding the target point. #2241

Merged
merged 8 commits into from
Feb 23, 2024
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Google LLC
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -62,6 +62,6 @@ data class Feature(

enum class VertexStyle {
NONE,
CIRCLE
CIRCLE,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ constructor(private val resources: Resources, private val bitmapUtil: BitmapUtil
// initialization.
private val defaultStrokeWidth by lazy { resources.getDimension(R.dimen.line_geometry_width) }
private val circleCap by lazy {
val bitmap = bitmapUtil.fromVector(R.drawable.ic_endpoint)
val bitmap = bitmapUtil.fromVector(R.drawable.ic_circle_marker)
CustomCap(BitmapDescriptorFactory.fromBitmap(bitmap))
}

Expand All @@ -65,6 +65,7 @@ constructor(private val resources: Resources, private val bitmapUtil: BitmapUtil
startCap = circleCap
endCap = circleCap
}

val strokeScale = if (selected) 2f else 1f
width = defaultStrokeWidth * strokeScale
color = style.color
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
~ Copyright 2021 Google LLC
~ Copyright 2024 Google LLC
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand All @@ -17,13 +17,14 @@
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,12m-10.5,0a10.5,10.5 0,1 1,21 0a10.5,10.5 0,1 1,-21 0"
android:strokeWidth="3"
android:fillColor="#ffffff"
android:strokeColor="#E59810"/>
android:strokeColor="@color/drawAreaLineStringStrokeColor"/>
</vector>

37 changes: 37 additions & 0 deletions ground/src/main/res/drawable/ic_plus_sign.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
~ Copyright 2024 Google LLC
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="25dp"
android:height="25dp"
android:viewportWidth="8"
android:viewportHeight="8">
<path
android:fillAlpha="0"
android:pathData="M4 1L4 7"
android:strokeWidth="2"
android:strokeColor="@color/drawAreaLineStringStrokeColor"
android:strokeLineCap="round" />
<path
android:fillAlpha="0"
android:pathData="M7 4L1 4"
android:strokeWidth="2"
android:strokeColor="@color/drawAreaLineStringStrokeColor"
android:strokeLineCap="round"/>
</vector>

10 changes: 5 additions & 5 deletions ground/src/main/res/layout/map_task_frag.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
~ Copyright 2018 Google LLC
~ Copyright 2024 Google LLC
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -38,15 +38,15 @@
layout="@layout/basemap_layout"
app:fragment="@{fragment}"
app:viewModel="@{viewModel}" />

<androidx.constraintlayout.utils.widget.ImageFilterView
android:id="@+id/centerMarker"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/ic_gps_lock"
android:tint="@android:color/white" />

android:scaleType="centerInside"
android:scaleX="0.5"
android:scaleY="0.5"
android:src="@drawable/ic_plus_sign" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/hintIcon"
android:layout_width="wrap_content"
Expand Down
4 changes: 3 additions & 1 deletion ground/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
~ Copyright 2018 Google LLC
~ Copyright 2024 Google LLC
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand All @@ -23,6 +23,8 @@
<color name="clusterBalloonStrokeColor">#4B6DDD81</color>
<color name="textOverMap">#FCFDF7</color>
<color name="blackOverlay">#000000</color>
<!-- DrawArea color palette -->
<color name="drawAreaLineStringStrokeColor">#EDAE3D</color>

<!-- Updated Color palette -->
<color name="md_theme_primary">#006E2C</color>
Expand Down
4 changes: 2 additions & 2 deletions ground/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
~ Copyright 2018 Google LLC
~ Copyright 2024 Google LLC
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@

<resources>
<!-- Map -->
<dimen name="line_geometry_width">4dp</dimen>
<dimen name="line_geometry_width">2dp</dimen>
<item name="default_marker_scale_factor" format="float" type="dimen">2</item>
<item name="selected_marker_scale_factor" format="float" type="dimen">1.5</item>

Expand Down