sample/src/main/java/com/gordonwong/materialsheetfab/sample/Fab.java
@Override
	public void show(float translationX, float translationY) {
		// Set FAB's translation
		setTranslation(translationX, translationY);

		// Only use scale animation if FAB is hidden
		if (getVisibility() != View.VISIBLE) {
			// Pivots indicate where the animation begins from
			float pivotX = getPivotX() + translationX;
			float pivotY = getPivotY() + translationY;

			ScaleAnimation anim;
			// If pivots are 0, that means the FAB hasn't been drawn yet so just use the
			// center of the FAB
			if (pivotX == 0 || pivotY == 0) {
				anim = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f,
						Animation.RELATIVE_TO_SELF, 0.5f);
			} else {
				anim = new ScaleAnimation(0, 1, 0, 1, pivotX, pivotY);
			}

			// Animate FAB expanding
			anim.setDuration(FAB_ANIM_DURATION);
			anim.setInterpolator(getInterpolator());
			startAnimation(anim);
		}
		setVisibility(View.VISIBLE);
	}
@Override
	public void show(float translationX, float translationY) {
		// Set FAB's translation
		setTranslation(translationX, translationY);

		// Only use scale animation if FAB is hidden
		if (getVisibility() != View.VISIBLE) {
			// Pivots indicate where the animation begins from
			float pivotX = getPivotX() + translationX;
			float pivotY = getPivotY() + translationY;

			ScaleAnimation anim;
			// If pivots are 0, that means the FAB hasn't been drawn yet so just use the
			// center of the FAB
			if (pivotX == 0 || pivotY == 0) {
				anim = new ScaleAnimation(0, 1, 0, 1, Animation.RELATIVE_TO_SELF, 0.5f,
						Animation.RELATIVE_TO_SELF, 0.5f);
			} else {
				anim = new ScaleAnimation(0, 1, 0, 1, pivotX, pivotY);
			}

			// Animate FAB expanding
			anim.setDuration(FAB_ANIM_DURATION);
			anim.setInterpolator(getInterpolator());
			startAnimation(anim);
		}
		setVisibility(View.VISIBLE);
	}
@ Override public void show ( float translationX , float translationY ) { // Set FAB's translation setTranslation ( translationX , translationY ) ; // Only use scale animation if FAB is hidden if ( getVisibility ( ) != View . VISIBLE ) { // Pivots indicate where the animation begins from float pivotX = getPivotX ( ) + translationX ; float pivotY = getPivotY ( ) + translationY ; ScaleAnimation anim ; // If pivots are 0, that means the FAB hasn't been drawn yet so just use the // center of the FAB if ( pivotX == 0 || pivotY == 0 ) { anim = new ScaleAnimation ( 0 , 1 , 0 , 1 , Animation . RELATIVE_TO_SELF , 0.5f , Animation . RELATIVE_TO_SELF , 0.5f ) ; } else { anim = new ScaleAnimation ( 0 , 1 , 0 , 1 , pivotX , pivotY ) ; } // Animate FAB expanding anim . setDuration ( FAB_ANIM_DURATION ) ; anim . setInterpolator ( getInterpolator ( ) ) ; startAnimation ( anim ) ; } setVisibility ( View . VISIBLE ) ; }
Shows the FAB and sets the FAB's translation.

@param translationX translation X value
@param translationY translation Y value
Shows the FAB and sets the FAB s translation .