Skip to content

Commit f3ec617

Browse files
committed
PR feedback
1 parent 2809a67 commit f3ec617

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

add-feature-layers/src/main/java/com/esri/arcgisruntime/sample/addfeaturelayers/DownloadActivity.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@ import java.io.File
88
class DownloadActivity : DownloaderActivity() {
99
override fun onCreate(savedInstanceState: Bundle?) {
1010
super.onCreate(savedInstanceState)
11-
val downloadFolder = File(
12-
getExternalFilesDir(null)?.path.toString() + File.separator + getString(R.string.app_name)
13-
)
1411
downloadAndStartSample(
1512
Intent(this, MainActivity::class.java),
1613
// get the download path of the sample
17-
downloadFolder.path,
14+
downloadFolder(getString(R.string.app_name)),
1815
listOf(
1916
// ArcGIS Portal item containing the .mmpk mobile map package
2017
"https://www.arcgis.com/home/item.html?id=2b0f9e17105847809dfeb04e3cad69e0",

samples-lib/src/main/java/com/esri/arcgisruntime/sample/sampleslib/DownloaderActivity.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ abstract class DownloaderActivity : AppCompatActivity() {
107107
.setTitle("Download data?")
108108

109109
if (provisionFolder.list()?.isNotEmpty() == true) {
110-
// folder exists, prompt user to download again
110+
// folder is not empty, prompt user to download again
111111
provisionQuestionDialog.setMessage(getString(R.string.already_provisioned))
112112
// if user taps "Re-download" data
113113
provisionQuestionDialog.setNeutralButton("Re-download data") { dialog, _ ->
@@ -272,4 +272,8 @@ abstract class DownloaderActivity : AppCompatActivity() {
272272
emit(LoadStatus.FailedToLoad(it))
273273
}
274274
}
275+
276+
fun downloadFolder(appName: String): String{
277+
return getExternalFilesDir(null)?.path.toString() + File.separator + appName
278+
}
275279
}

0 commit comments

Comments
 (0)