From a2d7af40ecd145f618a4c363b7c9541efb43469f Mon Sep 17 00:00:00 2001 From: Sufyan Abbasi Date: Thu, 29 Feb 2024 13:30:43 -0800 Subject: [PATCH] More formatting --- .../repository/OfflineAreaRepository.kt | 6 +++--- .../ground/ui/home/HomeScreenViewModel.kt | 2 +- .../ground/ui/home/HomeScreenFragmentTest.kt | 20 ++++++++----------- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ground/src/main/java/com/google/android/ground/repository/OfflineAreaRepository.kt b/ground/src/main/java/com/google/android/ground/repository/OfflineAreaRepository.kt index 835fa57458..b92d1729e3 100644 --- a/ground/src/main/java/com/google/android/ground/repository/OfflineAreaRepository.kt +++ b/ground/src/main/java/com/google/android/ground/repository/OfflineAreaRepository.kt @@ -33,15 +33,15 @@ import com.google.android.ground.ui.util.FileUtil import com.google.android.ground.util.ByteCount import com.google.android.ground.util.deleteIfEmpty import com.google.android.ground.util.rangeOf +import java.io.File +import javax.inject.Inject +import javax.inject.Singleton import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.flow import kotlinx.coroutines.flow.map import timber.log.Timber -import java.io.File -import javax.inject.Inject -import javax.inject.Singleton /** * Corners of the viewport are scaled by this value when determining the name of downloaded areas. diff --git a/ground/src/main/java/com/google/android/ground/ui/home/HomeScreenViewModel.kt b/ground/src/main/java/com/google/android/ground/ui/home/HomeScreenViewModel.kt index 9fcd5404b2..bcc45a612f 100644 --- a/ground/src/main/java/com/google/android/ground/ui/home/HomeScreenViewModel.kt +++ b/ground/src/main/java/com/google/android/ground/ui/home/HomeScreenViewModel.kt @@ -21,11 +21,11 @@ import androidx.lifecycle.viewModelScope import com.google.android.ground.ui.common.AbstractViewModel import com.google.android.ground.ui.common.Navigator import com.google.android.ground.ui.common.SharedViewModel +import javax.inject.Inject import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.SharedFlow import kotlinx.coroutines.flow.asSharedFlow import kotlinx.coroutines.launch -import javax.inject.Inject @SharedViewModel class HomeScreenViewModel diff --git a/ground/src/test/java/com/google/android/ground/ui/home/HomeScreenFragmentTest.kt b/ground/src/test/java/com/google/android/ground/ui/home/HomeScreenFragmentTest.kt index 268fe11f69..029428e63a 100644 --- a/ground/src/test/java/com/google/android/ground/ui/home/HomeScreenFragmentTest.kt +++ b/ground/src/test/java/com/google/android/ground/ui/home/HomeScreenFragmentTest.kt @@ -39,6 +39,7 @@ import com.google.android.ground.ui.common.Navigator import com.sharedtest.FakeData import com.squareup.picasso.Picasso import dagger.hilt.android.testing.HiltAndroidTest +import javax.inject.Inject import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.advanceUntilIdle import org.junit.Before @@ -46,12 +47,10 @@ import org.junit.Test import org.junit.runner.RunWith import org.robolectric.ParameterizedRobolectricTestRunner import org.robolectric.RobolectricTestRunner -import javax.inject.Inject abstract class AbstractHomeScreenFragmentTest : BaseHiltTest() { - @Inject - lateinit var localSurveyStore: LocalSurveyStore + @Inject lateinit var localSurveyStore: LocalSurveyStore private lateinit var fragment: HomeScreenFragment private var initializedPicasso = false @@ -119,8 +118,7 @@ abstract class AbstractHomeScreenFragmentTest : BaseHiltTest() { @RunWith(RobolectricTestRunner::class) class HomeScreenFragmentTest : AbstractHomeScreenFragmentTest() { - @Inject - lateinit var surveyRepository: SurveyRepository + @Inject lateinit var surveyRepository: SurveyRepository private val surveyWithoutBasemap: Survey = Survey( @@ -135,9 +133,9 @@ class HomeScreenFragmentTest : AbstractHomeScreenFragmentTest() { private val surveyWithTileSources: Survey = surveyWithoutBasemap.copy( tileSources = - listOf( - TileSource("http://google.com", TileSource.Type.MOG_COLLECTION), - ), + listOf( + TileSource("http://google.com", TileSource.Type.MOG_COLLECTION), + ), id = "SURVEY_WITH_TILE_SOURCES" ) @@ -162,11 +160,9 @@ class NavigationDrawerItemClickTest( private val testLabel: String ) : AbstractHomeScreenFragmentTest() { - @Inject - lateinit var navigator: Navigator + @Inject lateinit var navigator: Navigator - @Inject - lateinit var surveyRepository: SurveyRepository + @Inject lateinit var surveyRepository: SurveyRepository @Test fun clickDrawerMenuItem() = runWithTestDispatcher {