Example #1
0
  private void startRipple() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      final CoordinatorLayout coordinatorLayout =
          (CoordinatorLayout) findViewById(R.id.coordinator_layout);
      Drawable d = coordinatorLayout.getBackground();
      final RippleDrawable rippleDrawable = (RippleDrawable) d;
      rippleDrawable.setHotspot(
          mReset.getX() + mReset.getWidth() / 2, mReset.getY() + mReset.getHeight() / 2);
      rippleDrawable.setState(
          new int[] {android.R.attr.state_pressed, android.R.attr.state_enabled});
      coordinatorLayout.getBackground().setState(new int[] {});
    }

    mReset.hide();
    mElapsedTime = 0;
    setTime();
  }
Example #2
0
 public Pair<Float, Float> getFabPosition() {
   return new Pair<Float, Float>(fab.getX(), fab.getY());
 }