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

Commit a7c8dd3

Browse files
100.12 (#913)
* add artifactory * remove progress indicator on failed trace, trace utility netowrk * 100.11.2 * update gradle or kotlin version * Browse OGC API feature service (#886) * add sample, screenshot and README * fix build.gradle * pull from v.next * small fixes * PR fixes * update gradle * update gradle to 6.7.1 * version updates * Update README.md * Trev8939/update locators (#892) * find address and find place done * update offline geocode * move samples back to kotlin extensions until workaround is found (#894) * move samples back to kotlin extensions until workaround is found * add missing copyright * unify arcgis vector tiled layer custom style naming * Shu11698/v.next fixes (#895) * Fixed Add stop and barriers text * ListView is visible, made some minor UI improvements Increased text size and centered layout for readability. Co-authored-by: Shubham Sharma <[email protected]> * Use defaultTraceConfiguration instead of traceConfiguration (#898) * use defaultTraceConfiguration instead of traceConfiguration * Update README.md * Removed artifact link (#900) * reanble buttons in trace utility network after error * Update build.gradle * New Sample: Query with CQL filters (#899) * working update with screenshots, READMEs and metadata updated (#904) * add intent flags and URI handling (#906) * Create save map no folder crash fix (#905) * check for no folder selected from server, is user has no folders * invert if * add option to save to no folder * Patches to CQL Filters (#909) * Open map url update (#910) * Fixed incorrect image file name (#911) * target 100.12 * New sample: setup-location-driven-geotriggers (#907) * working prototype * rename and add scrollview * Added garden section and POI interactions * Cleaning up code! * Attached dialog to listView * Create README.md * Comments and reformatting code * more comments and reformatting * Add files via upload * Update README.md * Create README.metadata.json * Update README.metadata.json * Added copyright * Update README.md * Layered mapview and reduced POIs size * Resolved PR comments * Image attachments are now retrieved on click. * Log statements for list items. Not fixed yet. * Fixed wrap_content issue. * Resolving comments * Revert to KotlinX * small fixes to metadata and readme to fix sample viewer Co-authored-by: trev8939 <[email protected]> * CQL Filters patch (#912) * Query with CQL sample progress * Added comments * Code cleanup * Added zoom using setViewpointGeometryAsync * Create README.md * Add files via upload * Create README.metadata.json * Delete QueryWithCQLFilters.png * Add files via upload * Update README.md * Update README.metadata.json * Changed package name * Update AndroidManifest.xml * Added copyright * Convert to viewbinding * Code cleanup * Update MainActivity.kt * Update README.metadata.json * Resolved PR comments * Removed unwanted line * Updated snipped directory name * Set alert dialog to show "Empty Query" option * Changed to "No Query" * Update MainActivity.kt * Delete query-with-cql-features.png * Add files via upload * Update README.md * Removed viewbinding * Update README.md Co-authored-by: Shubham Sharma <[email protected]> Co-authored-by: Shubham Sharma <[email protected]>
1 parent 8d7a5cd commit a7c8dd3

File tree

89 files changed

+2647
-179
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2647
-179
lines changed

java/add-graphics-renderer/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ Run the sample and view graphics for points, lines, and polygons, which are styl
2323

2424
## Relevant API
2525

26+
* CubicBezierSegment
27+
* EllipticArcSegment
2628
* Geometry
2729
* Graphic
2830
* GraphicsOverlay
31+
* MutablePart
32+
* PolygonBuilder
33+
* PolylineBuilder
2934
* SimpleFillSymbol
3035
* SimpleLineSymbol
3136
* SimpleMarkerSymbol
@@ -37,4 +42,4 @@ To set unique symbols across a number of graphics (e.g. showing graphics of indi
3742

3843
## Tags
3944

40-
display, graphics, marker, overlay, renderer, symbol
45+
arc, bezier, curve, display, graphics, marker, overlay, renderer, segment, symbol, true curve

java/add-graphics-renderer/README.metadata.json

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,43 @@
77
"add-graphics-renderer.png"
88
],
99
"keywords": [
10+
"arc",
11+
"bezier",
12+
"curve",
1013
"display",
1114
"graphics",
1215
"marker",
1316
"overlay",
1417
"renderer",
15-
"symbol"
18+
"segment",
19+
"symbol",
20+
"true curve",
21+
"CubicBezierSegment",
22+
"EllipticArcSegment",
23+
"Geometry",
24+
"Graphic",
25+
"GraphicsOverlay",
26+
"MutablePart",
27+
"PolygonBuilder",
28+
"PolylineBuilder",
29+
"SimpleFillSymbol",
30+
"SimpleLineSymbol",
31+
"SimpleMarkerSymbol",
32+
"SimpleRenderer"
1633
],
1734
"language": "java",
1835
"redirect_from": [
1936
"/android/latest/sample-code/add-graphics-renderer.htm"
2037
],
2138
"relevant_apis": [
39+
"CubicBezierSegment",
40+
"EllipticArcSegment",
2241
"Geometry",
2342
"Graphic",
2443
"GraphicsOverlay",
44+
"MutablePart",
45+
"PolygonBuilder",
46+
"PolylineBuilder",
2547
"SimpleFillSymbol",
2648
"SimpleLineSymbol",
2749
"SimpleMarkerSymbol",
-2.59 KB
Loading

java/add-graphics-renderer/src/main/java/com/esri/arcgisruntime/sample/addgraphicsrenderer/MainActivity.java

Lines changed: 110 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,17 @@
2020
import android.os.Bundle;
2121

2222
import androidx.appcompat.app.AppCompatActivity;
23+
2324
import com.esri.arcgisruntime.ArcGISRuntimeEnvironment;
25+
import com.esri.arcgisruntime.geometry.CubicBezierSegment;
26+
import com.esri.arcgisruntime.geometry.EllipticArcSegment;
27+
import com.esri.arcgisruntime.geometry.Geometry;
28+
import com.esri.arcgisruntime.geometry.Part;
2429
import com.esri.arcgisruntime.geometry.Point;
30+
import com.esri.arcgisruntime.geometry.Polygon;
2531
import com.esri.arcgisruntime.geometry.PolygonBuilder;
2632
import com.esri.arcgisruntime.geometry.PolylineBuilder;
33+
import com.esri.arcgisruntime.geometry.SpatialReference;
2734
import com.esri.arcgisruntime.geometry.SpatialReferences;
2835
import com.esri.arcgisruntime.mapping.ArcGISMap;
2936
import com.esri.arcgisruntime.mapping.BasemapStyle;
@@ -64,7 +71,8 @@ private void addGraphicsOverlay() {
6471
// point graphic
6572
Point pointGeometry = new Point(40e5, 40e5, SpatialReferences.getWebMercator());
6673
// red diamond point symbol
67-
SimpleMarkerSymbol pointSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.DIAMOND, Color.RED, 10);
74+
SimpleMarkerSymbol pointSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.Style.DIAMOND,
75+
Color.RED, 10);
6876
// create graphic for point
6977
Graphic pointGraphic = new Graphic(pointGeometry);
7078
// create a graphic overlay for the point
@@ -96,14 +104,15 @@ private void addGraphicsOverlay() {
96104
// add graphics overlay to the MapView
97105
mMapView.getGraphicsOverlays().add(lineGraphicOverlay);
98106

99-
//polygon graphic
107+
// polygon graphic
100108
PolygonBuilder polygonGeometry = new PolygonBuilder(SpatialReferences.getWebMercator());
101109
polygonGeometry.addPoint(-20e5, 20e5);
102110
polygonGeometry.addPoint(20e5, 20e5);
103111
polygonGeometry.addPoint(20e5, -20e5);
104112
polygonGeometry.addPoint(-20e5, -20e5);
105113
// solid yellow polygon symbol
106-
SimpleFillSymbol polygonSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, Color.YELLOW, null);
114+
SimpleFillSymbol polygonSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID,
115+
Color.YELLOW, null);
107116
// create graphic for polygon
108117
Graphic polygonGraphic = new Graphic(polygonGeometry.toGeometry());
109118
// create graphic overlay for polygon
@@ -117,6 +126,104 @@ private void addGraphicsOverlay() {
117126
// add graphics overlay to MapView
118127
mMapView.getGraphicsOverlays().add(polygonGraphicOverlay);
119128

129+
// curved polygon graphic
130+
// create a point for the center of the geometry
131+
Point originPoint = new Point(40e5, 5e5, SpatialReferences.getWebMercator());
132+
// create polygon
133+
Geometry curvedPolygonGeometry = makeHeartGeometry(originPoint, 10e5);
134+
// create graphic for polygon
135+
Graphic curvedPolygonGraphic = new Graphic(curvedPolygonGeometry);
136+
// create a simple fill symbol with outline
137+
SimpleLineSymbol curvedLineSymbol = new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID,
138+
Color.BLACK, 1f);
139+
SimpleFillSymbol curvedFillSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID,
140+
Color.RED, curvedLineSymbol);
141+
// create simple renderer
142+
SimpleRenderer curvedPolygonRenderer = new SimpleRenderer(curvedFillSymbol);
143+
144+
// create graphic overlay for polygon and add it to the map view
145+
GraphicsOverlay curvedPolygonGraphicsOverlay = new GraphicsOverlay();
146+
// add graphic to overlay
147+
curvedPolygonGraphicsOverlay.getGraphics().add(curvedPolygonGraphic);
148+
// set the renderer on the graphics overlay to the new renderer
149+
curvedPolygonGraphicsOverlay.setRenderer(curvedPolygonRenderer);
150+
// add graphics overlay to MapView
151+
mMapView.getGraphicsOverlays().add(curvedPolygonGraphicsOverlay);
152+
}
153+
154+
/**
155+
* Create a heart-shape geometry with Bezier and elliptic arc segments from a given point and
156+
* side length.
157+
*
158+
* @param center of the heart shape
159+
* @param sideLength of the heart shape
160+
*
161+
* @return a heart shaped {@link Geometry}
162+
*/
163+
private static Geometry makeHeartGeometry(Point center, double sideLength) {
164+
SpatialReference spatialReference = center.getSpatialReference();
165+
// the x and y coordinates to simplify the calculation
166+
double minX = center.getX() - 0.5 * sideLength;
167+
double minY = center.getY() - 0.5 * sideLength;
168+
// the radius of the arcs
169+
double arcRadius = sideLength * 0.25;
170+
171+
// bottom left curve
172+
Point leftCurveStart = new Point(center.getX(), minY, spatialReference);
173+
Point leftCurveEnd = new Point(minX, minY + 0.75 * sideLength, spatialReference);
174+
Point leftControlPoint1 = new Point(center.getX(), minY + 0.25 * sideLength, spatialReference);
175+
Point leftControlPoint2 = new Point(minX, center.getY(), spatialReference);
176+
CubicBezierSegment leftCurve = new CubicBezierSegment(
177+
leftCurveStart,
178+
leftControlPoint1,
179+
leftControlPoint2,
180+
leftCurveEnd,
181+
spatialReference
182+
);
183+
184+
// top left arc
185+
Point leftArcCenter =
186+
new Point(minX + 0.25 * sideLength, minY + 0.75 * sideLength, spatialReference);
187+
EllipticArcSegment leftArc = EllipticArcSegment.createCircularEllipticArc(
188+
leftArcCenter,
189+
arcRadius,
190+
Math.PI,
191+
-Math.PI,
192+
spatialReference
193+
);
194+
195+
// top right arc
196+
Point rightArcCenter =
197+
new Point(minX + 0.75 * sideLength, minY + 0.75 * sideLength, spatialReference);
198+
EllipticArcSegment rightArc = EllipticArcSegment.createCircularEllipticArc(
199+
rightArcCenter,
200+
arcRadius,
201+
Math.PI,
202+
-Math.PI,
203+
spatialReference
204+
);
205+
206+
// bottom right curve
207+
Point rightCurveStart = new Point(minX + sideLength, minY + 0.75 * sideLength,
208+
spatialReference);
209+
Point rightCurveEnd = leftCurveStart;
210+
Point rightControlPoint1 = new Point(minX + sideLength, center.getY(), spatialReference);
211+
Point rightControlPoint2 = leftControlPoint1;
212+
CubicBezierSegment rightCurve = new CubicBezierSegment(
213+
rightCurveStart,
214+
rightControlPoint1,
215+
rightControlPoint2,
216+
rightCurveEnd,
217+
spatialReference
218+
);
219+
220+
Part heart = new Part(spatialReference);
221+
heart.add(leftCurve);
222+
heart.add(leftArc);
223+
heart.add(rightArc);
224+
heart.add(rightCurve);
225+
226+
return new Polygon(heart, spatialReference);
120227
}
121228

