Skip to content

Commit 14da861

Browse files
jushgithub-actions[bot]
authored andcommitted
Gestures Android Follow-ups (internal-7163)
GitOrigin-RevId: 05edebae834000bdc4981483831bd6b8f76f01fb
1 parent 0d35644 commit 14da861

30 files changed

Lines changed: 220 additions & 715 deletions

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog for the Mapbox Gestures for Android
22

3-
## 0.9.2 - September 29, 2025
3+
## 0.9.2 - October 09, 2025
44
* Fix concurrent modification exception for detectors
55

66
## 0.9.1 - November 27, 2023

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
We welcome contributions to this gestures repository. If you're interested in helping develop the library, please follow these steps:
44

5-
- [Open a ticket](https://github.com/mapbox/mapbox-gestures-android/issues/new) to kick off a conversation, feel free to tag the `@mapbox/android` team. It's a good idea to explain your plans before you push any code to make sure no one else is working on something similar and to discuss the best approaches to tackle your particular idea.
5+
- [Open a ticket](https://github.com/mapbox/mapbox-gestures-android/issues/new) to kick off a conversation, feel free to tag the `@mapbox/maps-android` team. It's a good idea to explain your plans before you push any code to make sure no one else is working on something similar and to discuss the best approaches to tackle your particular idea.
66

77
- Create a new branch that will contain the code for your additions.
88

99
- Pull requests are gladly accepted. If there are any changes that developers should be aware of, please update the [change log](CHANGELOG.md)
1010

11-
- Mapbox uses checkstyle to enforce good Java code standards. Make sure to read the [Mapbox GL Native Wiki entry](https://github.com/mapbox/mapbox-gl-native/wiki/Setting-up-Mapbox-checkstyle) and setup. CI will fail if your PR contains any mistakes.
11+
- Mapbox uses checkstyle to enforce good Java code standards. CI will fail if your PR contains any mistakes.
1212

1313
# Code of conduct
1414
Everyone is invited to participate in Mapbox’s open source projects and public discussions: we want to create a welcoming and friendly environment. Harassment of participants or other unethical and unprofessional behavior will not be tolerated in our spaces. The [Contributor Covenant](http://contributor-covenant.org) applies to all projects under the Mapbox organization and we ask that you please read [the full text](http://contributor-covenant.org/version/1/2/0/).

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,13 @@ Then add the Mapbox Android Gestures library :
2929
```java
3030
// In the app build.gradle file
3131
dependencies {
32-
implementation 'com.mapbox.mapboxsdk:mapbox-android-gestures:0.8.0'
32+
implementation 'com.mapbox.mapboxsdk:mapbox-android-gestures:x.y.z'
3333
}
3434
```
3535

3636
#### Mapbox access tokens
3737

3838
To build test application you need to configure Mapbox access tokens as described at https://docs.mapbox.com/android/maps/guides/install/#configure-credentials.
39-
To build the project you need to specify SDK_REGISTRY_TOKEN as an environmental variable or a gradle property. It is a secret token used to access the SDK Registry (Mapbox Maven instance) during compile time, with a scope set to `DOWNLOADS:READ`.
4039
To run the specific Mapbox activity in this repo's test application, you need to include public token in the [app/src/main/res/values/developer-config.xml] resource file.
4140

4241
## Getting Help
@@ -45,6 +44,13 @@ To run the specific Mapbox activity in this repo's test application, you need to
4544
- **Have a bug to report?** [Open an issue](https://github.com/mapbox/mapbox-gestures-android/issues). If possible, include the version of Mapbox Core that you're using, a full log, and a project that shows the issue.
4645
- **Have a feature request?** [Open an issue](https://github.com/mapbox/mapbox-gestures-android/issues/new). Tell us what the feature should do and why you want the feature.
4746

47+
## Building
48+
49+
To build the library and the sample app you need to remove or adapt the following files to your environment:
50+
- [gradlew](./gradlew)
51+
- [gradlew.bat](./gradlew.bat)
52+
- [gradle/wrapper](./gradle/wrapper)
53+
4854
## Sample code
4955

5056
[This repo's test app](https://github.com/mapbox/mapbox-gestures-android/tree/master/app/src/main/java/com/mapbox/android/gestures/testapp) can also help you get started with the Gestures library.
@@ -56,6 +62,3 @@ We welcome feedback, translations, and code contributions! Please see [CONTRIBUT
5662
## Version
5763

5864
Noting here, that `0.x` versions series of `Mapbox Gestures for Android` is still in an experimental phase. Breaking changes can occur with every iteration.
59-
60-
61-

app/build.gradle

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

app/build.gradle.kts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
plugins {
2+
id("com.android.application")
3+
kotlin("android")
4+
}
5+
6+
android {
7+
compileSdk = libs.versions.compileSdk.get().toInt()
8+
namespace = "com.mapbox.android.gestures.testapp"
9+
10+
defaultConfig {
11+
minSdk = libs.versions.minSdk.get().toInt()
12+
//noinspection ExpiredTargetSdkVersion
13+
targetSdk = libs.versions.targetSdkVersion.get().toInt()
14+
versionCode = 1
15+
versionName = "0.1.0"
16+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
17+
}
18+
19+
compileOptions {
20+
sourceCompatibility = JavaVersion.VERSION_1_8
21+
targetCompatibility = JavaVersion.VERSION_1_8
22+
}
23+
24+
buildTypes {
25+
getByName("release") {
26+
isMinifyEnabled = false
27+
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
28+
}
29+
}
30+
}
31+
32+
dependencies {
33+
implementation(project(":library"))
34+
implementation(libs.androidx.appCompatV7)
35+
36+
testImplementation(libs.junit)
37+
testImplementation(libs.mockito)
38+
testImplementation(libs.robolectric)
39+
androidTestImplementation(libs.mockitoAndroid)
40+
androidTestImplementation(libs.androidx.junit)
41+
androidTestImplementation(libs.androidx.test.espresso.core)
42+
androidTestImplementation(libs.androidx.test.espresso.intents)
43+
}
44+
45+
apply(from = "${rootDir}/gradle/checkstyle.gradle")

app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools"
4-
package="com.mapbox.android.gestures.testapp">
3+
xmlns:tools="http://schemas.android.com/tools">
54

65
<uses-sdk tools:overrideLibrary="com.mapbox.maps,
76
com.mapbox.common.module.okhttp,
@@ -28,24 +27,23 @@
2827
"/>
2928

3029
<application
31-
android:name=".MyApplication"
3230
android:allowBackup="true"
3331
android:icon="@mipmap/ic_launcher"
3432
android:label="@string/app_name"
3533
android:roundIcon="@mipmap/ic_launcher_round"
3634
android:supportsRtl="true"
3735
android:theme="@style/AppTheme">
38-
<activity android:name=".TestActivity"></activity>
36+
<activity android:name=".TestActivity" android:exported="true"/>
3937
<activity
4038
android:name=".MainActivity"
41-
android:screenOrientation="portrait">
39+
android:screenOrientation="portrait"
40+
android:exported="true">
4241
<intent-filter>
4342
<action android:name="android.intent.action.MAIN" />
4443

4544
<category android:name="android.intent.category.LAUNCHER" />
4645
</intent-filter>
4746
</activity>
48-
<activity android:name=".MapboxActivity" />
4947
</application>
5048

5149
</manifest>

app/src/main/java/com/mapbox/android/gestures/testapp/MainActivity.java

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
package com.mapbox.android.gestures.testapp;
22

3-
import android.content.Intent;
43
import android.os.Bundle;
5-
import androidx.appcompat.app.AppCompatActivity;
6-
import androidx.annotation.NonNull;
74
import android.util.DisplayMetrics;
85
import android.view.Menu;
96
import android.view.MenuInflater;
@@ -13,11 +10,13 @@
1310
import android.view.ViewGroup;
1411
import android.widget.AdapterView;
1512
import android.widget.ArrayAdapter;
16-
import android.widget.Button;
1713
import android.widget.ImageView;
1814
import android.widget.SeekBar;
1915
import android.widget.Spinner;
2016

17+
import androidx.annotation.NonNull;
18+
import androidx.appcompat.app.AppCompatActivity;
19+
2120
import com.mapbox.android.gestures.AndroidGesturesManager;
2221
import com.mapbox.android.gestures.MoveGestureDetector;
2322
import com.mapbox.android.gestures.MultiFingerTapGestureDetector;
@@ -35,7 +34,6 @@
3534
public class MainActivity extends AppCompatActivity {
3635

3736
private ImageView icon;
38-
private Button mapboxButton;
3937
private Spinner mutuallyExclusiveSpinner;
4038
private SeekBar rotateThresholdProgress;
4139
private SeekBar scaleThresholdProgress;
@@ -134,16 +132,6 @@ public void onNothingSelected(AdapterView<?> parent) {
134132
}
135133
});
136134

137-
mapboxButton = (Button) findViewById(R.id.button_mapbox);
138-
mapboxButton.setOnClickListener(new View.OnClickListener() {
139-
@Override
140-
public void onClick(View v) {
141-
mapboxButton.setEnabled(false);
142-
Intent intent = new Intent(MainActivity.this, MapboxActivity.class);
143-
startActivity(intent);
144-
}
145-
});
146-
147135
rotateThresholdProgress = (SeekBar) findViewById(R.id.progress_threshold_rotate);
148136
rotateThresholdProgress.setProgress(
149137
(int) androidGesturesManager.getRotateGestureDetector().getAngleThreshold());
@@ -278,12 +266,6 @@ public void onMoveEnd(@NonNull MoveGestureDetector detector, float velocityX, fl
278266
}
279267
};
280268

281-
@Override
282-
protected void onStart() {
283-
super.onStart();
284-
mapboxButton.setEnabled(true);
285-
}
286-
287269
@Override
288270
public boolean onTouchEvent(MotionEvent event) {
289271
return androidGesturesManager.onTouchEvent(event) || super.onTouchEvent(event);

app/src/main/java/com/mapbox/android/gestures/testapp/MapboxActivity.java

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

app/src/main/java/com/mapbox/android/gestures/testapp/MyApplication.java

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

app/src/main/java/com/mapbox/android/gestures/testapp/Utils.java

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

0 commit comments

Comments
 (0)