Example usage for android.util AttributeSet getAttributeFloatValue

List of usage examples for android.util AttributeSet getAttributeFloatValue

Introduction

In this page you can find the example usage for android.util AttributeSet getAttributeFloatValue.

Prototype

public float getAttributeFloatValue(String namespace, String attribute, float defaultValue);

Source Link

Document

Return the float value of 'attribute'.

Usage

From source file:com.ttxgps.zoom.GestureImageView.java

public GestureImageView(Context context, AttributeSet attrs) {
    super(context, attrs);

    String scaleType = attrs.getAttributeValue(GLOBAL_NS, "scaleType");

    if (scaleType == null || scaleType.trim().length() == 0) {
        setScaleType(ScaleType.CENTER_INSIDE);
    }//from  w  w  w  .j  av  a  2 s  .  c  o m

    setMinScale(attrs.getAttributeFloatValue(LOCAL_NS, "min-scale", minScale));
    setMaxScale(attrs.getAttributeFloatValue(LOCAL_NS, "max-scale", maxScale));
    setStrict(attrs.getAttributeBooleanValue(LOCAL_NS, "strict", strict));
    setRecycle(attrs.getAttributeBooleanValue(LOCAL_NS, "recycle", recycle));
    zoom = attrs.getAttributeBooleanValue(LOCAL_NS, "zoom", zoom);
    initImage(false);
}