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

Rename remaining instances of "offline base map" #1865

Merged
merged 8 commits into from
Sep 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -33,9 +33,9 @@ import com.google.android.ground.ui.home.locationofinterestdetails.SubmissionLis
import com.google.android.ground.ui.home.locationofinterestdetails.SubmissionListViewModel
import com.google.android.ground.ui.home.mapcontainer.HomeScreenMapContainerViewModel
import com.google.android.ground.ui.home.mapcontainer.MapTypeViewModel
import com.google.android.ground.ui.offlinebasemap.OfflineAreasViewModel
import com.google.android.ground.ui.offlinebasemap.selector.OfflineAreaSelectorViewModel
import com.google.android.ground.ui.offlinebasemap.viewer.OfflineAreaViewerViewModel
import com.google.android.ground.ui.offlineareas.OfflineAreasViewModel
import com.google.android.ground.ui.offlineareas.selector.OfflineAreaSelectorViewModel
import com.google.android.ground.ui.offlineareas.viewer.OfflineAreaViewerViewModel
import com.google.android.ground.ui.signin.SignInViewModel
import com.google.android.ground.ui.submissiondetails.SubmissionDetailsViewModel
import com.google.android.ground.ui.surveyselector.SurveySelectorViewModel
Original file line number Diff line number Diff line change
@@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.ground.ui.offlinebasemap
package com.google.android.ground.ui.offlineareas

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.google.android.ground.databinding.OfflineBaseMapListItemBinding
import com.google.android.ground.databinding.OfflineAreasListItemBinding
import com.google.android.ground.model.imagery.OfflineArea
import com.google.android.ground.ui.common.Navigator

@@ -30,7 +30,7 @@ internal class OfflineAreaListAdapter(private val navigator: Navigator) :

class ViewHolder
internal constructor(
var binding: OfflineBaseMapListItemBinding,
var binding: OfflineAreasListItemBinding,
var areas: List<OfflineArea>,
private val navigator: Navigator
) : RecyclerView.ViewHolder(binding.root), View.OnClickListener {
@@ -48,7 +48,7 @@ internal class OfflineAreaListAdapter(private val navigator: Navigator) :

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val offlineAreasListItemBinding =
OfflineBaseMapListItemBinding.inflate(LayoutInflater.from(parent.context), parent, false)
OfflineAreasListItemBinding.inflate(LayoutInflater.from(parent.context), parent, false)
return ViewHolder(offlineAreasListItemBinding, offlineAreas, navigator)
}

