Skip to content

Commit 7014367

Browse files
author
pdavidc
committed
Merge remote-tracking branch 'remotes/origin/release/0.2.5'
2 parents 61b6afb + d164f1b commit 7014367

File tree

91 files changed

+3568
-978
lines changed

Some content is hidden

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

91 files changed

+3568
-978
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,26 @@ use to represent information on the globe or in space.
1616
- [World Wind Forum](http://forum.worldwindcentral.com) provides help from the World Wind community
1717
- [Android Studio](http://developer.android.com/sdk/) is used for World Wind Android development
1818

19+
# Release 0.2.5, May 31, 2016
20+
21+
World Wind Android v0.2.5 provides support for 'picking', a feature that enables applications to determine the World
22+
Wind objects displayed at a screen point. This capability is accessible via the method [WorldWindow.pick](http://worldwindserver.net/android/0.2.5/doc/gov/nasa/worldwind/WorldWindow.html#pick-float-float-).
23+
Along with the core capability, two examples demonstrate how developers can use picking in their own apps:
24+
PlacemarksPickingActivity and PlacemarksSelectDragActivity.
25+
26+
- [World Wind Examples 0.2.5](http://worldwindserver.net/android/0.2.5/worldwind-examples.apk) - Example App for 0.2.5; runs on Android 4.4 and newer
27+
- [World Wind Library 0.2.5](http://worldwindserver.net/android/0.2.5/worldwind.aar) - Android Archive (AAR) for 0.2.5
28+
- [API Docs 0.2.5](http://worldwindserver.net/android/0.2.5/doc) - Developer documentation for 0.2.5
29+
- [JIRA 0.2.5](http://issues.worldwind.arc.nasa.gov/jira/browse/WWA/fixforversion/10916) - Detailed release notes for 0.2.5
30+
31+
#### Release Notes
32+
33+
###### Requirement
34+
- [WWA-16](http://issues.worldwind.arc.nasa.gov/jira/browse/WWA-16) - Picking
35+
36+
###### Bug
37+
- [WWA-76](http://issues.worldwind.arc.nasa.gov/jira/browse/WWA-76) - Blank screen when EGL context lost
38+
1939
# Release 0.2.0, May 13, 2016
2040

2141
World Wind Android v0.2.0 adds support for screen placemarks and navigation events. The World Wind Android v0.2.0

worldwind-examples/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId 'gov.nasa.worldwindx.examples'
88
minSdkVersion 16
99
targetSdkVersion 23
10-
versionCode 20
11-
versionName '0.2.0'
10+
versionCode 25
11+
versionName '0.2.5'
1212
}
1313
buildTypes {
1414
release {

worldwind-examples/src/main/AndroidManifest.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,18 @@
8282
android:launchMode="singleInstance"
8383
android:theme="@style/AppTheme.NoActionBar">
8484
</activity>
85+
<activity
86+
android:name=".PlacemarksPickingActivity"
87+
android:label="@string/title_placemarks_picking"
88+
android:launchMode="singleInstance"
89+
android:theme="@style/AppTheme.NoActionBar">
90+
</activity>
91+
<activity
92+
android:name=".PlacemarksSelectDragActivity"
93+
android:label="@string/title_placemarks_select_drag"
94+
android:launchMode="singleInstance"
95+
android:theme="@style/AppTheme.NoActionBar">
96+
</activity>
8597
<activity
8698
android:name=".PlacemarksStressTestActivity"
8799
android:label="@string/title_placemarks_stress_test"

worldwind-examples/src/main/java/gov/nasa/worldwindx/AbstractMainActivity.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
import android.content.Intent;
1111
import android.content.res.Configuration;
1212
import android.os.Bundle;
13-
import android.os.Handler;
14-
import android.os.Message;
1513
import android.support.annotation.LayoutRes;
1614
import android.support.design.widget.NavigationView;
1715
import android.support.v4.view.GravityCompat;
@@ -21,10 +19,8 @@
2119
import android.support.v7.widget.Toolbar;
2220
import android.view.Menu;
2321
import android.view.MenuItem;
24-
import android.widget.TextView;
2522

2623
import gov.nasa.worldwind.WorldWindow;
27-
import gov.nasa.worldwind.geom.LookAt;
2824

2925
/**
3026
* This abstract Activity class implements a Navigation Drawer menu shared by all the World Wind Example activities.
@@ -213,6 +209,12 @@ public boolean onNavigationItemSelected(MenuItem item) {
213209
case R.id.nav_placemarks_milstd2525_stress_activity:
214210
startActivity(new Intent(getApplicationContext(), PlacemarksMilStd2525StressActivity.class));
215211
break;
212+
case R.id.nav_placemarks_picking_activity:
213+
startActivity(new Intent(getApplicationContext(), PlacemarksPickingActivity.class));
214+
break;
215+
case R.id.nav_placemarks_select_drag_activity:
216+
startActivity(new Intent(getApplicationContext(), PlacemarksSelectDragActivity.class));
217+
break;
216218
case R.id.nav_placemarks_stress_activity:
217219
startActivity(new Intent(getApplicationContext(), PlacemarksStressTestActivity.class));
218220
break;

worldwind-examples/src/main/java/gov/nasa/worldwindx/BasicPerformanceBenchmarkActivity.java

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010
import android.os.Looper;
1111
import android.support.annotation.NonNull;
1212
import android.support.v4.util.Pools;
13+
import android.view.MotionEvent;
1314

1415
import java.io.BufferedReader;
1516
import java.io.IOException;
1617
import java.io.InputStream;
1718
import java.io.InputStreamReader;
1819
import java.util.concurrent.Executor;
20+
import java.util.concurrent.ExecutorService;
1921
import java.util.concurrent.Executors;
2022

2123
import gov.nasa.worldwind.WorldWind;
@@ -45,6 +47,11 @@ public WorldWindow getWorldWindow() {
4547
@Override
4648
public void setWorldWindow(WorldWindow wwd) {
4749
}
50+
51+
@Override
52+
public boolean onTouchEvent(MotionEvent event) {
53+
return false;
54+
}
4855
}
4956

5057
public static class AnimateCameraCommand implements Runnable {
@@ -187,11 +194,12 @@ public void run() {
187194

188195
protected static final int FRAME_INTERVAL = 67; // 67 millis; 15 frames per second
189196

190-
protected static Executor commandExecutor = Executors.newSingleThreadExecutor();
191-
192197
protected static Handler activityHandler = new Handler(Looper.getMainLooper());
193198

194-
public static Executor getCommandExecutor() {
199+
protected static ExecutorService commandExecutor;
200+
201+
public static ExecutorService getNewCommandExecutor() {
202+
commandExecutor = Executors.newSingleThreadExecutor();
195203
return commandExecutor;
196204
}
197205

@@ -222,14 +230,19 @@ protected void onCreate(Bundle savedInstanceState) {
222230

223231
// Add a layer containing a large number of placemarks.
224232
this.getWorldWindow().getLayers().addLayer(this.createPlacemarksLayer());
233+
}
234+
235+
@Override
236+
protected void onStart() {
237+
super.onStart();
225238

226239
// Create location objects for the places used in this test.
227240
Location arc = new Location(37.415229, -122.06265);
228241
Location gsfc = new Location(38.996944, -76.848333);
229242
Location esrin = new Location(41.826947, 12.674122);
230243

231244
// After a 1 second initial delay, clear the frame statistics associated with this test.
232-
Executor exec = getCommandExecutor();
245+
Executor exec = getNewCommandExecutor(); // gets a new instance
233246
exec.execute(new SleepCommand(1000));
234247
exec.execute(new ClearFrameMetricsCommand(wwd));
235248

@@ -276,6 +289,13 @@ protected void onCreate(Bundle savedInstanceState) {
276289
exec.execute(new LogFrameMetricsCommand(wwd));
277290
}
278291

292+
@Override
293+
protected void onStop() {
294+
super.onStop();
295+
commandExecutor.shutdownNow();
296+
}
297+
298+
279299
protected Layer createPlacemarksLayer() {
280300

281301
RenderableLayer layer = new RenderableLayer("Placemarks");
@@ -306,4 +326,5 @@ protected Layer createPlacemarksLayer() {
306326

307327
return layer;
308328
}
329+
309330
}

worldwind-examples/src/main/java/gov/nasa/worldwindx/BasicStressTestActivity.java

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
package gov.nasa.worldwindx;
77

88
import android.os.Bundle;
9-
import android.os.Handler;
9+
import android.view.Choreographer;
1010

1111
import gov.nasa.worldwind.Navigator;
1212

13-
public class BasicStressTestActivity extends BasicGlobeActivity implements Runnable {
13+
public class BasicStressTestActivity extends BasicGlobeActivity implements Choreographer.FrameCallback {
1414

15-
protected Handler animationHandler = new Handler();
15+
protected double cameraDegreesPerSecond = 0.1;
1616

17-
protected boolean pauseHandler;
17+
protected boolean activityPaused;
18+
19+
protected long lastFrameTimeNanos;
1820

1921
@Override
2022
protected void onCreate(Bundle savedInstanceState) {
@@ -28,36 +30,46 @@ protected void onCreate(Bundle savedInstanceState) {
2830
navigator.setHeading(90); // looking east
2931
navigator.setTilt(75); // looking at the horizon
3032

31-
// Set up an Android Handler to animate the navigator.
32-
this.animationHandler.postDelayed(this, 500);
33+
// Use this Activity's Choreographer to animate the Navigator.
34+
Choreographer.getInstance().postFrameCallback(this);
3335
}
3436

3537
@Override
36-
public void run() {
37-
// Move the navigator to continuously bring new tiles into view.
38-
Navigator navigator = getWorldWindow().getNavigator();
39-
navigator.setLongitude(navigator.getLongitude() + 1.0e-4);
38+
public void doFrame(long frameTimeNanos) {
39+
if (this.lastFrameTimeNanos != 0) {
40+
// Compute the frame duration in seconds.
41+
double frameDurationSeconds = (frameTimeNanos - this.lastFrameTimeNanos) * 1.0e-9;
42+
double cameraDegrees = (frameDurationSeconds * this.cameraDegreesPerSecond);
43+
44+
// Move the navigator to continuously bring new tiles into view.
45+
Navigator navigator = getWorldWindow().getNavigator();
46+
navigator.setLongitude(navigator.getLongitude() + cameraDegrees);
4047

41-
// Redraw the World Window to display the above changes.
42-
this.getWorldWindow().requestRedraw();
48+
// Redraw the World Window to display the above changes.
49+
this.getWorldWindow().requestRedraw();
50+
}
4351

44-
if (!this.pauseHandler) { // stop running when this activity is paused; the Handler is resumed in onResume
45-
this.animationHandler.postDelayed(this, 30);
52+
if (!this.activityPaused) { // stop animating when this Activity is paused
53+
Choreographer.getInstance().postFrameCallback(this);
4654
}
55+
56+
this.lastFrameTimeNanos = frameTimeNanos;
4757
}
4858

4959
@Override
5060
protected void onPause() {
5161
super.onPause();
52-
// Stop running the Handler when this activity is paused.
53-
this.pauseHandler = true;
62+
// Stop running the animation when this activity is paused.
63+
this.activityPaused = true;
64+
this.lastFrameTimeNanos = 0;
5465
}
5566

5667
@Override
5768
protected void onResume() {
5869
super.onResume();
59-
// Resume the Handler that animates the navigator.
60-
this.pauseHandler = false;
61-
this.animationHandler.postDelayed(this, 500);
70+
// Resume the Navigator animation.
71+
this.activityPaused = false;
72+
this.lastFrameTimeNanos = 0;
73+
Choreographer.getInstance().postFrameCallback(this);
6274
}
6375
}

worldwind-examples/src/main/java/gov/nasa/worldwindx/DayNightCycleActivity.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class DayNightCycleActivity extends BasicGlobeActivity implements Choreog
2323

2424
protected double lightDegreesPerSecond = 6.0;
2525

26-
protected boolean paused;
26+
protected boolean activityPaused;
2727

2828
protected long lastFrameTimeNanos;
2929

@@ -69,7 +69,7 @@ public void doFrame(long frameTimeNanos) {
6969
this.getWorldWindow().requestRedraw();
7070
}
7171

72-
if (!this.paused) { // stop animating when this Activity is paused
72+
if (!this.activityPaused) { // stop animating when this Activity is paused
7373
Choreographer.getInstance().postFrameCallback(this);
7474
}
7575

@@ -80,15 +80,15 @@ public void doFrame(long frameTimeNanos) {
8080
protected void onPause() {
8181
super.onPause();
8282
// Stop running the animation when this activity is paused.
83-
this.paused = true;
83+
this.activityPaused = true;
8484
this.lastFrameTimeNanos = 0;
8585
}
8686

8787
@Override
8888
protected void onResume() {
8989
super.onResume();
9090
// Resume the day-night cycle animation.
91-
this.paused = false;
91+
this.activityPaused = false;
9292
this.lastFrameTimeNanos = 0;
9393
Choreographer.getInstance().postFrameCallback(this);
9494
}

0 commit comments

Comments
 (0)