Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flatten android file structure #3011

Merged
merged 1 commit into from
Aug 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion android/rctmgl/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion android/rctmgl/.npmignore

This file was deleted.

13 changes: 0 additions & 13 deletions android/rctmgl/.settings/org.eclipse.buildship.core.prefs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
package com.mapbox.rctmgl.components.styles.layers;
mfazekas marked this conversation as resolved.
Show resolved Hide resolved
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.ViewGroupManager;
import com.facebook.react.uimanager.annotations.ReactProp;
import java.util.ArrayList;
/**
* Created by dhee9000 on 6/8/2019
*/
public class RCTMGLHeatmapLayerManager extends ViewGroupManager<RCTMGLHeatmapLayer>{
public static final String REACT_CLASS = "RCTMGLHeatmapLayer";
@Override
public String getName() {
return REACT_CLASS;
}
@Override
protected RCTMGLHeatmapLayer createViewInstance(ThemedReactContext reactContext) {
return new RCTMGLHeatmapLayer(reactContext);
}
@ReactProp(name="id")
public void setId(RCTMGLHeatmapLayer layer, String id) {
layer.setID(id);
}
@ReactProp(name="sourceID")
public void setSourceID(RCTMGLHeatmapLayer layer, String sourceID) {
layer.setSourceID(sourceID);
}
@ReactProp(name="aboveLayerID")
public void setAboveLayerID(RCTMGLHeatmapLayer layer, String aboveLayerID) {
layer.setAboveLayerID(aboveLayerID);
}
@ReactProp(name="belowLayerID")
public void setBelowLayerID(RCTMGLHeatmapLayer layer, String belowLayerID) {
layer.setBelowLayerID(belowLayerID);
}
@ReactProp(name="layerIndex")
public void setLayerIndex(RCTMGLHeatmapLayer layer, int layerIndex){
layer.setLayerIndex(layerIndex);
}
@ReactProp(name="minZoomLevel")
public void setMinZoomLevel(RCTMGLHeatmapLayer layer, double minZoomLevel) {
layer.setMinZoomLevel(minZoomLevel);
}
@ReactProp(name="maxZoomLevel")
public void setMaxZoomLevel(RCTMGLHeatmapLayer layer, double maxZoomLevel) {
layer.setMaxZoomLevel(maxZoomLevel);
}
@ReactProp(name="reactStyle")
public void setReactStyle(RCTMGLHeatmapLayer layer, ReadableMap style) {
layer.setReactStyle(style);
}
@ReactProp(name="sourceLayerID")
public void setSourceLayerId(RCTMGLHeatmapLayer layer, String sourceLayerID) {
layer.setSourceLayerID(sourceLayerID);
}
@ReactProp(name="filter")
public void setFilter(RCTMGLHeatmapLayer layer, ReadableArray filterList) {
layer.setFilter(filterList);
}
}
package com.mapbox.rctmgl.components.styles.layers;

import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.uimanager.ThemedReactContext;
import com.facebook.react.uimanager.ViewGroupManager;
import com.facebook.react.uimanager.annotations.ReactProp;

import java.util.ArrayList;

/**
* Created by dhee9000 on 6/8/2019
*/

