use of com.rey.material.drawable.ToolbarRippleDrawable in project material by rey5137.
the class RippleManager method onClick.
@Override
public void onClick(View v) {
Drawable background = v.getBackground();
long delay = 0;
if (background != null) {
if (background instanceof RippleDrawable)
delay = ((RippleDrawable) background).getClickDelayTime();
else if (background instanceof ToolbarRippleDrawable)
delay = ((ToolbarRippleDrawable) background).getClickDelayTime();
}
if (delay > 0 && v.getHandler() != null && !mClickScheduled) {
mClickScheduled = true;
v.getHandler().postDelayed(new ClickRunnable(v), delay);
} else
dispatchClickEvent(v);
}
use of com.rey.material.drawable.ToolbarRippleDrawable in project material by rey5137.
the class ToolbarManager method onGlobalLayout.
private void onGlobalLayout() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
mToolbar.getViewTreeObserver().removeOnGlobalLayoutListener(mOnGlobalLayoutListener);
else
mToolbar.getViewTreeObserver().removeGlobalOnLayoutListener(mOnGlobalLayoutListener);
ActionMenuView menuView = getMenuView();
for (int i = 0, count = menuView == null ? 0 : menuView.getChildCount(); i < count; i++) {
View child = menuView.getChildAt(i);
if (mRippleStyle != 0) {
if (child.getBackground() == null || !(child.getBackground() instanceof ToolbarRippleDrawable))
ViewUtil.setBackground(child, getBackground());
}
}
if (mGroupChanged) {
animateIn();
mGroupChanged = false;
}
}
Aggregations