Skip to content

Commit

Permalink
Format with AS ktfmt 1.1.0.49
Browse files Browse the repository at this point in the history
  • Loading branch information
gino-m committed Apr 30, 2024
1 parent 9dc9da5 commit e6a4974
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ground/src/main/java/com/google/android/ground/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ object Config {

fun getMogSources(path: String) =
listOf(
MogSource(0 ..< DEFAULT_MOG_MIN_ZOOM, "$path/$DEFAULT_MOG_MIN_ZOOM/overview.tif"),
MogSource(0..<DEFAULT_MOG_MIN_ZOOM, "$path/$DEFAULT_MOG_MIN_ZOOM/overview.tif"),
MogSource(
DEFAULT_MOG_MIN_ZOOM..DEFAULT_MOG_MAX_ZOOM,
"$path/$DEFAULT_MOG_MIN_ZOOM/{x}/{y}.tif",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import com.google.android.ground.ui.common.Navigator
import com.google.android.ground.ui.common.ProgressDialogs.modalSpinner
import com.google.android.ground.ui.common.ViewModelFactory
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject
import kotlinx.coroutines.launch
import timber.log.Timber
import javax.inject.Inject

/**
* The app's main activity. The app consists of multiples Fragments that live under this activity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ data class OfflineArea(
PENDING,
IN_PROGRESS,
DOWNLOADED,
FAILED
FAILED,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ data class Job(
PREDEFINED,
AD_HOC,
MIXED,
UNKNOWN
UNKNOWN,
}

class TaskNotFoundException(taskId: String) : Throwable(message = "unknown task $taskId")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ sealed class Mutation {
DELETE,

/** Indicates database skew or an implementation bug. */
UNKNOWN
UNKNOWN,
}

/** Status of mutation being applied to remote data store. */
Expand Down Expand Up @@ -73,7 +73,7 @@ sealed class Mutation {
COMPLETED,

/** Failed indicates all retries have failed. */
FAILED
FAILED,
}

override fun toString(): String = "$syncStatus $type $clientTimestamp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import com.google.android.ground.model.submission.TaskData

/** The task ID. */
typealias TaskId = String

/** The selected values keyed by task ID. */
typealias TaskSelections = Map<String, TaskData>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ constructor(
) {
enum class Cardinality {
SELECT_ONE,
SELECT_MULTIPLE
SELECT_MULTIPLE,
}

fun getOptionById(id: String): Option? = options.firstOrNull { it.id == id }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ constructor(
TIME,
DROP_PIN,
DRAW_AREA,
CAPTURE_LOCATION
CAPTURE_LOCATION,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ data class TileSourceEntity(
GEOJSON,
IMAGE,
MOG,
UNKNOWN
UNKNOWN,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const val TOPIC_PREFIX = "/topics/"
class FirebaseMessagingService : FirebaseMessagingService() {

@Inject lateinit var surveySyncService: SurveySyncService

/**
* Processes new messages, enqueuing a worker to sync the survey with the id specified in the
* message topic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ import com.google.firebase.firestore.WriteBatch
import com.google.firebase.functions.FirebaseFunctions
import com.google.firebase.ktx.Firebase
import com.google.firebase.messaging.ktx.messaging
import javax.inject.Inject
import javax.inject.Singleton
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.emitAll
Expand All @@ -42,6 +40,8 @@ import kotlinx.coroutines.flow.map
import kotlinx.coroutines.tasks.await
import kotlinx.coroutines.withContext
import timber.log.Timber
import javax.inject.Inject
import javax.inject.Singleton

const val PROFILE_REFRESH_CLOUD_FUNCTION_NAME = "profile-refresh"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ import kotlinx.coroutines.flow.callbackFlow

enum class NetworkStatus {
AVAILABLE,
UNAVAILABLE
UNAVAILABLE,
}

/** Abstracts access to network state. */
@Singleton
class NetworkManager @Inject constructor(@ApplicationContext private val context: Context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ data class SignInState(val state: State, val result: Result<User?>) {
SIGNED_OUT,
SIGNING_IN,
SIGNED_IN,
ERROR
ERROR,
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ internal constructor(
}
return tasks.indexOf(tasks.first { it.id == currentTaskId.value })
}

/** Persists the collected data as draft to local storage. */
private fun saveDraft() {
externalScope.launch(ioDispatcher) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ data class Bounds(val southwest: Coordinates, val northeast: Coordinates) {

val southeast
get() = Coordinates(south, east)

/**
* The corners of the bounds in counterclockwise order starting from the northwestern most vertex.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import timber.log.Timber

/** Aliases a relative path or a URL to a MOG. */
typealias MogPathOrUrl = String

/** Aliases a fetch-able URL to a MOG. */
typealias MogUrl = String

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import java.nio.charset.StandardCharsets
import java.util.*

private const val NULL_CHAR = 0.toChar()

// TODO(#1596): Add unit tests.
/** Instances of this class are not thread-safe. */
class MogMetadataReader(private val seekable: SeekableInputStream) {
Expand Down

0 comments on commit e6a4974

Please sign in to comment.