Skip to content
This repository was archived by the owner on Jan 26, 2023. It is now read-only.

Commit 01a5da9

Browse files
TADraesekehud10837
andauthored
100.11 (#880)
* pull from master * Hud10837/surface placement (#832) * update java sample to new design * kotlinize * clean up * add readme and metadata details * add kotlin readme etc * Update kotlin/surface-placement/src/main/AndroidManifest.xml Co-Authored-By: TADraeseke <TADraeseke@users.noreply.github.com> * move apply block to multiple lines * make enum references all caps * remove rogue backtick * add metadata updater instructions for new files (#827) * Update build.gradle * Update build.gradle * add slider * finish rebase * tweak layout * reformat * add seekbar * update readmes and format * update metadata * add s * add s * update scereenshots * revert metadata updater change * Update kotlin/surface-placement/src/main/java/com/esri/arcgisruntime/sample/surfaceplacement/MainActivity.kt Co-authored-by: TADraeseke <TADraeseke@users.noreply.github.com> * move slider and add value text * move slider java and format * make slider background opaque * edit layout * update screenshots and java sample Co-authored-by: TADraeseke <TADraeseke@users.noreply.github.com> * fix metadata snippet generation (#840) * Hud10837/realistic lighting and shadows (#836) * create module * working sample * rearrange * update ui * add comments and clean * update ui and metadata * complete checklist * change category * change gradle version * change data * fix time zone * fix time zone format * version number * Update kotlin/realistic-lighting-and-shadows/README.metadata.json Co-authored-by: TADraeseke <tdraeseke@esri.com> * address pr comments * block touch events below frame layout * update data and basemap * make comments two lines Co-authored-by: TADraeseke <tdraeseke@esri.com> * add lifecycle overrides Co-authored-by: TADraeseke <tdraeseke@esri.com> * Trev8939/feature linked anno (#838) * initial commit * working with read only loudoun data * working prototype * rename and add readme and screenshot files * revert not sample files * add behaviour to select correct end of polyline and disallow selection of multisegment polylines * PR fixes * add fix for dot-qualified call with operator * add instructions that only straight polylines can be selected * further PR fixes * shorten toast length * update README * Hud10837/identify fixes (#839) * feature layer selection * feature layer show attributes * list related features * feature layer selection kotlin * address pr comments * reformat function call Co-authored-by: TADraeseke <tdraeseke@esri.com> * separate text view name Co-authored-by: TADraeseke <tdraeseke@esri.com> * address pr comments Co-authored-by: TADraeseke <tdraeseke@esri.com> * Hud10837/readme updates (#842) * animate images with image overlay * update readmes * Hud10837/layer view state (#841) * create module * simplify and implement new behavior * add readme * change ui * clean up and add screenshot * change data source * add comment * address pr comments * update readme and screenshot * add hide layer option * add error message and fix ui * format errors * update metadata * implement java sample * update java readme and metadata * change string resource names * address pr comments * address pr comments * separate map view name Co-authored-by: TADraeseke <tdraeseke@esri.com> * Fix strings * move airplane mode message Co-authored-by: TADraeseke <tdraeseke@esri.com> * minor fixes feature linked anno * hud10837/readme-changes-aug-4 (#845) * update readmes * update identify workflow readmes * Hud10837/group layer exclusive (#844) * almost working initial kotlin version * clean code and add comments * remove toast * clean code * add readme * add exclusive radio buttons to java sample * add metadata and copyright and reformat code * address pr comments kotlin * address pr comments java * fix settings gradle * Update settings.gradle * Update settings.gradle * update open scene portal item to netherlands scene * change open scene portal item to berlin scene * rename bottom_sheet.xml and other generic xml files (#848) * Hud10837/mosaic rule (#847) * initial implementation * implement spinner * failing to load * clean up and add metadata * Update kotlin/apply-mosaic-rule-rasters/src/main/java/com/esri/arcgisruntime/sample/applymosaicrulerasters/MainActivity.kt Co-authored-by: TADraeseke <tdraeseke@esri.com> * Update kotlin/apply-mosaic-rule-rasters/src/main/java/com/esri/arcgisruntime/sample/applymosaicrulerasters/MainActivity.kt Co-authored-by: TADraeseke <tdraeseke@esri.com> * remove ags * change data * Update kotlin/apply-mosaic-rule-rasters/README.md Co-authored-by: TADraeseke <tdraeseke@esri.com> * Update kotlin/apply-mosaic-rule-rasters/README.md Co-authored-by: TADraeseke <tdraeseke@esri.com> Co-authored-by: TADraeseke <tdraeseke@esri.com> * add try/catch to configure subnetwork trace add (#849) * make smaller barrier in route around barriers and give checkbox unique name in group layers (#851) * Hud10837/route tracker (#850) * buggy * add route tracker location data source to navigate route * add route tracker location data source * Update kotlin/navigate-route/src/main/java/com/esri/arcgisruntime/sample/navigateroute/MainActivity.kt Co-authored-by: TADraeseke <tdraeseke@esri.com> * Update kotlin/navigate-route/src/main/java/com/esri/arcgisruntime/sample/navigateroute/MainActivity.kt Co-authored-by: TADraeseke <tdraeseke@esri.com> * Update kotlin/navigate-route/README.md Co-authored-by: TADraeseke <tdraeseke@esri.com> * update java readme Co-authored-by: TADraeseke <tdraeseke@esri.com> * update sample to congressional districts (#852) * Trev8939/update dependency versions (#853) * set versions to 100.9 * rename mosaic rule * Update README.md * Update version.gradle * Update version.gradle * http to https Merging this to test in daily build * Hud10837/edit with branch versioning (#855) * initial veprototype almost working * debugging * working prototype * change method of getting createdversionname * the same but better * add comments and kdoc * add lifecycle overrides * separate edit location into its own button * clean up * remove redundant boolean * clear selection on cancel * remove redundant defaultversionname member * remove redundant currentversionname member * clean up dialog builders * fix typo * update metadata * update category * update edit with branch versioning * update edit with branch versioning (#858) Co-authored-by: trev8939 <tdraeseke@esri.com> * set version.gradle up U10 * give unique name and password * update integrated mesh layer screenshots * fix edit with branch versioning screenshot * Update README.metadata.json * Update README.metadata.json * Samples to new metered basemaps (#862) * up to and including display map * add comment and done up to feature layer selection * all kotlin samples to metered basemaps * up to and including display map * part way up to find service area * up to feature layer geodatabase * all new basemaps * fix viewpoint setter and update readmes * set initial viewpoint to map view setter * increment to 100.10 release * increment to 100.10 * target U11 daily builds * Update version.gradle * set v.next to toolkit daily * Update version.gradle * Trev8939/update samples with zip (#868) * fix provision info as per updates to sample viewer * revert version.gradle * version.gradle to build 3057 * Trev8939/show labels on layers in 3d (#870) * still need to fix viewbinding and label expression * wrong labels showing * add 3d labels sample and readme * remove old string values * remove old string values * update colors * PR fixes * README and README json fixes * fix script and add relevant api to keywords * Update README.metadata.json * update label definition to new constructor * update identify kml features with fix * version.gradle to last u11 daily * fixes for trace and isolation samples (#879) * Update MainActivity.kt * setup for U11 * update README and gradle files Co-authored-by: hud10837 <hud10837@esri.com> Co-authored-by: TADraeseke <TADraeseke@users.noreply.github.com> Co-authored-by: hud10837 <hmiears@esri.com>
1 parent 1a9492c commit 01a5da9

34 files changed

Lines changed: 954 additions & 407 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Overview
2-
ArcGIS Runtime API for Android v100.10.0 samples. The `master` branch of this repository contains sample app modules for the latest available version of the [ArcGIS Runtime API for Android](https://developers.arcgis.com/android/). Samples released under older versions can be found through the [git tags](https://github.com/Esri/arcgis-runtime-samples-android/tags). Please read our [wiki](https://github.com/Esri/arcgis-runtime-samples-android/wiki) for help with working with this repository.
2+
ArcGIS Runtime API for Android v100.11.0 samples. The `master` branch of this repository contains sample app modules for the latest available version of the [ArcGIS Runtime API for Android](https://developers.arcgis.com/android/). Samples released under older versions can be found through the [git tags](https://github.com/Esri/arcgis-runtime-samples-android/tags). Please read our [wiki](https://github.com/Esri/arcgis-runtime-samples-android/wiki) for help with working with this repository.
33

44
# Prerequisites
5-
* The samples are building with `compileSdkVersion 29`
5+
* The samples are building with `compileSdkVersion 30`
66
* [Android Studio](http://developer.android.com/sdk/index.html)
77
* [An ArcGIS Developers API key](https://developers.arcgis.com/android/get-started/#3-get-an-api-key)
88

java/identify-kml-features/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Note: There are several types of KML features. This sample only identifies featu
3535

3636
## About the data
3737

38-
This sample shows a forecast for significant weather within the U.S. Regions of severe thunderstorms, flooding, snowfall, and freezing rain are shown. Tap the features to see details.
38+
This sample shows a forecast for [significant weather within the U.S. Regions](https://www.wpc.ncep.noaa.gov/kml/kmlproducts.php#sigwx) of severe thunderstorms, flooding, snowfall, and freezing rain are shown.
3939

4040
## Additional information
4141

java/identify-kml-features/src/main/java/com/esri/arcgisruntime/sample/identifykmlfeatures/MainActivity.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
package com.esri.arcgisruntime.sample.identifykmlfeatures;
1818

19-
import java.util.concurrent.ExecutionException;
20-
2119
import android.os.Bundle;
2220
import android.text.Html;
2321
import android.util.Log;
@@ -26,6 +24,7 @@
2624
import android.widget.Toast;
2725

2826
import androidx.appcompat.app.AppCompatActivity;
27+
2928
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
3029
import com.esri.arcgisruntime.concurrent.ListenableFuture;
3130
import com.esri.arcgisruntime.geometry.Envelope;
@@ -41,6 +40,8 @@
4140
import com.esri.arcgisruntime.ogc.kml.KmlDataset;
4241
import com.esri.arcgisruntime.ogc.kml.KmlPlacemark;
4342

43+
import java.util.concurrent.ExecutionException;
44+
4445
public class MainActivity extends AppCompatActivity {
4546

4647
private static final String TAG = MainActivity.class.getSimpleName();
@@ -67,7 +68,7 @@ protected void onCreate(Bundle savedInstanceState) {
6768
SpatialReferences.getWebMercator()));
6869

6970
// create a KML dataset of weather forecasts
70-
KmlDataset forecastKmlDataset = new KmlDataset("https://www.wpc.ncep.noaa.gov/kml/noaa_chart/WPC_Day1_SigWx.kml");
71+
KmlDataset forecastKmlDataset = new KmlDataset("https://www.wpc.ncep.noaa.gov/kml/noaa_chart/WPC_Day1_SigWx_latest.kml");
7172

7273
// create a KML layer and add it as an operational layer
7374
KmlLayer forecastKmlLayer = new KmlLayer(forecastKmlDataset);
@@ -92,6 +93,11 @@ protected void onCreate(Bundle savedInstanceState) {
9293
if (geoElement instanceof KmlPlacemark) {
9394
// show a callout at the placemark with custom content using the placemark's "balloon content"
9495
KmlPlacemark placemark = (KmlPlacemark) geoElement;
96+
// Google Earth only displays the placemarks with description or extended data. To
97+
// match its behavior, add a description placeholder if the data source is empty
98+
if (placemark.getDescription().isEmpty()) {
99+
placemark.setDescription("Weather condition");
100+
}
95101
TextView calloutContent = new TextView(getApplicationContext());
96102
calloutContent.setText(Html.fromHtml(placemark.getBalloonContent()));
97103

kotlin/perform-valve-isolation-trace/src/main/java/com/esri/arcgisruntime/sample/performvalveisolationtrace/MainActivity.kt

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ import com.esri.arcgisruntime.mapping.Viewpoint
4040
import com.esri.arcgisruntime.mapping.view.DefaultMapViewOnTouchListener
4141
import com.esri.arcgisruntime.mapping.view.Graphic
4242
import com.esri.arcgisruntime.mapping.view.GraphicsOverlay
43+
import com.esri.arcgisruntime.security.AuthenticationChallengeHandler
44+
import com.esri.arcgisruntime.security.AuthenticationChallengeResponse
45+
import com.esri.arcgisruntime.security.AuthenticationManager
4346
import com.esri.arcgisruntime.security.UserCredential
4447
import com.esri.arcgisruntime.symbology.SimpleMarkerSymbol
4548
import com.esri.arcgisruntime.symbology.SimpleRenderer
@@ -84,10 +87,18 @@ class MainActivity : AppCompatActivity() {
8487
// location services
8588
ArcGISRuntimeEnvironment.setApiKey(BuildConfig.API_KEY)
8689

90+
// set user credentials to authenticate with the service
91+
// NOTE: a licensed user is required to perform utility network operations
92+
val userCredential = UserCredential("viewer01", "I68VGU^nMurF")
93+
8794
// load the utility network data from the feature service and create feature layers
88-
val distributionLineFeatureTable = ServiceFeatureTable(getString(R.string.distribution_line_url))
95+
val distributionLineFeatureTable = ServiceFeatureTable(getString(R.string.distribution_line_url)).apply {
96+
credential = userCredential
97+
}
8998
val distributionLineLayer = FeatureLayer(distributionLineFeatureTable)
90-
val deviceFeatureTable = ServiceFeatureTable(getString(R.string.device_url))
99+
val deviceFeatureTable = ServiceFeatureTable(getString(R.string.device_url)).apply {
100+
credential = userCredential
101+
}
91102
val deviceLayer = FeatureLayer(deviceFeatureTable)
92103

93104
// create a map with the utility network distribution line and device layers
@@ -96,7 +107,7 @@ class MainActivity : AppCompatActivity() {
96107
operationalLayers.addAll(listOf(distributionLineLayer, deviceLayer))
97108
// create and load the utility network
98109
addDoneLoadingListener {
99-
createUtilityNetwork()
110+
createUtilityNetwork(userCredential)
100111
}
101112
}
102113

@@ -134,12 +145,10 @@ class MainActivity : AppCompatActivity() {
134145
* Create and load a utility network from the string resource url and initialize a starting point
135146
* from it.
136147
*/
137-
private fun createUtilityNetwork() {
148+
private fun createUtilityNetwork(userCredential: UserCredential) {
138149
// create a utility network from the url and load it
139150
utilityNetwork = UtilityNetwork(getString(R.string.utility_network_url), mapView.map).apply {
140-
// set user credentials to authenticate with the service
141-
// NOTE: a licensed user is required to perform utility network operations
142-
credential = UserCredential("viewer01", "I68VGU^nMurF")
151+
credential = userCredential
143152
}
144153
utilityNetwork.loadAsync()
145154
utilityNetwork.addDoneLoadingListener {

kotlin/settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ include ':add-features-feature-service',
6969
':set-min-max-scale',
7070
':show-callout',
7171
':show-labels-on-layer',
72+
':show-labels-on-layer-in-3d',
7273
':surface-placement',
7374
':token-authentication',
7475
':trace-utility-network',
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Show labels on layer in 3D
2+
3+
Display custom labels in a 3D scene.
4+
5+
![Show labels on layer in 3D](show-labels-on-layer-3d.png)
6+
7+
## Use case
8+
9+
Labeling features is useful to visually display information or attributes on a scene. For example, city officials or maintenance crews may want to show installation dates of features of a gas network.
10+
11+
## How to use the sample
12+
13+
Pan and zoom to explore the scene. Notice the labels showing installation dates of features in the 3D gas network.
14+
15+
## How it works
16+
17+
1. Create an `ArcGISScene` from a `PortalItem`.
18+
2. Add the scene to an `SceneView` and load it.
19+
3. After loading is complete, obtain the `FeatureLayer` from one of the `GroupLayer`s in the scene's `operationalLayers`.
20+
4. Create an `TextSymbol` to use for displaying the label text.
21+
5. Create an `LabelDefinition` using an `ArcadeLabelExpression`.
22+
6. Add the definition to the feature layer's `labelDefinitions` array.
23+
7. Set the feature layer's `labelsEnabled` property to `true`.
24+
25+
## Relevant API
26+
27+
* ArcadeLabelExpression
28+
* ArcGISScene
29+
* FeatureLayer
30+
* LabelDefinition
31+
* SceneView
32+
* TextSymbol
33+
34+
## About the data
35+
36+
This sample shows a [New York City infrastructure](https://www.arcgis.com/home/item.html?id=850dfee7d30f4d9da0ebca34a533c169) scene hosted on ArcGIS Online.
37+
38+
## Tags
39+
40+
3D, arcade, attribute, buildings, label, model, scene, symbol, text, URL, visualization
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"category": "Visualization",
3+
"description": "Display custom labels in a 3D scene.",
4+
"formal_name": "ShowLabelsOnLayerIn3D",
5+
"ignore": false,
6+
"images": [
7+
"show-labels-on-layer-in-3d.png"
8+
],
9+
"keywords": [
10+
"3D",
11+
"URL",
12+
"arcade",
13+
"attribute",
14+
"buildings",
15+
"label",
16+
"model",
17+
"scene",
18+
"symbol",
19+
"text",
20+
"visualization",
21+
"ArcGISScene",
22+
"ArcadeLabelExpression",
23+
"FeatureLayer",
24+
"LabelDefinition",
25+
"SceneView",
26+
"TextSymbol"
27+
],
28+
"language": "kotlin",
29+
"relevant_apis": [
30+
"ArcGISScene",
31+
"ArcadeLabelExpression",
32+
"FeatureLayer",
33+
"LabelDefinition",
34+
"SceneView",
35+
"TextSymbol"
36+
],
37+
"snippets": [
38+
"src/main/java/com/esri/arcgisruntime/showlabelsonlayerin3d/MainActivity.kt"
39+
],
40+
"title": "Show labels on layer in 3D"
41+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apply plugin: 'com.android.application'
2+
apply plugin: 'kotlin-android'
3+
apply plugin: 'kotlin-android-extensions'
4+
5+
android {
6+
compileSdkVersion rootProject.ext.compileSdkVersion
7+
8+
defaultConfig {
9+
applicationId "com.esri.arcgisruntime.samples.showlabelsonlayerin3d"
10+
minSdkVersion rootProject.ext.minSdkVersion
11+
targetSdkVersion rootProject.ext.targetSdkVersion
12+
versionCode rootProject.ext.versionCode
13+
versionName rootProject.ext.versionName
14+
buildConfigField("String", "API_KEY", API_KEY)
15+
}
16+
17+
buildTypes {
18+
release {
19+
minifyEnabled false
20+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21+
}
22+
}
23+
}
24+
25+
dependencies {
26+
// arcgis-android & appcompat lib dependencies from rootProject build.gradle
27+
implementation "androidx.constraintlayout:constraintlayout:$constraintLayoutVersion"
28+
implementation "com.google.code.gson:gson:2.8.6"
29+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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

0 commit comments

Comments
 (0)