Skip to content

Commit

Permalink
Tweak downloaded area screen (#2055)
Browse files Browse the repository at this point in the history
  • Loading branch information
gino-m authored Nov 10, 2023
1 parent be8105f commit 84fa8f3
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 33 deletions.
67 changes: 35 additions & 32 deletions ground/src/main/res/layout/offline_area_viewer_frag.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,64 +50,67 @@
<FrameLayout
android:id="@+id/offline_area_viewer_map_frame"
android:layout_width="match_parent"
android:layout_height="240dp"
android:layout_height="0dp"
android:background="?attr/colorSurfaceVariant"
app:layout_constraintBottom_toTopOf="@id/offline_area_details"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.333"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.fragment.app.FragmentContainerView
android:id="@+id/map"
android:layout_width="220dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
app:layout_behavior="com.google.android.ground.ui.home.mapcontainer.MapLayoutBehavior"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/offline_area_viewer_toolbar" />
app:layout_behavior="com.google.android.ground.ui.home.mapcontainer.MapLayoutBehavior" />
</FrameLayout>

<TextView
android:id="@+id/offline_area_name_text"
style="@style/TextAppearance.App.TitleLarge.OnSurface"
android:layout_width="wrap_content"
<LinearLayout
android:id="@+id/offline_area_details"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="16dp"
android:gravity="center"
android:text="@{viewModel.areaName}"
android:textAlignment="center"
android:layout_marginTop="40dp"
android:layout_marginBottom="24dp"
android:paddingHorizontal="24dp"
android:orientation="vertical"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/offline_area_viewer_map_frame"
tools:text="Area name, Country" />
<TextView
android:id="@+id/offline_area_size_on_device"
style="@style/TextAppearance.App.BodyMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@{@string/offline_area_size_on_disk_mb(viewModel.areaSize)}"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/offline_area_name_text"
app:visible="@{viewModel.areaSize != null}"
tools:text="n.n MB on disk" />
app:layout_constraintBottom_toTopOf="@id/remove_button">
<TextView
android:id="@+id/offline_area_name_text"
style="@style/TextAppearance.App.TitleLarge.OnSurface"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{viewModel.areaName}"
android:textAlignment="center"
tools:text="Area name, Country" />
<TextView
android:id="@+id/offline_area_size_on_device"
style="@style/TextAppearance.App.BodyMedium"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@{@string/offline_area_size_on_disk_mb(viewModel.areaSize)}"
android:textAlignment="center"
app:visible="@{viewModel.areaSize != null}"
tools:text="n.n MB on disk" />
</LinearLayout>

<Button
android:id="@+id/remove_button"
style="@style/Widget.App.Button.IconButton.Destructive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="64dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="48dp"
android:enabled="@{viewModel.area != null}"
android:onClick="@{() -> viewModel.onRemoveButtonClick()}"
android:text="@string/offline_area_viewer_remove_button"
app:icon="@android:drawable/ic_menu_delete"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/offline_area_details"/>

</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

Expand Down
2 changes: 1 addition & 1 deletion ground/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<string name="take_picture">Take a picture</string>
<string name="photo_preview">Preview</string>
<string name="settings">Settings</string>
<string name="offline_area_viewer_title">Offline area</string>
<string name="offline_area_viewer_title">Downloaded area</string>
<string name="offline_area_viewer_remove_button">Remove from device</string>
<string name="added_by">Added by %s</string>
<!-- Label of button used enter the offline area selector. -->
Expand Down

0 comments on commit 84fa8f3

Please sign in to comment.