diff options
author | Brad Leege <bleege@gmail.com> | 2016-06-08 13:07:52 -0500 |
---|---|---|
committer | Ivo van Dongen <info@ivovandongen.nl> | 2016-06-17 19:54:27 +0200 |
commit | 2591147e25d6ed74f091bed97f57fb4591e7bde6 (patch) | |
tree | 373c3373ee2ef15e6a5798093e73f31544c3cb09 /platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model | |
parent | 11dd4afc5b271c4efb0e900320bdca4d137cd049 (diff) | |
download | qtlocation-mapboxgl-2591147e25d6ed74f091bed97f57fb4591e7bde6.tar.gz |
[android] Setting up LocationPickerActivity infrastructure
Fixes #5282
Diffstat (limited to 'platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model')
2 files changed, 90 insertions, 0 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/annotations/PulseMarkerView.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/annotations/PulseMarkerView.java new file mode 100644 index 0000000000..48867ea5eb --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/annotations/PulseMarkerView.java @@ -0,0 +1,11 @@ +package com.mapbox.mapboxsdk.testapp.model.annotations; + +import com.mapbox.mapboxsdk.annotations.BaseMarkerViewOptions; +import com.mapbox.mapboxsdk.annotations.MarkerView; + +public class PulseMarkerView extends MarkerView { + + public PulseMarkerView(BaseMarkerViewOptions baseMarkerViewOptions) { + super(baseMarkerViewOptions); + } +}
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/annotations/PulseMarkerViewOptions.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/annotations/PulseMarkerViewOptions.java new file mode 100644 index 0000000000..70ff6a22e2 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/model/annotations/PulseMarkerViewOptions.java @@ -0,0 +1,79 @@ +package com.mapbox.mapboxsdk.testapp.model.annotations; + +import android.graphics.Bitmap; +import android.os.Parcel; +import android.os.Parcelable; + +import com.mapbox.mapboxsdk.annotations.BaseMarkerViewOptions; +import com.mapbox.mapboxsdk.annotations.Icon; +import com.mapbox.mapboxsdk.annotations.IconFactory; +import com.mapbox.mapboxsdk.geometry.LatLng; + +public class PulseMarkerViewOptions extends BaseMarkerViewOptions<PulseMarkerView, PulseMarkerViewOptions> { + + public PulseMarkerViewOptions() { + } + + protected PulseMarkerViewOptions(Parcel in) { + position((LatLng) in.readParcelable(LatLng.class.getClassLoader())); + snippet(in.readString()); + title(in.readString()); + flat(in.readByte() != 0); + anchor(in.readFloat(), in.readFloat()); + selected = in.readByte() != 0; + rotation(in.readFloat()); + if (in.readByte() != 0) { + // this means we have an icon + String iconId = in.readString(); + Bitmap iconBitmap = in.readParcelable(Bitmap.class.getClassLoader()); + Icon icon = IconFactory.recreate(iconId, iconBitmap); + icon(icon); + } + } + + @Override + public PulseMarkerViewOptions getThis() { + return this; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(getPosition(), flags); + out.writeString(getSnippet()); + out.writeString(getTitle()); + out.writeByte((byte) (isFlat() ? 1 : 0)); + out.writeFloat(getAnchorU()); + out.writeFloat(getAnchorV()); + out.writeFloat(getInfoWindowAnchorU()); + out.writeFloat(getInfoWindowAnchorV()); + out.writeByte((byte) (selected ? 1 : 0)); + out.writeFloat(getRotation()); + Icon icon = getIcon(); + out.writeByte((byte) (icon != null ? 1 : 0)); + if (icon != null) { + out.writeString(getIcon().getId()); + out.writeParcelable(getIcon().getBitmap(), flags); + } + } + + @Override + public PulseMarkerView getMarker() { + return new PulseMarkerView(this); + } + + public static final Parcelable.Creator<CountryMarkerViewOptions> CREATOR + = new Parcelable.Creator<CountryMarkerViewOptions>() { + public CountryMarkerViewOptions createFromParcel(Parcel in) { + return new CountryMarkerViewOptions(in); + } + + public CountryMarkerViewOptions[] newArray(int size) { + return new CountryMarkerViewOptions[size]; + } + }; +}
\ No newline at end of file |