This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.okawa.sample.googlemaps.ui.tracker | |
import androidx.fragment.app.viewModels | |
import androidx.lifecycle.Observer | |
import com.google.android.gms.maps.CameraUpdateFactory | |
import com.google.android.gms.maps.GoogleMap | |
import com.google.android.gms.maps.OnMapReadyCallback | |
import com.google.android.gms.maps.SupportMapFragment | |
import com.google.android.gms.maps.model.LatLng | |
import com.google.android.gms.maps.model.MarkerOptions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.okawa.sample.googlemaps.ui.tracker | |
import android.util.Log | |
import androidx.lifecycle.LiveData | |
import androidx.lifecycle.MutableLiveData | |
import com.okawa.sample.googlemaps.data.viewmodel.BaseViewModel | |
import com.okawa.sample.googlemaps.data.livedata.SingleLiveEvent | |
import com.okawa.sample.googlemaps.data.schedulers.BaseSchedulerProvider | |
import com.okawa.sample.googlemaps.domain.usecase.GetLocationUseCase | |
import com.okawa.sample.googlemaps.model.LocationModel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.okawa.sample.googlemaps.domain.usecase | |
import com.okawa.sample.googlemaps.domain.model.LocationDomainModel | |
import com.okawa.sample.googlemaps.domain.repository.LocationRepository | |
import io.reactivex.Flowable | |
import javax.inject.Inject | |
class GetLocationUseCase @Inject constructor( | |
private val locationRepository: LocationRepository | |
) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.okawa.sample.googlemaps.data.repository | |
import com.okawa.sample.googlemaps.data.source.GoogleLocationDataSource | |
import com.okawa.sample.googlemaps.domain.model.LocationDomainModel | |
import com.okawa.sample.googlemaps.domain.repository.LocationRepository | |
import io.reactivex.Flowable | |
import javax.inject.Inject | |
import javax.inject.Singleton | |
@Singleton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.okawa.sample.googlemaps.domain.repository | |
import com.okawa.sample.googlemaps.domain.model.LocationDomainModel | |
import io.reactivex.Flowable | |
interface LocationRepository { | |
fun getLocation(): Flowable<LocationDomainModel> | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.okawa.sample.googlemaps.data.source | |
import android.content.Context | |
import android.location.Location | |
import android.os.Looper | |
import com.google.android.gms.location.LocationCallback | |
import com.google.android.gms.location.LocationRequest | |
import com.google.android.gms.location.LocationResult | |
import com.google.android.gms.location.LocationServices | |
import com.okawa.sample.googlemaps.data.entity.LocationEntity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object AppDependencies { | |
val api = arrayOf( | |
Dependencies.androidViewModel, | |
Dependencies.androidLiveData, | |
Dependencies.androidLifecycleExtensions, | |
Dependencies.appCompat, | |
Dependencies.koinAndroidXScope, | |
Dependencies.koinAndroidXViewModel, | |
Dependencies.kotlinExtensions, | |
Dependencies.navigation, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Versions { | |
const val androidJUnitExt = "1.1.1" | |
const val androidLifecycle = "2.3.0-SNAPSHOT" | |
const val appCompat = "1.1.0" | |
const val coreKtx = "1.1.0" | |
const val coroutines = "1.3.3" | |
const val espressoCore = "3.2.0" | |
const val coil = "0.8.0" | |
const val gradle = "4.0.0-alpha07" | |
const val gson = "2.8.6" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Dependencies { | |
const val androidJUnit = "androidx.test.ext:junit:${Versions.androidJUnitExt}" | |
const val androidLifecycleExtensions = "androidx.lifecycle:lifecycle-extensions:${Versions.androidLifecycle}" | |
const val androidLiveData = "androidx.lifecycle:lifecycle-livedata-ktx:${Versions.androidLifecycle}" | |
const val androidViewModel = "androidx.lifecycle:lifecycle-viewmodel-ktx:${Versions.androidLifecycle}" | |
const val appCompat = "androidx.appcompat:appcompat:${Versions.appCompat}" | |
const val coil = "io.coil-kt:coil:${Versions.coil}" | |
const val coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.coroutines}" | |
const val espresso = "androidx.test.espresso:espresso-core:${Versions.espressoCore}" | |
const val gradle = "com.android.tools.build:gradle:${Versions.gradle}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.application' | |
apply plugin: 'kotlin-android' | |
apply plugin: 'kotlin-android-extensions' | |
android { | |
compileSdkVersion 29 | |
buildToolsVersion '29.0.2' | |
defaultConfig { | |
applicationId 'me.okawa.androidexperiment' |
NewerOlder