diff options
author | Cameron Mace <cameron@mapbox.com> | 2016-09-02 14:48:49 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-02 14:48:49 -0400 |
commit | 6a39cf5aaece81c7a531b12321dd503004cc45b8 (patch) | |
tree | f5709d2bebc092092adcaca49fed8dd1b29f4913 /platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera | |
parent | 0c4e51adf8f92fd0d1b00635bdd6c8fe4d3a66b2 (diff) | |
download | qtlocation-mapboxgl-6a39cf5aaece81c7a531b12321dd503004cc45b8.tar.gz |
[android] Checkstyle fixes round 1 (#6234)
* removed last of hungarian notation from testapp and fixed other checkstyle issues
* added back MapboxMap for espresso
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera')
4 files changed, 49 insertions, 29 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraAnimationTypeActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraAnimationTypeActivity.java index 6494fff9f5..91f2a2d69b 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraAnimationTypeActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraAnimationTypeActivity.java @@ -95,13 +95,19 @@ public class CameraAnimationTypeActivity extends AppCompatActivity implements On @Override public void onCancel() { Log.i(TAG, "Duration onCancel Callback called."); - Toast.makeText(CameraAnimationTypeActivity.this, "Ease onCancel Callback called.", Toast.LENGTH_LONG).show(); + Toast.makeText( + CameraAnimationTypeActivity.this, + "Ease onCancel Callback called.", + Toast.LENGTH_LONG).show(); } @Override public void onFinish() { Log.i(TAG, "Duration onFinish Callback called."); - Toast.makeText(CameraAnimationTypeActivity.this, "Ease onFinish Callback called.", Toast.LENGTH_LONG).show(); + Toast.makeText( + CameraAnimationTypeActivity.this, + "Ease onFinish Callback called.", + Toast.LENGTH_LONG).show(); } }; @@ -126,13 +132,19 @@ public class CameraAnimationTypeActivity extends AppCompatActivity implements On @Override public void onCancel() { Log.i(TAG, "Duration onCancel Callback called."); - Toast.makeText(CameraAnimationTypeActivity.this, "Duration onCancel Callback called.", Toast.LENGTH_LONG).show(); + Toast.makeText( + CameraAnimationTypeActivity.this, + "Duration onCancel Callback called.", + Toast.LENGTH_LONG).show(); } @Override public void onFinish() { Log.i(TAG, "Duration onFinish Callback called."); - Toast.makeText(CameraAnimationTypeActivity.this, "Duration onFinish Callback called.", Toast.LENGTH_LONG).show(); + Toast.makeText( + CameraAnimationTypeActivity.this, + "Duration onFinish Callback called.", + Toast.LENGTH_LONG).show(); } }; diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraPositionActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraPositionActivity.java index 3f4763ba48..925244b4a4 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraPositionActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraPositionActivity.java @@ -62,17 +62,23 @@ public class CameraPositionActivity extends AppCompatActivity implements OnMapRe public void onClick(View v) { Context context = v.getContext(); final View dialogContent = LayoutInflater.from(context).inflate(R.layout.dialog_camera_position, null); - AlertDialog.Builder builder = new AlertDialog.Builder(context, com.mapbox.mapboxsdk.R.style.AttributionAlertDialogStyle); + AlertDialog.Builder builder = new AlertDialog.Builder( + context, com.mapbox.mapboxsdk.R.style.AttributionAlertDialogStyle); builder.setTitle(R.string.dialog_camera_position); builder.setView(onInflateDialogContent(dialogContent)); builder.setPositiveButton("Animate", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - double latitude = Double.parseDouble(((TextView) dialogContent.findViewById(R.id.value_lat)).getText().toString()); - double longitude = Double.parseDouble(((TextView) dialogContent.findViewById(R.id.value_lon)).getText().toString()); - double zoom = Double.parseDouble(((TextView) dialogContent.findViewById(R.id.value_zoom)).getText().toString()); - double bearing = Double.parseDouble(((TextView) dialogContent.findViewById(R.id.value_bearing)).getText().toString()); - double tilt = Double.parseDouble(((TextView) dialogContent.findViewById(R.id.value_tilt)).getText().toString()); + double latitude = Double.parseDouble( + ((TextView) dialogContent.findViewById(R.id.value_lat)).getText().toString()); + double longitude = Double.parseDouble( + ((TextView) dialogContent.findViewById(R.id.value_lon)).getText().toString()); + double zoom = Double.parseDouble( + ((TextView) dialogContent.findViewById(R.id.value_zoom)).getText().toString()); + double bearing = Double.parseDouble( + ((TextView) dialogContent.findViewById(R.id.value_bearing)).getText().toString()); + double tilt = Double.parseDouble( + ((TextView) dialogContent.findViewById(R.id.value_tilt)).getText().toString()); CameraPosition cameraPosition = new CameraPosition.Builder() .target(new LatLng(latitude, longitude)) @@ -136,7 +142,8 @@ public class CameraPositionActivity extends AppCompatActivity implements OnMapRe return view; } - private void linkTextView(View view, @IdRes int textViewRes, @IdRes int seekBarRes, ValueChangeListener listener, int defaultValue) { + private void linkTextView( + View view, @IdRes int textViewRes, @IdRes int seekBarRes, ValueChangeListener listener, int defaultValue) { final TextView value = (TextView) view.findViewById(textViewRes); SeekBar seekBar = (SeekBar) view.findViewById(seekBarRes); listener.setLinkedValueView(value); diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ManualZoomActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ManualZoomActivity.java index 477ef64e86..740efd5536 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ManualZoomActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ManualZoomActivity.java @@ -21,7 +21,7 @@ import com.mapbox.mapboxsdk.testapp.R; public class ManualZoomActivity extends AppCompatActivity { private MapboxMap mapboxMap; - private MapView mMapView; + private MapView mapView; @Override protected void onCreate(Bundle savedInstanceState) { @@ -37,10 +37,10 @@ public class ManualZoomActivity extends AppCompatActivity { actionBar.setDisplayShowHomeEnabled(true); } - mMapView = (MapView) findViewById(R.id.mapView); - mMapView.setStyleUrl(Style.SATELLITE); - mMapView.onCreate(savedInstanceState); - mMapView.getMapAsync(new OnMapReadyCallback() { + mapView = (MapView) findViewById(R.id.mapView); + mapView.setStyleUrl(Style.SATELLITE); + mapView.onCreate(savedInstanceState); + mapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(@NonNull final MapboxMap mapboxMap) { ManualZoomActivity.this.mapboxMap = mapboxMap; @@ -53,7 +53,6 @@ public class ManualZoomActivity extends AppCompatActivity { @Override public boolean onCreateOptionsMenu(Menu menu) { -// findViewById(R.id.) getMenuInflater().inflate(R.menu.menu_zoom, menu); return true; } @@ -83,7 +82,8 @@ public class ManualZoomActivity extends AppCompatActivity { case R.id.action_zoom_to_point: View view = getWindow().getDecorView(); - mapboxMap.animateCamera(CameraUpdateFactory.zoomBy(1, new Point(view.getMeasuredWidth() / 4, view.getMeasuredHeight() / 4))); + mapboxMap.animateCamera( + CameraUpdateFactory.zoomBy(1, new Point(view.getMeasuredWidth() / 4, view.getMeasuredHeight() / 4))); return true; default: @@ -94,30 +94,30 @@ public class ManualZoomActivity extends AppCompatActivity { @Override public void onResume() { super.onResume(); - mMapView.onResume(); + mapView.onResume(); } @Override public void onPause() { super.onPause(); - mMapView.onPause(); + mapView.onPause(); } @Override protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); - mMapView.onSaveInstanceState(outState); + mapView.onSaveInstanceState(outState); } @Override protected void onDestroy() { super.onDestroy(); - mMapView.onDestroy(); + mapView.onDestroy(); } @Override public void onLowMemory() { super.onLowMemory(); - mMapView.onLowMemory(); + mapView.onLowMemory(); } } diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ScrollByActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ScrollByActivity.java index 1154cccb6e..e3dc849ce0 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ScrollByActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/ScrollByActivity.java @@ -26,7 +26,8 @@ public class ScrollByActivity extends AppCompatActivity implements OnMapReadyCal private MapView mapView; private MapboxMap mapboxMap; - private SeekBar xBar, yBar; + private SeekBar xBar; + private SeekBar yBar; @Override protected void onCreate(Bundle savedInstanceState) { @@ -120,18 +121,18 @@ public class ScrollByActivity extends AppCompatActivity implements OnMapReadyCal private static class PixelBarChangeListener implements SeekBar.OnSeekBarChangeListener { @StringRes - private int mPrefixTextResource; - private TextView mValueView; + private int prefixTextResource; + private TextView valueView; public PixelBarChangeListener(@NonNull TextView textView, @StringRes int textRes) { - mValueView = textView; - mPrefixTextResource = textRes; + valueView = textView; + prefixTextResource = textRes; } @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { int value = progress * ScrollByActivity.MULTIPLIER_PER_PIXEL; - mValueView.setText(String.format(seekBar.getResources().getString(mPrefixTextResource), value)); + valueView.setText(String.format(seekBar.getResources().getString(prefixTextResource), value)); } @Override |