Code example for ImageView

Methods: startAnimation

0
		} 
		initAnimations(); 
	} 
 
	public void open() { 
		mCover.startAnimation(mStartAnimation);
	} 
 
	public void close() { 
		mCover.startAnimation(mStopAnimation);
	} 
 
	protected void initAnimations() { 
		int displayWidth = ((WindowManager) mActivity.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getWidth();
		final int shift = (mReverse ? -1 : 1) * (sWidth - displayWidth);
		mStartAnimation = new TranslateAnimation(
				TranslateAnimation.ABSOLUTE, 0,
				TranslateAnimation.ABSOLUTE, -shift,
				TranslateAnimation.ABSOLUTE, 0,
				TranslateAnimation.ABSOLUTE, 0
				);