List of usage examples for android.graphics.drawable RippleDrawable setHotspot
@Override public void setHotspot(float x, float y)
From source file:com.winneredge.stockly.wcommons.floatingactionwidget.FloatingActionButton.java
@TargetApi(Build.VERSION_CODES.LOLLIPOP) void onActionUp() { if (mBackgroundDrawable instanceof StateListDrawable) { StateListDrawable drawable = (StateListDrawable) mBackgroundDrawable; drawable.setState(new int[] { android.R.attr.state_enabled }); } else if (Util.hasLollipop()) { RippleDrawable ripple = (RippleDrawable) mBackgroundDrawable; ripple.setState(new int[] { android.R.attr.state_enabled }); ripple.setHotspot(calculateCenterX(), calculateCenterY()); ripple.setVisible(true, true);//from w w w . j a v a2s . c o m } }
From source file:com.winneredge.stockly.wcommons.floatingactionwidget.FloatingActionButton.java
@TargetApi(Build.VERSION_CODES.LOLLIPOP) void onActionDown() { if (mBackgroundDrawable instanceof StateListDrawable) { StateListDrawable drawable = (StateListDrawable) mBackgroundDrawable; drawable.setState(new int[] { android.R.attr.state_enabled, android.R.attr.state_pressed }); } else if (Util.hasLollipop()) { RippleDrawable ripple = (RippleDrawable) mBackgroundDrawable; ripple.setState(new int[] { android.R.attr.state_enabled, android.R.attr.state_pressed }); ripple.setHotspot(calculateCenterX(), calculateCenterY()); ripple.setVisible(true, true);/*from w w w. jav a2 s . c om*/ } }