Java Code Examples for android.util.AttributeSet#getAttributeFloatValue()
The following examples show how to use
android.util.AttributeSet#getAttributeFloatValue() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SeekBarPreference.java From CSipSimple with GNU General Public License v3.0 | 5 votes |
public SeekBarPreference(Context aContext, AttributeSet attrs) { super(aContext, attrs); context = aContext; dialogMessage = attrs.getAttributeValue(ANDROID_NS, "dialogMessage"); suffix = attrs.getAttributeValue(ANDROID_NS, "text"); defaultValue = attrs.getAttributeFloatValue(ANDROID_NS, "defaultValue", 0.0f); max = attrs.getAttributeIntValue(ANDROID_NS, "max", 10); }
Example 2
Source File: RippleView.java From XERUNG with Apache License 2.0 | 5 votes |
protected void setRippleAttributes(AttributeSet attrs) { /** * 初始化按压时涟漪的颜色 * Set Ripple Color * Color by resource */ int color = attrs.getAttributeResourceValue(MATERIALDESIGNXML,"rippleColor",-1); if(color != -1){ rippleColor = getResources().getColor(color); settedRippleColor = true; }else{ // Color by hexadecimal int rColor = attrs.getAttributeIntValue(MATERIALDESIGNXML, "rippleColor", -1);// 16进制的颜色 if(rColor != -1 && !isInEditMode()) { rippleColor = rColor; settedRippleColor = true; } } /** * 初始化涟漪扩展的速度 * init Ripple speed */ rippleSpeed = attrs.getAttributeFloatValue(MATERIALDESIGNXML, "rippleSpeed", rippleSpeed); /** * 设定涟漪的响应时间 */ clickAfterRipple = attrs.getAttributeBooleanValue(MATERIALDESIGNXML, "clickAfterRipple", clickAfterRipple); }
Example 3
Source File: RippleView.java From XERUNG with Apache License 2.0 | 5 votes |
protected void setRippleAttributes(AttributeSet attrs) { /** * 初始化按压时涟漪的颜色 * Set Ripple Color * Color by resource */ int color = attrs.getAttributeResourceValue(MATERIALDESIGNXML,"rippleColor",-1); if(color != -1){ rippleColor = getResources().getColor(color); settedRippleColor = true; }else{ // Color by hexadecimal int rColor = attrs.getAttributeIntValue(MATERIALDESIGNXML, "rippleColor", -1);// 16进制的颜色 if(rColor != -1 && !isInEditMode()) { rippleColor = rColor; settedRippleColor = true; } } /** * 初始化涟漪扩展的速度 * init Ripple speed */ rippleSpeed = attrs.getAttributeFloatValue(MATERIALDESIGNXML, "rippleSpeed", rippleSpeed); /** * 设定涟漪的响应时间 */ clickAfterRipple = attrs.getAttributeBooleanValue(MATERIALDESIGNXML, "clickAfterRipple", clickAfterRipple); }
Example 4
Source File: AspectRatioLayout.java From commcare-android with Apache License 2.0 | 5 votes |
private void initializeRatio(AttributeSet attrs) { if(!isInEditMode()) { String namespace = "http://schemas.android.com/apk/lib/" + this.getClass().getPackage().getName(); mRatioWidth = attrs.getAttributeFloatValue(namespace, "ratio_width", 1); mRatioHeight = attrs.getAttributeFloatValue(namespace, "ratio_height", 1); } }
Example 5
Source File: LayoutRipple.java From XERUNG with Apache License 2.0 | 4 votes |
@Override protected void setAttributes(AttributeSet attrs) { super.setAttributes(attrs); //设定涟漪最外层的边界弧度,是圆角矩形,如果不设置,则是普通矩形 rippleBorderRadius = attrs.getAttributeFloatValue(MATERIALDESIGNXML, "rippleBorderRadius", 0); }
Example 6
Source File: LayoutRipple.java From XERUNG with Apache License 2.0 | 4 votes |
@Override protected void setAttributes(AttributeSet attrs) { super.setAttributes(attrs); //设定涟漪最外层的边界弧度,是圆角矩形,如果不设置,则是普通矩形 rippleBorderRadius = attrs.getAttributeFloatValue(MATERIALDESIGNXML, "rippleBorderRadius", 0); }