Search in sources :

Example 1 with TiViewProxy

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();
}
Also used : TiViewProxy(org.appcelerator.titanium.proxy.TiViewProxy)

Example 2 with TiViewProxy

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);
        }
    }
}
Also used : TiViewProxy(org.appcelerator.titanium.proxy.TiViewProxy) Bitmap(android.graphics.Bitmap) TiUIView(org.appcelerator.titanium.view.TiUIView) ImageView(android.widget.ImageView) TiCompositeLayout(org.appcelerator.titanium.view.TiCompositeLayout) TiDrawableReference(org.appcelerator.titanium.view.TiDrawableReference)

Example 3 with TiViewProxy

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);
}
Also used : TiViewProxy(org.appcelerator.titanium.proxy.TiViewProxy) Bitmap(android.graphics.Bitmap) TiBlob(org.appcelerator.titanium.TiBlob)

Aggregations

TiViewProxy (org.appcelerator.titanium.proxy.TiViewProxy)3 Bitmap (android.graphics.Bitmap)2 ImageView (android.widget.ImageView)1 TiBlob (org.appcelerator.titanium.TiBlob)1 TiCompositeLayout (org.appcelerator.titanium.view.TiCompositeLayout)1 TiDrawableReference (org.appcelerator.titanium.view.TiDrawableReference)1 TiUIView (org.appcelerator.titanium.view.TiUIView)1