List of usage examples for android.graphics.drawable RippleDrawable setState
public boolean setState(@NonNull final int[] stateSet)
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);//ww w.j a v a 2s .c o m } }
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 ww . ja v a 2 s . c om } }