use of org.appcelerator.titanium.proxy.TiViewProxy in project ti.map by tidev.
the class AnnotationProxy method release.
@Override
public void release() {
if (hasProperty(MapModule.PROPERTY_CUSTOM_VIEW)) {
TiViewProxy customView = (TiViewProxy) getProperty(MapModule.PROPERTY_CUSTOM_VIEW);
customView.release();
}
/*
if (markerOptions != null) {
markerOptions = null;
}
if (clusterMarker != null) {
clusterMarker = null;
}
if (infoWindow != null) {
infoWindow = null;
}
if (delegate != null) {
delegate = null;
}
*/
super.release();
}
use of org.appcelerator.titanium.proxy.TiViewProxy in project ti.map by tidev.
the class TiMapInfoWindow method setLeftOrRightPane.
public void setLeftOrRightPane(Object obj, int flag) {
TiCompositeLayout pane = null;
if (flag == LEFT_PANE) {
pane = leftPane;
} else if (flag == RIGHT_PANE) {
pane = rightPane;
} else {
Log.e(TAG, "Invalid valud for flag in setLeftOrRightPane", Log.DEBUG_MODE);
return;
}
pane.removeAllViews();
if (obj == null) {
pane.setVisibility(GONE);
return;
}
pane.setVisibility(VISIBLE);
if (obj instanceof String) {
ImageView imageview = new ImageView(getContext());
TiDrawableReference imageref = TiDrawableReference.fromUrl(TiApplication.getAppCurrentActivity(), proxy.resolveUrl(null, (String) obj));
Bitmap bitmap = imageref.getBitmap();
if (bitmap != null) {
imageview.setImageBitmap(bitmap);
pane.addView(imageview);
} else {
Log.w(TAG, "Unable to get the image from the left / right button: " + obj, Log.DEBUG_MODE);
}
} else if (obj instanceof TiViewProxy) {
TiUIView view = ((TiViewProxy) obj).getOrCreateView();
if (view != null) {
pane.addView(view.getNativeView());
} else {
Log.w(TAG, "Unable to get the view from the left / right view: " + obj, Log.DEBUG_MODE);
}
}
}
use of org.appcelerator.titanium.proxy.TiViewProxy in project ti.map by tidev.
the class AnnotationProxy method handleCustomView.
private void handleCustomView(Object obj) {
if (obj instanceof TiViewProxy) {
TiBlob imageBlob = ((TiViewProxy) obj).toImage();
Bitmap image = imageBlob.getImage();
if (image != null) {
markerOptions.icon(BitmapDescriptorFactory.fromBitmap(image));
setIconImageDimensions(image.getWidth(), image.getHeight());
}
return;
}
Log.w(TAG, "Unable to get the image from the custom view: " + obj);
setIconImageDimensions(-1, -1);
}
Aggregations