Skip to content

Commit

Permalink
Offline area map selector mask and outline
Browse files Browse the repository at this point in the history
  • Loading branch information
gino-m committed Sep 8, 2023
1 parent 379eb7c commit b1a3d25
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ground/src/main/res/drawable/offline_area_viewport_outline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
~ Copyright 2023 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.
-->

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<solid android:color="@android:color/transparent" />
<stroke android:width="3dp" android:color="@color/md_theme_inversePrimary"/>
</shape>
47 changes: 47 additions & 0 deletions ground/src/main/res/layout/offline_base_map_selector_frag.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,53 @@
app:layout_constraintEnd_toEndOf="parent"
app:useCompatPadding="true" />
</com.google.android.ground.ui.common.TwoLineToolbar>

<View
android:id="@+id/top_mask"
android:layout_width="match_parent"
android:layout_height="24dp"
android:background="@color/blackMapOverlay"
android:alpha="0.4"
app:layout_constraintTop_toBottomOf="@+id/offline_area_selector_toolbar" />

<View
android:id="@+id/bottom_mask"
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="@color/blackMapOverlay"
android:alpha="0.4"
app:layout_constraintBottom_toBottomOf="parent" />

<View
android:id="@+id/right_mask"
android:layout_width="24dp"
android:layout_height="0dp"
android:alpha="0.4"
android:background="@color/blackMapOverlay"
app:layout_constraintTop_toBottomOf="@id/top_mask"
app:layout_constraintBottom_toTopOf="@id/bottom_mask"
app:layout_constraintRight_toRightOf="parent" />

<View
android:id="@+id/left_mask"
android:layout_width="24dp"
android:layout_height="0dp"
android:background="@color/blackMapOverlay"
android:alpha="0.4"
app:layout_constraintTop_toBottomOf="@id/top_mask"
app:layout_constraintBottom_toTopOf="@id/bottom_mask"
app:layout_constraintLeft_toLeftOf="parent" />

<View
android:id="@+id/viewport_outline"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@drawable/offline_area_viewport_outline"
app:layout_constraintTop_toBottomOf="@id/top_mask"
app:layout_constraintBottom_toTopOf="@id/bottom_mask"
app:layout_constraintLeft_toRightOf="@id/left_mask"
app:layout_constraintRight_toLeftOf="@id/right_mask"/>

</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
</layout>
1 change: 1 addition & 0 deletions ground/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<color name="colorMapAccent">#ff9131</color>
<color name="clusterColor">#6DDD81</color>
<color name="polyLineColor">#55ffffff</color>
<color name="blackMapOverlay">#000000</color>

<!-- Updated Color palette -->
<color name="md_theme_primary">#006E2C</color>
Expand Down

0 comments on commit b1a3d25

Please sign in to comment.