Original file line number Diff line number Diff line change
@@ -13,15 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.ground.ui.offlinebasemap
package com.google.android.ground.ui.offlineareas

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import com.google.android.ground.MainActivity
import com.google.android.ground.databinding.OfflineBaseMapsFragBinding
import com.google.android.ground.databinding.OfflineAreasFragBinding
import com.google.android.ground.ui.common.AbstractFragment
import com.google.android.ground.ui.common.Navigator
import dagger.hilt.android.AndroidEntryPoint
@@ -53,7 +53,7 @@ class OfflineAreasFragment : Hilt_OfflineAreasFragment() {
savedInstanceState: Bundle?
): View {
super.onCreateView(inflater, container, savedInstanceState)
val binding = OfflineBaseMapsFragBinding.inflate(inflater, container, false)
val binding = OfflineAreasFragBinding.inflate(inflater, container, false)
binding.viewModel = viewModel
binding.lifecycleOwner = this

Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.ground.ui.offlinebasemap
package com.google.android.ground.ui.offlineareas

import android.view.View
import androidx.lifecycle.LiveData
@@ -36,14 +36,15 @@ internal constructor(
) : AbstractViewModel() {

/**
* Returns the current list of downloaded offline basemaps available for viewing. If an unexpected
* error accessing the local store is encountered, emits an empty list, circumventing the error.
* Returns the current list of downloaded offline map imagery areas available for viewing. If an
* unexpected error accessing the local store is encountered, emits an empty list, circumventing
* the error.
*/
val offlineAreas: LiveData<List<OfflineArea>>

/**
* Returns the visibility of a "no area" message based on the current number of available offline
* basemaps.
* Returns the visibility of the "no area" message based on the current number of available
* offline areas.
*/
val noAreasMessageVisibility: LiveData<Int>

@@ -58,7 +59,7 @@ internal constructor(
offlineAreas.map { if (it.isEmpty()) View.VISIBLE else View.GONE }.toLiveData()
}

/** Navigate to the offline area selector UI from the offline basemaps UI. */
/** Navigate to the area selector for offline map imagery. */
fun showOfflineAreaSelector() {
navigator.navigate(OfflineAreasFragmentDirections.showOfflineAreaSelector())
}
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.google.android.ground.ui.offlinebasemap.selector
package com.google.android.ground.ui.offlineareas.selector

import android.app.AlertDialog
import android.app.Dialog
Original file line number Diff line number Diff line change
@@ -14,13 +14,13 @@
* limitations under the License.
*/

package com.google.android.ground.ui.offlinebasemap.selector
package com.google.android.ground.ui.offlineareas.selector

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.google.android.ground.databinding.OfflineBaseMapSelectorFragBinding
import com.google.android.ground.databinding.OfflineAreaSelectorFragBinding
import com.google.android.ground.ui.common.AbstractMapContainerFragment
import com.google.android.ground.ui.common.BaseMapViewModel
import com.google.android.ground.ui.common.EphemeralPopups
@@ -52,7 +52,7 @@ class OfflineAreaSelectorFragment : Hilt_OfflineAreaSelectorFragment() {
savedInstanceState: Bundle?
): View {
super.onCreateView(inflater, container, savedInstanceState)
val binding = OfflineBaseMapSelectorFragBinding.inflate(inflater, container, false)
val binding = OfflineAreaSelectorFragBinding.inflate(inflater, container, false)
binding.viewModel = viewModel
binding.lifecycleOwner = this
return binding.root
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.ground.ui.offlinebasemap.selector
package com.google.android.ground.ui.offlineareas.selector

import android.content.res.Resources
import androidx.lifecycle.MutableLiveData
Original file line number Diff line number Diff line change
@@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.ground.ui.offlinebasemap.viewer
package com.google.android.ground.ui.offlineareas.viewer

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.google.android.ground.databinding.OfflineBaseMapViewerFragBinding
import com.google.android.ground.databinding.OfflineAreaViewerFragBinding
import com.google.android.ground.model.imagery.OfflineArea
import com.google.android.ground.ui.common.AbstractMapContainerFragment
import com.google.android.ground.ui.common.BaseMapViewModel
@@ -46,7 +46,7 @@ class OfflineAreaViewerFragment @Inject constructor() : Hilt_OfflineAreaViewerFr
savedInstanceState: Bundle?
): View {
super.onCreateView(inflater, container, savedInstanceState)
val binding = OfflineBaseMapViewerFragBinding.inflate(inflater, container, false)
val binding = OfflineAreaViewerFragBinding.inflate(inflater, container, false)
binding.viewModel = viewModel
binding.lifecycleOwner = this
binding.removeButton.setOnClickListener { onRemoveClick() }
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.ground.ui.offlinebasemap.viewer
package com.google.android.ground.ui.offlineareas.viewer

import android.content.Context
import androidx.lifecycle.LiveData
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
<import type="android.view.View" />
<variable
name="viewModel"
type="com.google.android.ground.ui.offlinebasemap.selector.OfflineAreaSelectorViewModel" />
type="com.google.android.ground.ui.offlineareas.selector.OfflineAreaSelectorViewModel" />
</data>

<FrameLayout
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
<import type="android.view.View" />
<variable
name="viewModel"
type="com.google.android.ground.ui.offlinebasemap.selector.OfflineAreaSelectorViewModel" />
type="com.google.android.ground.ui.offlineareas.selector.OfflineAreaSelectorViewModel" />
</data>

<FrameLayout
@@ -165,7 +165,7 @@
android:layout_height="wrap_content"
style="@style/ChipButton"
android:id="@+id/download_button"
android:text="@string/offline_base_map_selector_download"
android:text="@string/offline_area_selector_download"
android:layout_weight="0.5"
android:layout_marginStart="8dp"
android:layout_marginEnd="16dp"
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
<data>
<variable
name="viewModel"
type="com.google.android.ground.ui.offlinebasemap.viewer.OfflineAreaViewerViewModel" />
type="com.google.android.ground.ui.offlineareas.viewer.OfflineAreaViewerViewModel" />
</data>

<androidx.constraintlayout.widget.ConstraintLayout
@@ -39,7 +39,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:title="@string/offline_base_map_viewer_title" />
app:title="@string/offline_area_viewer_title" />

<FrameLayout
android:id="@+id/offline_area_viewer_map_frame"
@@ -90,7 +90,7 @@
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="?attr/colorError"
android:text="@string/offline_base_map_viewer_remove_button"
android:text="@string/offline_area_viewer_remove_button"
app:chipBackgroundColor="?attr/colorError"
app:chipIcon="@android:drawable/ic_menu_delete"
app:layout_constraintEnd_toEndOf="parent"
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
<data>
<variable
name="viewModel"
type="com.google.android.ground.ui.offlinebasemap.OfflineAreasViewModel" />
type="com.google.android.ground.ui.offlineareas.OfflineAreasViewModel" />
</data>

<androidx.constraintlayout.widget.ConstraintLayout
@@ -39,7 +39,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:title="@string/offline_base_maps" />
app:title="@string/offline_map_imagery" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/offline_areas_list"
@@ -58,10 +58,10 @@
android:layout_marginEnd="@dimen/chip_button_margin_right"
android:layout_marginBottom="@dimen/map_btn_margin_bottom"
android:clickable="true"
android:contentDescription="@string/offline_base_map_selector_prompt"
android:contentDescription="@string/offline_area_selector_prompt"
android:focusable="true"
android:onClick="@{() -> viewModel.showOfflineAreaSelector()}"
android:text="@string/offline_base_map_selector_select"
android:text="@string/offline_area_selector_select"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
<TextView
@@ -71,7 +71,7 @@
android:layout_marginEnd="@dimen/chip_button_margin_right"
android:layout_marginBottom="@dimen/map_btn_margin_bottom"
android:clickable="false"
android:contentDescription="@string/offline_base_map_selector_prompt"
android:contentDescription="@string/offline_area_selector_prompt"
android:focusable="true"
android:onClick="@{() -> viewModel.showOfflineAreaSelector()}"
android:text="@string/no_basemaps_downloaded"
2 changes: 1 addition & 1 deletion ground/src/main/res/menu/nav_drawer_menu.xml
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
<item
android:id="@+id/nav_offline_areas"
android:icon="@drawable/ic_cloud_offline"
android:title="@string/offline_base_maps" />
android:title="@string/offline_map_imagery" />
<item
android:id="@+id/nav_settings"
android:icon="@drawable/ic_settings"
18 changes: 9 additions & 9 deletions ground/src/main/res/navigation/nav_graph.xml
Original file line number Diff line number Diff line change
@@ -149,9 +149,9 @@
</navigation>
<fragment
android:id="@+id/offline_areas_fragment"
android:name="com.google.android.ground.ui.offlinebasemap.OfflineAreasFragment"
android:label="@string/offline_base_maps"
tools:layout="@layout/offline_base_maps_frag">
android:name="com.google.android.ground.ui.offlineareas.OfflineAreasFragment"
android:label="@string/offline_map_imagery"
tools:layout="@layout/offline_areas_frag">
<action
android:id="@+id/showOfflineAreaSelector"
app:destination="@id/offline_area_selector_fragment" />
@@ -164,18 +164,18 @@
</fragment>
<fragment
android:id="@+id/offline_area_selector_fragment"
android:name="com.google.android.ground.ui.offlinebasemap.selector.OfflineAreaSelectorFragment"
android:label="@string/offline_base_map_selector"
tools:layout="@layout/offline_base_map_selector_frag">
android:name="com.google.android.ground.ui.offlineareas.selector.OfflineAreaSelectorFragment"
android:label="@string/offline_area_selector"
tools:layout="@layout/offline_area_selector_frag">
<action
android:id="@+id/backToOfflineAreas"
app:destination="@id/offline_areas_fragment" />
</fragment>
<fragment
android:id="@+id/offline_area_viewer_fragment"
android:name="com.google.android.ground.ui.offlinebasemap.viewer.OfflineAreaViewerFragment"
android:label="@string/offline_base_map_viewer_title"
tools:layout="@layout/offline_base_map_viewer_frag">
android:name="com.google.android.ground.ui.offlineareas.viewer.OfflineAreaViewerFragment"
android:label="@string/offline_area_viewer_title"
tools:layout="@layout/offline_area_viewer_frag">
<argument
android:name="offlineAreaId"
app:argType="string" />
13 changes: 6 additions & 7 deletions ground/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
@@ -76,24 +76,23 @@
<string name="sign_out">Salir</string>

<!-- Untranslated strings -->
<string name="offline_base_maps">Mapas base sin conexión</string>
<string name="add_submission_toolbar_title">Agregar registro</string>
<string name="offline_base_map_selector">Seleccionar área para descargar</string>
<string name="offline_base_map_selector_prompt">Seleccione un mapa base para usarlo sin conexión</string>
<string name="offline_base_map_selector_download">Descargar</string>
<string name="offline_area_selector">Seleccionar área para descargar</string>
<string name="offline_area_selector_prompt">Seleccione un mapa base para usarlo sin conexión</string>
<string name="offline_area_selector_download">Descargar</string>
<string name="photo_preview">Vista previa</string>
<string name="starting">Iniciando</string>
<string name="in_progress">En curso</string>
<string name="paused">Pausado</string>
<string name="completed">Completado</string>
<string name="failed">Fallido</string>
<string name="settings">Ajustes</string>
<string name="offline_base_map_viewer_title">Área del mapa base sin conexión</string>
<string name="offline_base_map_viewer_remove_button">Eliminar</string>
<string name="offline_area_viewer_title">Área del mapa base sin conexión</string>
<string name="offline_area_viewer_remove_button">Eliminar</string>
<string name="unnamed_area">Área sin nombre</string>
<string name="added_by">Añadido por %s</string>
<!-- Label of button used enter the offline area selector. -->
<string name="offline_base_map_selector_select">Seleccionar y descargar</string>
<string name="offline_area_selector_select">Seleccionar y descargar</string>
<string name="no_basemaps_downloaded">No se descargaron mapas base.</string>
<string name="signing_in">Iniciando sesión</string>
<!-- Precedes the build number shown in the side menu of debug builds. -->
13 changes: 6 additions & 7 deletions ground/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
@@ -75,24 +75,23 @@
<string name="date">Data</string>
<string name="time">Hora</string>
<string name="continue_editing">Continuar editando</string>
<string name="offline_base_maps">Base de mapas offline</string>
<string name="add_submission_toolbar_title">Adicionar observação</string>
<string name="offline_base_map_selector">Selecionar área de download</string>
<string name="offline_base_map_selector_prompt">Selecionar o mapa de base para uso offline</string>
<string name="offline_base_map_selector_download">Download</string>
<string name="offline_area_selector">Selecionar área de download</string>
<string name="offline_area_selector_prompt">Selecionar o mapa de base para uso offline</string>
<string name="offline_area_selector_download">Download</string>
<string name="photo_preview">Prévia</string>
<string name="starting">Início</string>
<string name="in_progress">Em progresso</string>
<string name="paused">Pausado</string>
<string name="completed">Concluído</string>
<string name="failed">Falha</string>
<string name="settings">Ajustes</string>
<string name="offline_base_map_viewer_title">Visualizador offline de Títulos de Base de Mapas</string>
<string name="offline_base_map_viewer_remove_button">Remover</string>
<string name="offline_area_viewer_title">Visualizador offline de Títulos de Base de Mapas</string>
<string name="offline_area_viewer_remove_button">Remover</string>
<string name="unnamed_area">Area sem nome</string>
<string name="added_by">Adicionado por %s</string>
<!-- Label of button used enter the offline area selector. -->
<string name="offline_base_map_selector_select">Selecionar e download</string>
<string name="offline_area_selector_select">Selecionar e download</string>
<string name="no_basemaps_downloaded">Nenhum mapa carregado.</string>
<string name="signing_in">Entrar</string>
<!-- Precedes the build number shown in the side menu of debug builds. -->
Loading