Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Update interface and implement addlayer functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin committed Mar 16, 2020
1 parent 543502c commit 2362f62
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 155 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -932,23 +932,23 @@ public Builder withBitmapImages(boolean sdf, @NonNull Pair<String, Bitmap>... va
return this;
}

String getUri() {
public String getUri() {
return styleUri;
}

String getJson() {
public String getJson() {
return styleJson;
}

List<Source> getSources() {
public List<Source> getSources() {
return sources;
}

List<LayerWrapper> getLayers() {
public List<LayerWrapper> getLayers() {
return layers;
}

List<ImageWrapper> getImages() {
public List<ImageWrapper> getImages() {
return images;
}

Expand All @@ -963,7 +963,7 @@ Style build(@NonNull NativeMap nativeMap) {
return new Style(this, nativeMap);
}

static class ImageWrapper {
public static class ImageWrapper {
Bitmap bitmap;
String id;
boolean sdf;
Expand All @@ -985,39 +985,55 @@ static ImageWrapper[] convertToImageArray(HashMap<String, Bitmap> bitmapHashMap,
}
}

class LayerWrapper {
public class LayerWrapper {
Layer layer;

LayerWrapper(Layer layer) {
this.layer = layer;
}

public Layer getLayer() {
return layer;
}
}

class LayerAboveWrapper extends LayerWrapper {
public class LayerAboveWrapper extends LayerWrapper {
String aboveLayer;

LayerAboveWrapper(Layer layer, String aboveLayer) {
super(layer);
this.aboveLayer = aboveLayer;
}

public String getAboveLayer() {
return aboveLayer;
}
}

class LayerBelowWrapper extends LayerWrapper {
public class LayerBelowWrapper extends LayerWrapper {
String belowLayer;

LayerBelowWrapper(Layer layer, String belowLayer) {
super(layer);
this.belowLayer = belowLayer;
}

public String getBelowLayer() {
return belowLayer;
}
}

class LayerAtWrapper extends LayerWrapper {
public class LayerAtWrapper extends LayerWrapper {
int index;

LayerAtWrapper(Layer layer, int index) {
super(layer);
this.index = index;
}

public int getIndex() {
return index;
}
}
}

Expand Down
Loading

0 comments on commit 2362f62

Please sign in to comment.