public class RCTMGLHeatmapLayerManager extends ViewGroupManager<RCTMGLHeatmapLayer>{
public static final String REACT_CLASS = "RCTMGLHeatmapLayer";

@Override
public String getName() {
return REACT_CLASS;
}

@Override
protected RCTMGLHeatmapLayer createViewInstance(ThemedReactContext reactContext) {
return new RCTMGLHeatmapLayer(reactContext);
}

@ReactProp(name="id")
public void setId(RCTMGLHeatmapLayer layer, String id) {
layer.setID(id);
}

@ReactProp(name="sourceID")
public void setSourceID(RCTMGLHeatmapLayer layer, String sourceID) {
layer.setSourceID(sourceID);
}

@ReactProp(name="aboveLayerID")
public void setAboveLayerID(RCTMGLHeatmapLayer layer, String aboveLayerID) {
layer.setAboveLayerID(aboveLayerID);
}

@ReactProp(name="belowLayerID")
public void setBelowLayerID(RCTMGLHeatmapLayer layer, String belowLayerID) {
layer.setBelowLayerID(belowLayerID);
}

@ReactProp(name="layerIndex")
public void setLayerIndex(RCTMGLHeatmapLayer layer, int layerIndex){
layer.setLayerIndex(layerIndex);
}

@ReactProp(name="minZoomLevel")
public void setMinZoomLevel(RCTMGLHeatmapLayer layer, double minZoomLevel) {
layer.setMinZoomLevel(minZoomLevel);
}

@ReactProp(name="maxZoomLevel")
public void setMaxZoomLevel(RCTMGLHeatmapLayer layer, double maxZoomLevel) {
layer.setMaxZoomLevel(maxZoomLevel);
}

@ReactProp(name="reactStyle")
public void setReactStyle(RCTMGLHeatmapLayer layer, ReadableMap style) {
layer.setReactStyle(style);
}

@ReactProp(name="sourceLayerID")
public void setSourceLayerId(RCTMGLHeatmapLayer layer, String sourceLayerID) {
layer.setSourceLayerID(sourceLayerID);
}

@ReactProp(name="filter")
public void setFilter(RCTMGLHeatmapLayer layer, ReadableArray filterList) {
layer.setFilter(filterList);
}
}
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
package com.mapbox.rctmgl.components;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.uimanager.events.Event;
import com.facebook.react.uimanager.events.RCTEventEmitter;
import javax.annotation.Nullable;
public class AbstractEvent extends Event<AbstractEvent> {
private String mEventName;
private final boolean mCanCoalesce;
private WritableMap mEvent;
public AbstractEvent(int viewId, String eventName, boolean canCoalesce, @Nullable WritableMap event) {
super(viewId);
mEventName = eventName;
mCanCoalesce = canCoalesce;
mEvent = event;
}
@Override
public String getEventName() {
return mEventName;
}
@Override
public void dispatch(RCTEventEmitter rctEventEmitter) {
rctEventEmitter.receiveEvent(getViewTag(), getEventName(), mEvent);
}
@Override
public boolean canCoalesce() {
return mCanCoalesce;
}
package com.mapbox.rctmgl.components;

import com.facebook.react.bridge.WritableMap;
import com.facebook.react.uimanager.events.Event;
import com.facebook.react.uimanager.events.RCTEventEmitter;

import javax.annotation.Nullable;

public class AbstractEvent extends Event<AbstractEvent> {
private String mEventName;
private final boolean mCanCoalesce;
private WritableMap mEvent;

public AbstractEvent(int viewId, String eventName, boolean canCoalesce, @Nullable WritableMap event) {
super(viewId);
mEventName = eventName;
mCanCoalesce = canCoalesce;
mEvent = event;
}

@Override
public String getEventName() {
return mEventName;
}

@Override
public void dispatch(RCTEventEmitter rctEventEmitter) {
rctEventEmitter.receiveEvent(getViewTag(), getEventName(), mEvent);
}

@Override
public boolean canCoalesce() {
return mCanCoalesce;
}
}
2 changes: 1 addition & 1 deletion example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
rootProject.name = 'RNMapboxGLExample'

include ':rctmgl'
project(':rctmgl').projectDir = new File(rootProject.projectDir, '../../android/rctmgl')
project(':rctmgl').projectDir = new File(rootProject.projectDir, '../../android')

apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"rnmapbox-maps.podspec",
"ios",
"android",
"react-native.config.js",
"setup-jest.js",
"!**/__tests__",
"!**/__fixtures__",
Expand Down
9 changes: 0 additions & 9 deletions react-native.config.js

This file was deleted.

10 changes: 1 addition & 9 deletions scripts/autogenerate.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,7 @@ function readIosVersion() {
}

function readAndroidVersion() {
const buildGradlePath = path.join(
__dirname,
'..',
'android',
'rctmgl',
'build.gradle',
);
const buildGradlePath = path.join(__dirname, '..', 'android', 'build.gradle');
const lines = fs.readFileSync(buildGradlePath, 'utf8').split('\n');
const mapboxGLLineRegex =
/^\s+implementation\s+'com.mapbox.mapboxsdk:mapbox-android-sdk:(\d+\.\d+\.\d+)'$/;
Expand Down Expand Up @@ -85,7 +79,6 @@ const ANDROID_OUTPUT_PATH = path.join(
__dirname,
...OUTPUT_PREFIX,
'android',
'rctmgl',
'src',
'main',
'java-mapboxgl',
Expand All @@ -101,7 +94,6 @@ const ANDROID_V10_OUTPUT_PATH = path.join(
__dirname,
...OUTPUT_PREFIX,
'android',
'rctmgl',
'src',
'main',
'java-v10',
Expand Down
Loading