├── .gitignore
├── Corona Mapping.iml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── alfianyusufabdullah
│ │ │ └── corona
│ │ │ ├── App.kt
│ │ │ ├── base
│ │ │ └── BaseMapsActivity.kt
│ │ │ ├── data
│ │ │ ├── entity
│ │ │ │ ├── Data.kt
│ │ │ │ ├── DataResponse.kt
│ │ │ │ ├── Infected.kt
│ │ │ │ └── Location.kt
│ │ │ ├── repository
│ │ │ │ └── DataRepository.kt
│ │ │ └── source
│ │ │ │ └── DataSource.kt
│ │ │ ├── ui
│ │ │ ├── MainActivity.kt
│ │ │ └── MainViewModel.kt
│ │ │ └── util
│ │ │ └── Mapper.kt
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ ├── ic_launcher_background.xml
│ │ ├── ic_marker_with_border.png
│ │ ├── ic_place_black.xml
│ │ └── ic_refresh.xml
│ │ ├── font
│ │ ├── quicksand_light.ttf
│ │ └── quicksand_reguler.ttf
│ │ ├── layout
│ │ └── activity_maps.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── raw
│ │ └── map_style.json
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── release
│ └── res
│ └── values
│ └── google_maps_api.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── local.properties
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | .idea/
3 | .gradle/
4 |
5 | app/src/debug/res/values/google_maps_api.xml
6 |
7 | app/app.iml
8 |
--------------------------------------------------------------------------------
/Corona Mapping.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | CoronaMapping
2 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'kotlin-android-extensions'
4 |
5 | android {
6 | compileSdkVersion 29
7 | buildToolsVersion "29.0.3"
8 |
9 | defaultConfig {
10 | applicationId "alfianyusufabdullah.corona"
11 | minSdkVersion 23
12 | targetSdkVersion 29
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 |
26 | }
27 |
28 | dependencies {
29 | implementation fileTree(dir: 'libs', include: ['*.jar'])
30 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
31 | implementation 'androidx.appcompat:appcompat:1.1.0'
32 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
33 | implementation 'androidx.cardview:cardview:1.0.0'
34 | implementation 'androidx.core:core-ktx:1.2.0'
35 |
36 | implementation 'com.google.android.material:material:1.2.0-alpha05'
37 |
38 | implementation 'com.google.code.gson:gson:2.8.6'
39 | implementation 'com.google.android.gms:play-services-maps:17.0.0'
40 |
41 | implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
42 |
43 | implementation 'org.koin:koin-core:2.0.1'
44 | implementation 'org.koin:koin-android:2.0.1'
45 | implementation 'org.koin:koin-android-viewmodel:2.0.1'
46 |
47 | implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3'
48 | implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3'
49 | }
50 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
11 |
12 |
13 |
21 |
22 |
30 |
33 |
34 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/app/src/main/java/alfianyusufabdullah/corona/App.kt:
--------------------------------------------------------------------------------
1 | package alfianyusufabdullah.corona
2 |
3 | import alfianyusufabdullah.corona.data.repository.DataRepository
4 | import alfianyusufabdullah.corona.data.source.DataSource
5 | import alfianyusufabdullah.corona.ui.MainViewModel
6 | import alfianyusufabdullah.corona.util.Mapper
7 | import android.app.Application
8 | import kotlinx.coroutines.ExperimentalCoroutinesApi
9 | import org.koin.android.ext.koin.androidLogger
10 | import org.koin.android.viewmodel.dsl.viewModel
11 | import org.koin.core.context.startKoin
12 | import org.koin.core.logger.Level
13 | import org.koin.dsl.module
14 |
15 | @ExperimentalCoroutinesApi
16 | class App : Application() {
17 | override fun onCreate() {
18 | super.onCreate()
19 |
20 | startKoin {
21 | androidLogger(Level.DEBUG)
22 | modules(appModule)
23 | }
24 | }
25 | }
26 |
27 | @ExperimentalCoroutinesApi
28 | val appModule = module {
29 | single { DataSource() }
30 | single { DataRepository(get()) }
31 |
32 | single { Mapper() }
33 |
34 | viewModel { MainViewModel(get(), get()) }
35 | }
--------------------------------------------------------------------------------
/app/src/main/java/alfianyusufabdullah/corona/base/BaseMapsActivity.kt:
--------------------------------------------------------------------------------
1 | package alfianyusufabdullah.corona.base
2 |
3 | import alfianyusufabdullah.corona.R
4 | import android.os.Bundle
5 | import android.transition.TransitionManager
6 | import android.view.WindowManager
7 | import androidx.appcompat.app.AppCompatActivity
8 | import androidx.core.content.ContextCompat
9 | import com.google.android.gms.maps.CameraUpdateFactory
10 | import com.google.android.gms.maps.GoogleMap
11 | import com.google.android.gms.maps.OnMapReadyCallback
12 | import com.google.android.gms.maps.SupportMapFragment
13 | import com.google.android.gms.maps.model.LatLng
14 | import com.google.android.gms.maps.model.MapStyleOptions
15 | import com.google.android.gms.maps.model.Marker
16 | import kotlinx.android.synthetic.main.activity_maps.*
17 |
18 | abstract class BaseMapsActivity : AppCompatActivity(), OnMapReadyCallback {
19 |
20 | companion object {
21 | const val CONFIRMED_INDEX = 0
22 | const val RECOVERED_INDEX = 1
23 | const val DEATH_INDEX = 2
24 | const val LAST_UPDATE_INDEX = 3
25 | }
26 |
27 | var mMap: GoogleMap? = null
28 | abstract val contentId: Int
29 | abstract val mapsId: Int
30 |
31 | abstract fun onMarkerClick(marker: Marker)
32 | abstract fun onMapClick()
33 | abstract fun onMapReady()
34 |
35 | abstract fun onCreate()
36 |
37 | override fun onCreate(savedInstanceState: Bundle?) {
38 | super.onCreate(savedInstanceState)
39 |
40 | window.setFlags(
41 | WindowManager.LayoutParams.FLAG_FULLSCREEN,
42 | WindowManager.LayoutParams.FLAG_FULLSCREEN
43 | )
44 |
45 | window.navigationBarColor = ContextCompat.getColor(this, android.R.color.transparent)
46 |
47 | setContentView(contentId)
48 | val mapFragment = supportFragmentManager
49 | .findFragmentById(mapsId) as SupportMapFragment
50 | mapFragment.getMapAsync(this)
51 |
52 | onCreate()
53 | }
54 |
55 | override fun onMapReady(googleMap: GoogleMap?) {
56 | mMap = googleMap
57 | mMap?.uiSettings?.isMapToolbarEnabled = false
58 |
59 | mMap?.setMapStyle(
60 | MapStyleOptions.loadRawResourceStyle(
61 | this,
62 | R.raw.map_style
63 | )
64 | )
65 | mMap?.setOnMarkerClickListener {
66 | onMarkerClick(it)
67 |
68 | mMap?.animateCamera(CameraUpdateFactory.newLatLngZoom(it.position, 5f))
69 | true
70 | }
71 |
72 | mMap?.setOnMapClickListener {
73 | onMapClick()
74 | }
75 |
76 | onMapReady()
77 | moveCameraToCenter()
78 | }
79 |
80 | fun moveCameraToCenter(){
81 | val latLng = LatLng(-0.7893, 113.9213)
82 | mMap?.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 3f))
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/app/src/main/java/alfianyusufabdullah/corona/data/entity/Data.kt:
--------------------------------------------------------------------------------
1 | package alfianyusufabdullah.corona.data.entity
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class Data(
6 |
7 | @field:SerializedName("value")
8 | val value: Int? = null
9 | )
--------------------------------------------------------------------------------
/app/src/main/java/alfianyusufabdullah/corona/data/entity/DataResponse.kt:
--------------------------------------------------------------------------------
1 | package alfianyusufabdullah.corona.data.entity
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class DataResponse(
6 |
7 | @field:SerializedName("recovered")
8 | val recovered: Data? = null,
9 |
10 | @field:SerializedName("lastUpdate")
11 | var lastUpdate: String? = null,
12 |
13 | @field:SerializedName("confirmed")
14 | val confirmed: Data? = null,
15 |
16 | @field:SerializedName("deaths")
17 | val deaths: Data? = null
18 | )
--------------------------------------------------------------------------------
/app/src/main/java/alfianyusufabdullah/corona/data/entity/Infected.kt:
--------------------------------------------------------------------------------
1 | package alfianyusufabdullah.corona.data.entity
2 |
3 | data class Infected(var mainData: DataResponse?, var locations: Array) {
4 | override fun equals(other: Any?): Boolean {
5 | if (this === other) return true
6 | if (javaClass != other?.javaClass) return false
7 |
8 | other as Infected
9 |
10 | if (mainData != other.mainData) return false
11 | if (!locations.contentEquals(other.locations)) return false
12 |
13 | return true
14 | }
15 |
16 | override fun hashCode(): Int {
17 | var result = mainData?.hashCode() ?: 0
18 | result = 31 * result + locations.contentHashCode()
19 | return result
20 | }
21 | }
--------------------------------------------------------------------------------
/app/src/main/java/alfianyusufabdullah/corona/data/entity/Location.kt:
--------------------------------------------------------------------------------
1 | package alfianyusufabdullah.corona.data.entity
2 |
3 | import com.google.gson.annotations.SerializedName
4 |
5 | data class Location(
6 |
7 | @field:SerializedName("recovered")
8 | val recovered: Int? = null,
9 |
10 | @field:SerializedName("countryRegion")
11 | var countryRegion: String? = null,
12 |
13 | @field:SerializedName("lastUpdate")
14 | val lastUpdate: Long? = null,
15 |
16 | var readableLastUpdate: String? = null,
17 |
18 | @field:SerializedName("confirmed")
19 | val confirmed: Int? = null,
20 |
21 | @field:SerializedName("provinceState")
22 | val provinceState: String? = null,
23 |
24 | @field:SerializedName("lat")
25 | val latitude: Double? = null,
26 |
27 | @field:SerializedName("long")
28 | val longitude: Double? = null,
29 |
30 | @field:SerializedName("deaths")
31 | val deaths: Int? = null
32 | )
--------------------------------------------------------------------------------
/app/src/main/java/alfianyusufabdullah/corona/data/repository/DataRepository.kt:
--------------------------------------------------------------------------------
1 | package alfianyusufabdullah.corona.data.repository
2 |
3 | import alfianyusufabdullah.corona.data.entity.DataResponse
4 | import alfianyusufabdullah.corona.data.entity.Location
5 | import alfianyusufabdullah.corona.data.source.DataSource
6 | import com.google.gson.Gson
7 | import kotlinx.coroutines.Dispatchers
8 | import kotlinx.coroutines.ExperimentalCoroutinesApi
9 | import kotlinx.coroutines.delay
10 | import kotlinx.coroutines.flow.flow
11 | import kotlinx.coroutines.flow.flowOn
12 | import org.json.JSONException
13 |
14 | @ExperimentalCoroutinesApi
15 | class DataRepository(private val dataSource: DataSource) {
16 |
17 | fun loadMainData() = flow {
18 | try {
19 | val response =
20 | Gson().fromJson(dataSource.loadMainData(), DataResponse::class.java)
21 |
22 | emit(response)
23 | } catch (e: JSONException) {
24 | emit(null)
25 | }
26 | }.flowOn(Dispatchers.IO)
27 |
28 | fun loadDataWithLocation() = flow {
29 | try {
30 | val response: Array = Gson().fromJson(
31 | dataSource.loadDataWithLocation(),
32 | Array::class.java
33 | )
34 |
35 | emit(response)
36 | } catch (e: JSONException) {
37 | emit(null)
38 | e.printStackTrace()
39 | }
40 | }.flowOn(Dispatchers.IO)
41 | }
--------------------------------------------------------------------------------
/app/src/main/java/alfianyusufabdullah/corona/data/source/DataSource.kt:
--------------------------------------------------------------------------------
1 | package alfianyusufabdullah.corona.data.source
2 |
3 | import java.net.URL
4 |
5 | class DataSource {
6 |
7 | fun loadMainData()
8 | = URL("https://covid19.mathdro.id/api").readText()
9 |
10 | fun loadDataWithLocation()
11 | = URL("https://covid19.mathdro.id/api/confirmed").readText()
12 | }
--------------------------------------------------------------------------------
/app/src/main/java/alfianyusufabdullah/corona/ui/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package alfianyusufabdullah.corona.ui
2 |
3 | import alfianyusufabdullah.corona.R
4 | import alfianyusufabdullah.corona.base.BaseMapsActivity
5 | import alfianyusufabdullah.corona.data.entity.DataResponse
6 | import alfianyusufabdullah.corona.data.entity.Location
7 | import android.transition.TransitionManager
8 | import android.view.View
9 | import androidx.lifecycle.Observer
10 | import com.google.android.gms.maps.model.BitmapDescriptorFactory
11 | import com.google.android.gms.maps.model.LatLng
12 | import com.google.android.gms.maps.model.Marker
13 | import com.google.android.gms.maps.model.MarkerOptions
14 | import kotlinx.android.synthetic.main.activity_maps.*
15 | import kotlinx.coroutines.ExperimentalCoroutinesApi
16 | import org.koin.android.viewmodel.ext.android.viewModel
17 |
18 | @ExperimentalCoroutinesApi
19 | class MainActivity : BaseMapsActivity() {
20 |
21 | private val mainViewModel: MainViewModel by viewModel()
22 |
23 | override val contentId = R.layout.activity_maps
24 | override val mapsId = R.id.maps_corona
25 |
26 | override fun onMarkerClick(marker: Marker) {
27 | TransitionManager.beginDelayedTransition(rootParent)
28 |
29 | cardLocation.visibility = View.VISIBLE
30 | textLocation.text = marker.title
31 |
32 | val snippets = marker.snippet.split("::").toTypedArray()
33 |
34 | renderDashboardValue(*snippets)
35 | }
36 |
37 | override fun onMapClick() {
38 | TransitionManager.beginDelayedTransition(rootParent)
39 |
40 | cardLocation.visibility = View.GONE
41 | mainViewModel.reloadInformationOnDashboard()
42 | }
43 |
44 | override fun onMapReady() {
45 | mainViewModel.retrieveCoronaInfectedLocationData()
46 | }
47 |
48 | override fun onCreate() {
49 | mainViewModel.location.observe(this, Observer {
50 | renderInfectedLocationMarker(it)
51 | })
52 |
53 | mainViewModel.data.observe(this, Observer {
54 | renderDashboard(it)
55 | })
56 |
57 | mainViewModel.loading.observe(this, Observer {
58 | loadingState(it)
59 | })
60 |
61 | fabRefresh.setOnClickListener {
62 | mMap?.let {
63 | mainViewModel.retrieveCoronaInfectedLocationData()
64 |
65 | renderDashboardValue("-", "-", "-", "-")
66 | cardLocation.visibility = View.GONE
67 |
68 | moveCameraToCenter()
69 | mMap?.clear()
70 | }
71 | }
72 | }
73 |
74 | private fun loadingState(isLoading: Boolean) {
75 | TransitionManager.beginDelayedTransition(rootParent)
76 | if (isLoading) {
77 | fabRefresh.visibility = View.INVISIBLE
78 | cardLoading.visibility = View.VISIBLE
79 |
80 | mMap?.clear()
81 | } else {
82 | fabRefresh.visibility = View.VISIBLE
83 | cardLoading.visibility = View.GONE
84 | }
85 | }
86 |
87 | private fun renderDashboard(data: DataResponse) {
88 | TransitionManager.beginDelayedTransition(infoParent)
89 |
90 | renderDashboardValue(
91 | data.confirmed?.value.toString(),
92 | data.recovered?.value.toString(),
93 | data.deaths?.value.toString(),
94 | "${data.lastUpdate}"
95 | )
96 | }
97 |
98 | private fun renderDashboardValue(vararg value: String) {
99 | textConfirmed.text = value[CONFIRMED_INDEX]
100 | textRecovered.text = value[RECOVERED_INDEX]
101 | textDeath.text = value[DEATH_INDEX]
102 |
103 | textLastUpdate.text = "last update ${value[LAST_UPDATE_INDEX]}"
104 | }
105 |
106 | private fun renderInfectedLocationMarker(location: Location) {
107 | val latLng = LatLng(location.latitude ?: 0.0, location.longitude ?: 0.0)
108 |
109 | val snippet =
110 | "${location.confirmed}::${location.recovered}::${location.deaths}::${location.readableLastUpdate}"
111 |
112 | mMap?.addMarker(
113 | MarkerOptions()
114 | .title(location.countryRegion)
115 | .position(latLng)
116 | .snippet(snippet)
117 | .icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_marker_with_border))
118 | )
119 | }
120 | }
--------------------------------------------------------------------------------
/app/src/main/java/alfianyusufabdullah/corona/ui/MainViewModel.kt:
--------------------------------------------------------------------------------
1 | package alfianyusufabdullah.corona.ui
2 |
3 | import alfianyusufabdullah.corona.data.entity.DataResponse
4 | import alfianyusufabdullah.corona.data.entity.Infected
5 | import alfianyusufabdullah.corona.data.entity.Location
6 | import alfianyusufabdullah.corona.data.repository.DataRepository
7 | import alfianyusufabdullah.corona.util.Mapper
8 | import androidx.lifecycle.LiveData
9 | import androidx.lifecycle.MutableLiveData
10 | import androidx.lifecycle.ViewModel
11 | import androidx.lifecycle.viewModelScope
12 | import kotlinx.coroutines.ExperimentalCoroutinesApi
13 | import kotlinx.coroutines.delay
14 | import kotlinx.coroutines.flow.*
15 | import kotlinx.coroutines.launch
16 | import java.net.ResponseCache
17 |
18 | @ExperimentalCoroutinesApi
19 | class MainViewModel(private val dataRepository: DataRepository, private val mapper: Mapper) :
20 | ViewModel() {
21 |
22 | private val _location = MutableLiveData()
23 | private val _data = MutableLiveData()
24 | private val _loading = MutableLiveData()
25 |
26 | val location: LiveData
27 | get() = _location
28 |
29 | val data: LiveData
30 | get() = _data
31 |
32 | val loading: LiveData
33 | get() = _loading
34 |
35 | fun retrieveCoronaInfectedLocationData() {
36 | viewModelScope.launch {
37 |
38 | dataRepository.loadMainData()
39 | .zip(dataRepository.loadDataWithLocation()) { mainData, locations ->
40 | Infected(mainData, locations ?: emptyArray())
41 | }
42 | .map {
43 | it.copy().apply {
44 | mainData = mapper.lastUpdateMapper(it.mainData as DataResponse)
45 | }
46 | }
47 | .map {
48 | it.copy().apply {
49 | locations =
50 | mapper.locationNameMapper(it.locations)?.toTypedArray() ?: emptyArray()
51 | }
52 | }
53 | .map {
54 | it.copy().apply {
55 | locations = mapper.locationLastUpdateMapper(it.locations)?.toTypedArray()
56 | ?: emptyArray()
57 | }
58 | }
59 | .onStart { _loading.value = true }
60 | .onCompletion { _loading.value = false }
61 | .collect {
62 | _data.value = it.mainData
63 |
64 | it.locations.forEach { location ->
65 | delay(30)
66 | _location.value = location
67 | }
68 | }
69 | }
70 | }
71 |
72 | fun reloadInformationOnDashboard() {
73 | val latest = data.value
74 | _data.value = latest
75 | }
76 | }
--------------------------------------------------------------------------------
/app/src/main/java/alfianyusufabdullah/corona/util/Mapper.kt:
--------------------------------------------------------------------------------
1 | package alfianyusufabdullah.corona.util
2 |
3 | import alfianyusufabdullah.corona.data.entity.DataResponse
4 | import alfianyusufabdullah.corona.data.entity.Location
5 | import java.text.SimpleDateFormat
6 | import java.util.*
7 |
8 | class Mapper {
9 |
10 | fun locationNameMapper(data: Array?) = data?.map {
11 | val name = it.provinceState ?: it.countryRegion
12 | it.copy().apply {
13 | countryRegion = name
14 | }
15 | }
16 |
17 | fun locationLastUpdateMapper(data: Array?) = data?.map {
18 | val newFormat = SimpleDateFormat("HH:mm - dd MMM, yyyy", Locale.getDefault())
19 | val newDate = Date(it.lastUpdate ?: 0L)
20 |
21 | it.copy().apply {
22 | readableLastUpdate = newFormat.format(newDate)
23 | }
24 | }
25 |
26 | fun lastUpdateMapper(dataResponse: DataResponse): DataResponse {
27 | val utcFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.getDefault())
28 | utcFormat.timeZone = TimeZone.getTimeZone("UTC")
29 |
30 | val date = utcFormat.parse(dataResponse.lastUpdate ?: "2020-03-07T15:03:06.000Z") as Date
31 | val newFormat = SimpleDateFormat("HH:mm - dd MMM, yyyy", Locale.getDefault())
32 |
33 | return dataResponse.copy().apply {
34 | lastUpdate = newFormat.format(date)
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_marker_with_border.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alfianyusufabdullah/kotlin-corona-mapping/98641a81a0e45911dba4ff2c5be207b9609f3f4b/app/src/main/res/drawable/ic_marker_with_border.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_place_black.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_refresh.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/font/quicksand_light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alfianyusufabdullah/kotlin-corona-mapping/98641a81a0e45911dba4ff2c5be207b9609f3f4b/app/src/main/res/font/quicksand_light.ttf
--------------------------------------------------------------------------------
/app/src/main/res/font/quicksand_reguler.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alfianyusufabdullah/kotlin-corona-mapping/98641a81a0e45911dba4ff2c5be207b9609f3f4b/app/src/main/res/font/quicksand_reguler.ttf
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_maps.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
25 |
26 |
27 |
39 |
40 |
41 |
51 |
52 |
53 |
65 |
66 |
70 |
71 |
75 |
76 |
85 |
86 |
87 |
88 |
101 |
102 |
107 |
108 |
109 |
118 |
119 |
129 |
130 |
138 |
139 |
150 |
151 |
159 |
160 |
170 |
171 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alfianyusufabdullah/kotlin-corona-mapping/98641a81a0e45911dba4ff2c5be207b9609f3f4b/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alfianyusufabdullah/kotlin-corona-mapping/98641a81a0e45911dba4ff2c5be207b9609f3f4b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alfianyusufabdullah/kotlin-corona-mapping/98641a81a0e45911dba4ff2c5be207b9609f3f4b/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alfianyusufabdullah/kotlin-corona-mapping/98641a81a0e45911dba4ff2c5be207b9609f3f4b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alfianyusufabdullah/kotlin-corona-mapping/98641a81a0e45911dba4ff2c5be207b9609f3f4b/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alfianyusufabdullah/kotlin-corona-mapping/98641a81a0e45911dba4ff2c5be207b9609f3f4b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alfianyusufabdullah/kotlin-corona-mapping/98641a81a0e45911dba4ff2c5be207b9609f3f4b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alfianyusufabdullah/kotlin-corona-mapping/98641a81a0e45911dba4ff2c5be207b9609f3f4b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alfianyusufabdullah/kotlin-corona-mapping/98641a81a0e45911dba4ff2c5be207b9609f3f4b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alfianyusufabdullah/kotlin-corona-mapping/98641a81a0e45911dba4ff2c5be207b9609f3f4b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/raw/map_style.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "elementType": "geometry",
4 | "stylers": [
5 | {
6 | "color": "#1d2c4d"
7 | }
8 | ]
9 | },
10 | {
11 | "elementType": "labels.text.fill",
12 | "stylers": [
13 | {
14 | "color": "#8ec3b9"
15 | }
16 | ]
17 | },
18 | {
19 | "elementType": "labels.text.stroke",
20 | "stylers": [
21 | {
22 | "color": "#1a3646"
23 | }
24 | ]
25 | },
26 | {
27 | "featureType": "administrative.country",
28 | "elementType": "geometry.stroke",
29 | "stylers": [
30 | {
31 | "color": "#4b6878"
32 | }
33 | ]
34 | },
35 | {
36 | "featureType": "administrative.land_parcel",
37 | "elementType": "labels.text.fill",
38 | "stylers": [
39 | {
40 | "color": "#64779e"
41 | }
42 | ]
43 | },
44 | {
45 | "featureType": "administrative.province",
46 | "elementType": "geometry.stroke",
47 | "stylers": [
48 | {
49 | "color": "#4b6878"
50 | }
51 | ]
52 | },
53 | {
54 | "featureType": "landscape.man_made",
55 | "elementType": "geometry.stroke",
56 | "stylers": [
57 | {
58 | "color": "#334e87"
59 | }
60 | ]
61 | },
62 | {
63 | "featureType": "landscape.natural",
64 | "elementType": "geometry",
65 | "stylers": [
66 | {
67 | "color": "#023e58"
68 | }
69 | ]
70 | },
71 | {
72 | "featureType": "poi",
73 | "elementType": "geometry",
74 | "stylers": [
75 | {
76 | "color": "#283d6a"
77 | }
78 | ]
79 | },
80 | {
81 | "featureType": "poi",
82 | "elementType": "labels.text.fill",
83 | "stylers": [
84 | {
85 | "color": "#6f9ba5"
86 | }
87 | ]
88 | },
89 | {
90 | "featureType": "poi",
91 | "elementType": "labels.text.stroke",
92 | "stylers": [
93 | {
94 | "color": "#1d2c4d"
95 | }
96 | ]
97 | },
98 | {
99 | "featureType": "poi.park",
100 | "elementType": "geometry.fill",
101 | "stylers": [
102 | {
103 | "color": "#023e58"
104 | }
105 | ]
106 | },
107 | {
108 | "featureType": "poi.park",
109 | "elementType": "labels.text.fill",
110 | "stylers": [
111 | {
112 | "color": "#3C7680"
113 | }
114 | ]
115 | },
116 | {
117 | "featureType": "road",
118 | "elementType": "geometry",
119 | "stylers": [
120 | {
121 | "color": "#304a7d"
122 | }
123 | ]
124 | },
125 | {
126 | "featureType": "road",
127 | "elementType": "labels.text.fill",
128 | "stylers": [
129 | {
130 | "color": "#98a5be"
131 | }
132 | ]
133 | },
134 | {
135 | "featureType": "road",
136 | "elementType": "labels.text.stroke",
137 | "stylers": [
138 | {
139 | "color": "#1d2c4d"
140 | }
141 | ]
142 | },
143 | {
144 | "featureType": "road.arterial",
145 | "elementType": "labels",
146 | "stylers": [
147 | {
148 | "visibility": "off"
149 | }
150 | ]
151 | },
152 | {
153 | "featureType": "road.highway",
154 | "elementType": "geometry",
155 | "stylers": [
156 | {
157 | "color": "#2c6675"
158 | }
159 | ]
160 | },
161 | {
162 | "featureType": "road.highway",
163 | "elementType": "geometry.stroke",
164 | "stylers": [
165 | {
166 | "color": "#255763"
167 | }
168 | ]
169 | },
170 | {
171 | "featureType": "road.highway",
172 | "elementType": "labels",
173 | "stylers": [
174 | {
175 | "visibility": "off"
176 | }
177 | ]
178 | },
179 | {
180 | "featureType": "road.highway",
181 | "elementType": "labels.text.fill",
182 | "stylers": [
183 | {
184 | "color": "#b0d5ce"
185 | }
186 | ]
187 | },
188 | {
189 | "featureType": "road.highway",
190 | "elementType": "labels.text.stroke",
191 | "stylers": [
192 | {
193 | "color": "#023e58"
194 | }
195 | ]
196 | },
197 | {
198 | "featureType": "road.local",
199 | "stylers": [
200 | {
201 | "visibility": "off"
202 | }
203 | ]
204 | },
205 | {
206 | "featureType": "transit",
207 | "elementType": "labels.text.fill",
208 | "stylers": [
209 | {
210 | "color": "#98a5be"
211 | }
212 | ]
213 | },
214 | {
215 | "featureType": "transit",
216 | "elementType": "labels.text.stroke",
217 | "stylers": [
218 | {
219 | "color": "#1d2c4d"
220 | }
221 | ]
222 | },
223 | {
224 | "featureType": "transit.line",
225 | "elementType": "geometry.fill",
226 | "stylers": [
227 | {
228 | "color": "#283d6a"
229 | }
230 | ]
231 | },
232 | {
233 | "featureType": "transit.station",
234 | "elementType": "geometry",
235 | "stylers": [
236 | {
237 | "color": "#3a4762"
238 | }
239 | ]
240 | },
241 | {
242 | "featureType": "water",
243 | "elementType": "geometry",
244 | "stylers": [
245 | {
246 | "color": "#0e1626"
247 | }
248 | ]
249 | },
250 | {
251 | "featureType": "water",
252 | "elementType": "labels.text.fill",
253 | "stylers": [
254 | {
255 | "color": "#4e6d70"
256 | }
257 | ]
258 | }
259 | ]
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #6200EE
4 | #03DAC5
5 | #001522
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Corona Mapping
3 | Map
4 | Confirmed
5 | Recovered
6 | Death
7 | -
8 | memuat data…
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/release/res/values/google_maps_api.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 | YOUR_KEY_HERE
20 |
21 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.3.70'
5 | repositories {
6 | google()
7 | jcenter()
8 |
9 | }
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:3.6.1'
12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13 |
14 | // NOTE: Do not place your application dependencies here; they belong
15 | // in the individual module build.gradle files
16 | }
17 | }
18 |
19 | allprojects {
20 | repositories {
21 | google()
22 | jcenter()
23 |
24 | }
25 | }
26 |
27 | task clean(type: Delete) {
28 | delete rootProject.buildDir
29 | }
30 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
22 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/alfianyusufabdullah/kotlin-corona-mapping/98641a81a0e45911dba4ff2c5be207b9609f3f4b/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Mar 07 17:58:26 WIB 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file should *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | sdk.dir=/home/dicoding/SDK/android
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name='Corona Mapping'
2 | include ':app'
3 |
--------------------------------------------------------------------------------