@TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void drawableHotspotChanged(float x, float y) { super.drawableHotspotChanged(x, y); if (mIndicator != null) { mIndicator.setHotspot(x, y); } }
@SuppressLint("ClickableViewAccessibility") @Override public boolean onTouch(View v, MotionEvent event) { // Convert to view coordinates. Assumes the host view is // a direct child and the view is not scrollable. float x = event.getX() + v.getLeft(); float y = event.getY() + v.getTop(); final View rippleView = findRippleView(v); //if we were not able to find the view to display the ripple on, continue. if (rippleView == null) { return false; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { // Simulate motion on the view. rippleView.drawableHotspotChanged(x, y); } // Simulate pressed state on the view. switch (event.getActionMasked()) { case MotionEvent.ACTION_DOWN: rippleView.setPressed(true); break; case MotionEvent.ACTION_UP: case MotionEvent.ACTION_CANCEL: rippleView.setPressed(false); break; } // Pass all events through to the host view. return false; }
@TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void drawableHotspotChanged(float x, float y) { super.drawableHotspotChanged(x, y); if (mIndicator != null) { mIndicator.setHotspot(x, y); } }
@TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void drawableHotspotChanged(float x, float y) { super.drawableHotspotChanged(x, y); if (mIndicator != null) { mIndicator.setHotspot(x, y); } }
@Override public boolean onTouchEvent(MotionEvent event) { if (Build.VERSION.SDK_INT >= 21) { selector.drawableHotspotChanged(event.getX(), event.getY()); } return super.onTouchEvent(event); } }
@TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void drawableHotspotChanged(float x, float y) { super.drawableHotspotChanged(x, y); if (mIndicator != null) { mIndicator.setHotspot(x, y); } }
@Override public boolean onTouchEvent(MotionEvent event) { if (Build.VERSION.SDK_INT >= 21) { selector.drawableHotspotChanged(event.getX(), event.getY()); } return super.onTouchEvent(event); } }
child.getBackground().setVisible(true, false); child.drawableHotspotChanged(x, y - child.getTop());