Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Commit

Permalink
Merge branch 'mapbox_release_5.3' into mappy_mergre_mapbox_5.2.1
Browse files Browse the repository at this point in the history
* mapbox_release_5.3: (25 commits)
  [android] - update changelog for 5.3.0
  [android] added map touch listeners api based on lists
  [android] Tweak TinySDF docs to better describe font-family behavior.
  Saving/restoring MyLocationViewSettings (mapbox#10746) (mapbox#10748)
  [android] Updated Spanish, Vietnamese translations
  Android SDK renaming (mapbox#10609)
  [android] - use default icon when compass icon fails to decode (mapbox#10694)
  [android] - remove startup flash from fragment, rework OnMapReady callback for multiple listeners (mapbox#10717)
  [android] Add Configuration hook for local ideograph font family and demo activity
  [android] Android implementation of local CJK glyph rendering  - Draws bold version of glyph if font stack contains string "bold"  - Not hooked up to global configuration yet
  [core] Hook LocalGlyphRasterizer "font family" configuration up to Renderer
  [core] Enable local glyph generation using TinySDF.  - Platform-specific LocalGlyphRasterizer is responsible for deciding which glyphs to rasterize locally and for implementing the rasterization.  - Default platform implementation doesn't locally generate any glyphs -> no behavior change  - Unit test uses StubLocalGlyphRasterizer, which returns a single fixed bitmap for all CJK glyphs  - Rename glyph_loader.test to glyph_manager.test
  [core] C++ port of TinySDF
  [ios, macos] Cleaned up base localization files
  [android] - update instrumented make target, move code style validation before building C++ code, replace code style checks with the wrapper code style check. (mapbox#10724)
  [android] - activate filesource when creating an offline region (mapbox#10718)
  [ios] update constraints when updating content inset
  [ios] Fix an Interface Builder crash for IBInspectable properties.
  [ios] Fix the content insets for the scale and compass view.
  Post camera listener invocations (mapbox#10690)
  ...

# Conflicts:
#	platform/android/MapboxGLAndroidSDK/gradle.properties
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/http/HTTPRequest.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java
#	platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java
  • Loading branch information
Tien TRAN-THUONG authored and Tien TRAN-THUONG committed Dec 26, 2017
2 parents 863f73b + c701030 commit bc3e16e
Show file tree
Hide file tree
Showing 75 changed files with 1,435 additions and 387 deletions.
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Building & Developing Mapbox GL Native from Source

**Just trying to use Mapbox GL Native? You don't need to read this stuff! We
provide [easy-to-install, prebuilt versions of the Mapbox SDKs for iOS and Android
that you can download instantly and get started with fast](https://www.mapbox.com/mobile/).**
provide [easy-to-install, prebuilt versions of the Mapbox Maps SDKs for iOS and Android
that you can download instantly and get started with fast](https://www.mapbox.com/install/).**

Still with us? These are the instructions you'll need to build Mapbox GL Native
from source on a variety of platforms and set up a development environment.
Expand Down
15 changes: 5 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -599,17 +599,17 @@ run-android-unit-test: platform/android/configuration.gradle
run-android-unit-test-%: platform/android/configuration.gradle
cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=none :MapboxGLAndroidSDK:testDebugUnitTest --tests "$*"

# Run Instrumentation tests on AWS device farm, requires additional authentication through gradle.properties
.PHONY: run-android-ui-test-aws
run-android-ui-test-aws: platform/android/configuration.gradle
cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=all devicefarmUpload

# Builds a release package of the Android SDK
.PHONY: apackage
apackage: platform/android/configuration.gradle
make android-lib-arm-v5 && make android-lib-arm-v7 && make android-lib-arm-v8 && make android-lib-x86 && make android-lib-x86-64 && make android-lib-mips
cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=all assemble$(BUILDTYPE)

# Build test app instrumentation tests apk and test app apk for all abi's
.PHONY: android-ui-test
android-ui-test: platform/android/configuration.gradle
cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis=all :MapboxGLAndroidSDKTestApp:assembleDebug :MapboxGLAndroidSDKTestApp:assembleAndroidTest

# Uploads the compiled Android SDK to Maven
.PHONY: run-android-upload-archives
run-android-upload-archives: platform/android/configuration.gradle
Expand All @@ -625,11 +625,6 @@ run-android-upload-archives-local: platform/android/configuration.gradle
android-gfxinfo:
adb shell dumpsys gfxinfo com.mapbox.mapboxsdk.testapp reset

# Runs Android UI tests on all connected devices using Spoon
.PHONY: run-android-ui-test-spoon
run-android-ui-test-spoon: platform/android/configuration.gradle
cd platform/android && $(MBGL_ANDROID_GRADLE) -Pmapbox.abis="$(MBGL_ANDROID_ACTIVE_ARCHS)" spoon

# Generates Activity sanity tests
.PHONY: test-code-android
test-code-android:
Expand Down
14 changes: 3 additions & 11 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ jobs:
- *generate-cache-key
- *restore-cache
- *reset-ccache-stats
- run:
name: Check code style
command: make android-check
- run:
name: Build libmapbox-gl.so for arm-v7
command: make android-lib-arm-v7
Expand All @@ -259,17 +262,6 @@ jobs:
- run:
name: Generate Espresso sanity tests
command: make test-code-android
- run:
name: Check Java code style
command: make android-checkstyle
- run:
name: Check Android modules for potential bugs (Lint SDK)
command: |
make android-lint-sdk
- run:
name: Check Android modules for potential bugs (Lint Test App)
command: |
make android-lint-test-app
- run:
name: Build Test APK
command: |
Expand Down
3 changes: 3 additions & 0 deletions cmake/core-files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ set(MBGL_CORE_FILES
src/mbgl/text/glyph_pbf.cpp
src/mbgl/text/glyph_pbf.hpp
src/mbgl/text/glyph_range.hpp
src/mbgl/text/local_glyph_rasterizer.hpp
src/mbgl/text/placement_config.hpp
src/mbgl/text/quads.cpp
src/mbgl/text/quads.hpp
Expand Down Expand Up @@ -613,6 +614,8 @@ set(MBGL_CORE_FILES
src/mbgl/util/tile_coordinate.hpp
src/mbgl/util/tile_cover.cpp
src/mbgl/util/tile_cover.hpp
src/mbgl/util/tiny_sdf.cpp
src/mbgl/util/tiny_sdf.hpp
src/mbgl/util/token.hpp
src/mbgl/util/url.cpp
src/mbgl/util/url.hpp
Expand Down
3 changes: 2 additions & 1 deletion include/mbgl/renderer/renderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class Renderer {
public:
Renderer(RendererBackend&, float pixelRatio_, FileSource&, Scheduler&,
GLContextMode = GLContextMode::Unique,
const optional<std::string> programCacheDir = {});
const optional<std::string> programCacheDir = {},
const optional<std::string> localFontFamily = {});
~Renderer();

void markContextLost();
Expand Down
20 changes: 16 additions & 4 deletions platform/android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
# Changelog for Mapbox Android SDK
# Changelog for the Mapbox Maps SDK for Android

Mapbox welcomes participation and contributions from everyone. If you'd like to do so please see the [`Contributing Guide`](https://github.com/mapbox/mapbox-gl-native/blob/master/CONTRIBUTING.md) first to get started.

## 5.3.0 - TBA

* TBA
## 5.3.0 - December 20, 2017
- Add support for TinySDF [#10706](https://github.com/mapbox/mapbox-gl-native/pull/10706)
- Save restore MyLocationViewSettings [#10746](https://github.com/mapbox/mapbox-gl-native/pull/10746)
- Post animation callback invocation [#10664](https://github.com/mapbox/mapbox-gl-native/pull/10664)
- Allow configuring Http logging [#10681](https://github.com/mapbox/mapbox-gl-native/pull/10681)
- Fix reverse scale gesture [#10688](https://github.com/mapbox/mapbox-gl-native/pull/10688)
- Update offline region metadata documentation [#10693](https://github.com/mapbox/mapbox-gl-native/pull/10693)
- Post camera listener invocation [#10690](https://github.com/mapbox/mapbox-gl-native/pull/10690)
- Activate filesource for offline region creation [#10718](https://github.com/mapbox/mapbox-gl-native/pull/10718)
- Update Spanish/Vietnamese translations [#10740](https://github.com/mapbox/mapbox-gl-native/pull/10740)
- Update instrumented make target [#10724](https://github.com/mapbox/mapbox-gl-native/pull/10724)
- Remove black flash on start for fragments [#10717](https://github.com/mapbox/mapbox-gl-native/pull/10717)
- CompassView decode crash [#10717](https://github.com/mapbox/mapbox-gl-native/pull/10717)
- Android SDK renaming [#10609](https://github.com/mapbox/mapbox-gl-native/pull/10609)
- Map touch listener based lists [#10749](https://github.com/mapbox/mapbox-gl-native/pull/10749)

## 5.2.1 - December 6, 2017
- Close race condition in RunLoop [#10537](https://github.com/mapbox/mapbox-gl-native/pull/10537)
Expand Down
2 changes: 1 addition & 1 deletion platform/android/MapboxGLAndroidSDK/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=mapbox
POM_DEVELOPER_NAME=Mapbox
POM_NAME=Mapbox Android SDK
POM_NAME=Mapbox Maps SDK for Android
POM_ARTIFACT_ID=mapbox-android-sdk-mappy
POM_PACKAGING=aar

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,6 @@ public boolean onPreDraw() {
//Mappy modif
boolean markerViewSortedModified = true;
private Collection<View> markerViewSortedCoolection;
private View.OnTouchListener mOnMarkerViewTouchListener = new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
mapboxMap.onMarkerViewTouch(motionEvent);
return false;
}
};


/**
* Creates an instance of MarkerViewManager.
Expand Down Expand Up @@ -578,8 +570,6 @@ private void invalidateViewMarkersInVisibleRegion() {
convertView = (View) adapter.getViewReusePool().acquire();
final View adaptedView = adapter.getView(marker, convertView, markerViewContainer);
if (adaptedView != null) {
//Mappy modif
adaptedView.setOnTouchListener(mOnMarkerViewTouchListener);
adaptedView.setRotationX(marker.getTilt());
adaptedView.setRotation(marker.getRotation());
adaptedView.setAlpha(marker.getAlpha());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,15 @@ public class MapboxConstants {
public static final String STATE_ATTRIBUTION_ENABLED = "mapbox_atrrEnabled";
public static final String STATE_LOCATION_CHANGE_ANIMATION_ENABLED = "mapbox_locationChangeAnimationEnabled";
public static final String STATE_USING_CUSTOM_LOCATION_SOURCE = "mapbox_usingCustomLocationSource";
public static final String STATE_LOCATION_VIEW_ENABLED = "mapbox_locViewEnabled";
public static final String STATE_LOCATION_VIEW_FOREGROUND_DRAWABLE = "mapbox_locViewForegroundDrawable";
public static final String STATE_LOCATION_VIEW_FOREGROUND_BEARING_DRAWABLE = "mapbox_locViewBearingDrawable";
public static final String STATE_LOCATION_VIEW_FOREGROUND_TINT_COLOR = "mapbox_locViewForegroundTintColor";
public static final String STATE_LOCATION_VIEW_BACKGROUND_DRAWABLE = "mapbox_locViewBackgroundDrawable";
public static final String STATE_LOCATION_VIEW_BACKGROUND_OFFSET = "mapbox_locViewBackgroundOffset";
public static final String STATE_LOCATION_VIEW_BACKGROUND_TINT_COLOR = "mapbox_locViewBackgroundTintColor";
public static final String STATE_LOCATION_VIEW_ACCURACY_ALPHA = "mapbox_locViewAccuracyAlpha";
public static final String STATE_LOCATION_VIEW_ACCURACY_TINT_COLOR = "mapbox_locViewAccuracyTintColor";
public static final String STATE_LOCATION_VIEW_ACCURACY_THRESHOLD = "mapbox_locViewAccuracyThreshold";
public static final String STATE_LOCATION_VIEW_PADDING = "mapbox_locViewPadding";
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@
class HTTPRequest implements Callback {

private static OkHttpClient mClient = new OkHttpClient.Builder().dispatcher(getDispatcher()).build();
private static boolean logEnabled = true;
private String USER_AGENT_STRING = null;

private static final int CONNECTION_ERROR = 0;
private static final int TEMPORARY_ERROR = 1;
private static final int PERMANENT_ERROR = 2;

//Mappy modifs
@Nullable
static HttpRequestHeaderProvider httpRequestHeaderProvider;

Expand Down Expand Up @@ -130,12 +132,15 @@ public void cancel() {

@Override
public void onResponse(Call call, Response response) throws IOException {
if (response.isSuccessful()) {
Timber.v("[HTTP] Request was successful (code = %s).", response.code());
} else {
// We don't want to call this unsuccessful because a 304 isn't really an error
String message = !TextUtils.isEmpty(response.message()) ? response.message() : "No additional information";
Timber.d("[HTTP] Request with response code = %s: %s", response.code(), message);

if (logEnabled) {
if (response.isSuccessful()) {
Timber.v("[HTTP] Request was successful (code = %s).", response.code());
} else {
// We don't want to call this unsuccessful because a 304 isn't really an error
String message = !TextUtils.isEmpty(response.message()) ? response.message() : "No additional information";
Timber.d("[HTTP] Request with response code = %s: %s", response.code(), message);
}
}

byte[] body;
Expand Down Expand Up @@ -179,13 +184,15 @@ private void onFailure(Exception e) {

String errorMessage = e.getMessage() != null ? e.getMessage() : "Error processing the request";

if (type == TEMPORARY_ERROR) {
Timber.d("Request failed due to a temporary error: %s", errorMessage);
} else if (type == CONNECTION_ERROR) {
Timber.i("Request failed due to a connection error: %s", errorMessage);
} else {
// PERMANENT_ERROR
Timber.w("Request failed due to a permanent error: %s", errorMessage);
if (logEnabled) {
if (type == TEMPORARY_ERROR) {
Timber.d("Request failed due to a temporary error: %s", errorMessage);
} else if (type == CONNECTION_ERROR) {
Timber.i("Request failed due to a connection error: %s", errorMessage);
} else {
// PERMANENT_ERROR
Timber.w("Request failed due to a permanent error: %s", errorMessage);
}
}

mLock.lock();
Expand Down Expand Up @@ -220,7 +227,12 @@ private String getApplicationIdentifier() {
}
}

//Mappy modifs
public interface HttpRequestHeaderProvider {
void addHeader(Request.Builder builder);
}

static void enableLog(boolean enabled) {
logEnabled = enabled;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.mapbox.mapboxsdk.http;

/**
* Utility class for setting HttpRequest configurations
*/
public class HttpRequestUtil {

/**
* Set the log state of HttpRequest.
* <p>
* This configuration will outlast the lifecycle of the Map.
* </p>
*
* @param enabled True will enable logging, false will disable
*/
public static void setLogEnabled(boolean enabled) {
HTTPRequest.enableLog(enabled);
}
}
Loading

0 comments on commit bc3e16e

Please sign in to comment.