Skip to content

Commit 33433e0

Browse files
authored
Merge pull request #35 from ArcGIS/update-patches
Quality patches for v200
2 parents a634741 + 72c97e7 commit 33433e0

File tree

8 files changed

+38
-38
lines changed

8 files changed

+38
-38
lines changed

display-map-from-mobile-map-package/README.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,10 @@ When the sample opens, it will automatically display the map in the mobile map p
2424
* MapView
2525
* MobileMapPackage
2626

27-
## Offline data
28-
29-
The sample app will use the `sampleslib` to provision offline data automatically. Alternatively, load the offline data to the scoped storage of the sample app:
30-
31-
1. Download the data from [ArcGIS Online](https://www.arcgis.com/home/item.html?id=e1f3a7254cb845b09450f54937c16061).
32-
2. Open your command prompt and navigate to the folder where you extracted the contents of the data from step 1.
33-
3. Push the data into the scoped storage of the sample app:
34-
35-
```kotlin
36-
adb push Yellowstone.mmpk /Android/data/com.esri.arcgismaps.sample.displaymapfrommobilemappackage/files/Yellowstone.mmpk
37-
```
38-
3927
## About the data
4028

4129
This mobile map package shows points of interest within Yellowstone National Park. It is available for download [here on ArcGIS Online](https://arcgisruntime.maps.arcgis.com/home/item.html?id=e1f3a7254cb845b09450f54937c16061).
4230

4331
## Tags
4432

4533
mmpk, mobile map package, offline
46-

display-map-from-mobile-map-package/README.metadata.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
"MobileMapPackage"
1515
],
1616
"language": "kotlin",
17-
"provision_from": [
18-
"https://www.arcgis.com/home/item.html?id=e1f3a7254cb845b09450f54937c16061"
19-
],
20-
"provision_to": [
21-
"/Yellowstone.mmpk"
22-
],
2317
"redirect_from": [
2418
"/android/latest/sample-code/open-mobile-map-package.htm"
2519
],

display-map/README.metadata.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@
88
],
99
"keywords": [
1010
"basemap",
11-
"map"
11+
"map",
12+
"ArcGISMap",
13+
"BasemapStyle",
14+
"MapView"
1215
],
1316
"language": "kotlin",
17+
"redirect_from": [
18+
"/android/latest/sample-code/display-map.htm"
19+
],
1420
"relevant_apis": [
1521
"ArcGISMap",
1622
"BasemapStyle",

tools/NewModuleScript.jar

-191 Bytes
Binary file not shown.

tools/NewModuleScript/MainActivityTemplate.kt

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,37 +14,48 @@
1414
*
1515
*/
1616

17-
package com.esri.arcgisruntime.sample.displaymap
17+
package com.esri.arcgismaps.sample.displaymap
1818

1919
import android.os.Bundle
20+
import android.util.Log
21+
import android.view.View
2022
import androidx.appcompat.app.AppCompatActivity
2123
import androidx.databinding.DataBindingUtil
22-
import arcgisruntime.ApiKey
23-
import arcgisruntime.ArcGISRuntimeEnvironment
24-
import arcgisruntime.mapping.ArcGISMap
25-
import arcgisruntime.mapping.BasemapStyle
26-
import arcgisruntime.mapping.view.MapView
27-
import com.esri.arcgisruntime.sample.displaymap.databinding.ActivityMainBinding
24+
import com.arcgismaps.ApiKey
25+
import com.arcgismaps.ArcGISEnvironment
26+
import com.arcgismaps.mapping.ArcGISMap
27+
import com.arcgismaps.mapping.BasemapStyle
28+
import com.esri.arcgismaps.sample.displaymap.databinding.ActivityMainBinding
29+
import com.google.android.material.snackbar.Snackbar
2830

2931
class MainActivity : AppCompatActivity() {
3032

3133
private val TAG = MainActivity::class.java.simpleName
3234

35+
// set up data binding for the activity
36+
private val activityMainBinding: ActivityMainBinding by lazy {
37+
DataBindingUtil.setContentView(this, R.layout.activity_main)
38+
}
39+
40+
private val mapView by lazy {
41+
activityMainBinding.mapView
42+
}
43+
3344
override fun onCreate(savedInstanceState: Bundle?) {
3445
super.onCreate(savedInstanceState)
3546

3647
// authentication with an API key or named user is
3748
// required to access basemaps and other location services
38-
ArcGISRuntimeEnvironment.apiKey = ApiKey.create(BuildConfig.API_KEY)
39-
40-
// set up data binding for the activity
41-
val activityMainBinding: ActivityMainBinding =
42-
DataBindingUtil.setContentView(this, R.layout.activity_main)
43-
val mapView = activityMainBinding.mapView
49+
ArcGISEnvironment.apiKey = ApiKey.create(BuildConfig.API_KEY)
4450
lifecycle.addObserver(mapView)
4551

4652
// create and add a map with a navigation night basemap style
4753
val map = ArcGISMap(BasemapStyle.ArcGISNavigationNight)
4854
mapView.map = map
4955
}
56+
57+
private fun showError(message: String, view: View) {
58+
Log.e(TAG, message)
59+
Snackbar.make(view, message, Snackbar.LENGTH_SHORT).show()
60+
}
5061
}
Binary file not shown.

tools/NewModuleScript/src/main/java/ScriptMain.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private void run(){
6060
private void deleteUnwantedFiles() {
6161
File buildFolder = new File(samplesRepoPath + "/" + sampleWithHyphen + "/build");
6262
File displayMapKotlinFolder = new File(
63-
samplesRepoPath + "/" + sampleWithHyphen + "/src/main/java/com/esri/arcgisruntime/sample/displaymap");
63+
samplesRepoPath + "/" + sampleWithHyphen + "/src/main/java/com/esri/arcgismaps/sample/displaymap");
6464
File image = new File(samplesRepoPath + "/" + sampleWithHyphen + "/display-map.png");
6565
try {
6666
FileUtils.deleteDirectory(buildFolder);
@@ -91,7 +91,7 @@ private void createFilesAndFolders() {
9191
}
9292

9393
// Create the sample package directory in the source folder
94-
File packageDirectory = new File(samplesRepoPath + "/" + sampleWithHyphen + "/src/main/java/com/esri/arcgisruntime/sample/" + sampleWithoutSpaces);
94+
File packageDirectory = new File(samplesRepoPath + "/" + sampleWithHyphen + "/src/main/java/com/esri/arcgismaps/sample/" + sampleWithoutSpaces);
9595
if(!packageDirectory.exists()){
9696
packageDirectory.mkdirs();
9797
}else{
@@ -153,6 +153,8 @@ private void updateSampleContent() {
153153
try {
154154
String fileContent = FileUtils.readFileToString(file, StandardCharsets.UTF_8);
155155
fileContent = fileContent.replace("demos.displaymap", "sample." + sampleWithoutSpaces);
156+
fileContent = fileContent.replace("constraintLayoutVersion\"","constraintLayoutVersion\"\n" +
157+
" implementation \"com.google.android.material:material:$materialVersion\"");
156158
FileUtils.write(file,fileContent, StandardCharsets.UTF_8);
157159
} catch (IOException e) {
158160
e.printStackTrace();
@@ -195,7 +197,7 @@ private void updateSampleContent() {
195197
}
196198

197199
//Update MainActivity.kt
198-
file = new File(samplesRepoPath + "/" + sampleWithHyphen + "/src/main/java/com/esri/arcgisruntime/sample/"+sampleWithoutSpaces+"/MainActivity.kt");
200+
file = new File(samplesRepoPath + "/" + sampleWithHyphen + "/src/main/java/com/esri/arcgismaps/sample/"+sampleWithoutSpaces+"/MainActivity.kt");
199201
try {
200202
String fileContent = FileUtils.readFileToString(file, StandardCharsets.UTF_8);
201203
fileContent = fileContent.replace("Copyright 2017", "Copyright " + Calendar.getInstance().get(Calendar.YEAR));

version.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ ext {
33
compileSdkVersion = 33
44
minSdkVersion = 26
55
targetSdkVersion = 33
6-
versionCode = 10015000
7-
versionName = '100.15.0.0'
6+
versionCode = 2000000
7+
versionName = '200.0.0'
88
// library versions
99
kotlinVersion = '1.7.10'
1010
ktxLifecycle = '2.5.1'

0 commit comments

Comments
 (0)