summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLangston Smith <langston.smith@mapbox.com>2019-08-13 07:58:51 -0700
committerGitHub <noreply@github.com>2019-08-13 07:58:51 -0700
commit1ffb417bdb86bfa290dd1984140e7d83ea6ce7fd (patch)
tree2d16b7a4b4de9e8289e3096cde79cd72e37190fc
parentb330375aebc6afecfa748924c5cc14328acb2f2d (diff)
downloadqtlocation-mapboxgl-1ffb417bdb86bfa290dd1984140e7d83ea6ce7fd.tar.gz
[android] Test app tweaks from 8.3.0-alpha.2 QA (#15360)
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DebugModeActivity.java15
-rw-r--r--platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_backstack_fragment.xml1
2 files changed, 11 insertions, 5 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DebugModeActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DebugModeActivity.java
index b34cdc6698..097ef316fe 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DebugModeActivity.java
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/DebugModeActivity.java
@@ -25,7 +25,6 @@ import com.mapbox.mapboxsdk.maps.Style;
import com.mapbox.mapboxsdk.style.layers.Layer;
import com.mapbox.mapboxsdk.style.layers.Property;
import com.mapbox.mapboxsdk.testapp.R;
-import com.mapbox.mapboxsdk.testapp.utils.IdleZoomListener;
import java.util.List;
import java.util.Locale;
@@ -41,9 +40,9 @@ public class DebugModeActivity extends AppCompatActivity implements OnMapReadyCa
private MapView mapView;
private MapboxMap mapboxMap;
+ private MapboxMap.OnCameraMoveListener cameraMoveListener;
private ActionBarDrawerToggle actionBarDrawerToggle;
private int currentStyleIndex;
- private IdleZoomListener idleZoomListener;
private boolean isReportFps = true;
private static final String[] STYLES = new String[] {
@@ -152,7 +151,13 @@ public class DebugModeActivity extends AppCompatActivity implements OnMapReadyCa
private void setupZoomView() {
final TextView textView = findViewById(R.id.textZoom);
- mapboxMap.addOnCameraIdleListener(idleZoomListener = new IdleZoomListener(mapboxMap, textView));
+ mapboxMap.addOnCameraMoveListener(cameraMoveListener = new MapboxMap.OnCameraMoveListener() {
+ @Override
+ public void onCameraMove() {
+ textView.setText(String.format(DebugModeActivity.this.getString(
+ R.string.debug_zoom), mapboxMap.getCameraPosition().zoom));
+ }
+ });
}
private void setupDebugChangeView() {
@@ -233,8 +238,8 @@ public class DebugModeActivity extends AppCompatActivity implements OnMapReadyCa
@Override
protected void onDestroy() {
super.onDestroy();
- if (mapboxMap != null && idleZoomListener != null) {
- mapboxMap.removeOnCameraIdleListener(idleZoomListener);
+ if (mapboxMap != null) {
+ mapboxMap.removeOnCameraMoveListener(cameraMoveListener);
}
mapView.onDestroy();
}
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_backstack_fragment.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_backstack_fragment.xml
index 10c11a9320..b2ba18872d 100644
--- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_backstack_fragment.xml
+++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_backstack_fragment.xml
@@ -9,6 +9,7 @@
<Button android:layout_width="match_parent"
android:layout_height="58dp"
+ android:layout_marginTop="64dp"
android:id="@+id/button"
android:contentDescription="btn_change_fragment"
android:text="Replace with empty fragment"/>