122229
@Override
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
2-
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
3-
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
4-
android:paddingRight="@dimen/activity_horizontal_margin"
5-
android:paddingTop="@dimen/activity_vertical_margin"
6-
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
2+
xmlns:tools="http://schemas.android.com/tools"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
tools:context=".MainActivity">
76

8-
<!-- MapView -->
97
<com.esri.arcgisruntime.mapping.view.MapView
10-
android:id="@+id/mapView"
11-
android:layout_width="match_parent"
12-
android:layout_height="match_parent">
13-
</com.esri.arcgisruntime.mapping.view.MapView>
8+
android:id="@+id/mapView"
9+
android:layout_width="match_parent"
10+
android:layout_height="match_parent" />
1411

1512
</RelativeLayout>

java/add-graphics-renderer/src/main/res/values-w820dp/dimens.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

java/add-graphics-renderer/src/main/res/values/dimens.xml

Lines changed: 0 additions & 5 deletions
This file was deleted.

java/create-and-save-map/src/main/java/com/esri/arcgisruntime/sample/createandsavemap/MainActivity.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ private void showSaveMapDialog() {
241241
mPortalFolders = portalUserContent.getFolders();
242242
// get a list of the user's portal folder titles
243243
List<String> portalFolderTitles = new ArrayList<>();
244+
portalFolderTitles.add("No Folder");
244245
for (PortalFolder portalFolder : mPortalFolders) {
245246
portalFolderTitles.add(portalFolder.getTitle());
246247
}
@@ -271,9 +272,17 @@ private void showSaveMapDialog() {
271272
Iterable<String> tags = Arrays.asList(tagsEditText.getText().toString().split(","));
272273
// make sure the title edit text view has text
273274
if (titleEditText.getText().length() > 0) {
274-
// call save map passing in title, tags, description and portal
275-
saveMap(titleEditText.getText().toString(), tags, descriptionEditText.getText().toString(),
276-
mPortalFolders.get(mFolderSpinner.getSelectedItemPosition()));
275+
// check if a folder was selected
276+
if (mFolderSpinner.getSelectedItemPosition() <= 0) {
277+
// if no folder was selected, just pass null for portalFolder argument
278+
saveMap(titleEditText.getText().toString(), tags,
279+
descriptionEditText.getText().toString(), null);
280+
} else {
281+
// call save map passing in title, tags, description and portal
282+
saveMap(titleEditText.getText().toString(), tags,
283+
descriptionEditText.getText().toString(),
284+
mPortalFolders.get(mFolderSpinner.getSelectedItemPosition() - 1));
285+
}
277286
saveMapDialog.dismiss();
278287
} else {
279288
Toast.makeText(this, "A title is required to save your map.", Toast.LENGTH_LONG).show();
Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,42 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.esri.arcgisruntime.sample.editfeatureattachments">
3+
package="com.esri.arcgisruntime.sample.editfeatureattachments">
44

55
<uses-permission android:name="android.permission.INTERNET" />
66
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
77

88
<uses-feature
9-
android:glEsVersion="0x00020000"
10-
android:required="true" />
9+
android:glEsVersion="0x00020000"
10+
android:required="true" />
1111

1212
<application
13-
android:allowBackup="true"
14-
android:icon="@mipmap/ic_launcher"
15-
android:label="@string/app_name"
16-
android:supportsRtl="true"
17-
android:theme="@style/AppTheme">
13+
android:allowBackup="true"
14+
android:icon="@mipmap/ic_launcher"
15+
android:label="@string/app_name"
16+
android:supportsRtl="true"
17+
android:theme="@style/AppTheme">
18+
<provider
19+
android:name="androidx.core.content.FileProvider"
20+
android:authorities="${applicationId}.provider"
21+
android:exported="false"
22+
android:grantUriPermissions="true">
23+
<meta-data
24+
android:name="android.support.FILE_PROVIDER_PATHS"
25+
android:resource="@xml/provider_paths" />
26+
</provider>
27+
1828
<activity
19-
android:name=".MainActivity"
20-
android:label="@string/app_name">
29+
android:name=".MainActivity"
30+
android:label="@string/app_name">
2131
<intent-filter>
2232
<action android:name="android.intent.action.MAIN" />
2333

2434
<category android:name="android.intent.category.LAUNCHER" />
2535
</intent-filter>
2636
</activity>
2737
<activity
28-
android:name=".EditAttachmentActivity"
29-
android:label="@string/edit_attachments" />
38+
android:name=".EditAttachmentActivity"
39+
android:label="@string/edit_attachments" />
3040
</application>
3141

3242
</manifest>

java/edit-feature-attachments/src/main/java/com/esri/arcgisruntime/sample/editfeatureattachments/EditAttachmentActivity.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import androidx.appcompat.app.AlertDialog;
3232
import androidx.appcompat.app.AppCompatActivity;
33+
import androidx.core.content.FileProvider;
3334

3435
import com.esri.arcgisruntime.concurrent.ListenableFuture;
3536
import com.esri.arcgisruntime.data.ArcGISFeature;
@@ -158,8 +159,11 @@ private void fetchAttachmentAsync(final int position) {
158159
}
159160
// open the file in gallery
160161
Intent i = new Intent();
162+
i.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
161163
i.setAction(Intent.ACTION_VIEW);
162-
i.setDataAndType(Uri.fromFile(file), "image/png");
164+
Uri contentUri = FileProvider
165+
.getUriForFile(getApplicationContext(), getApplicationContext().getPackageName() + ".provider", file);
166+
i.setDataAndType(contentUri, "image/png");
163167
startActivity(i);
164168

165169
} catch (Exception e) {

0 commit comments

Comments
 (0)