1.左侧滑出
private Animation myAnimation_Translate;
private LinearLayout mLinearLayout; //滑动布局
/**
*
* 左侧滑出
*
**/
myAnimation_Translate = new TranslateAnimation(
Animation.RELATIVE_TO_PARENT, -1,
Animation.RELATIVE_TO_PARENT, 0,
Animation.RELATIVE_TO_PARENT, 0,
Animation.RELATIVE_TO_PARENT, 0);
myAnimation_Translate.setDuration(1000);
myAnimation_Translate.setInterpolator(AnimationUtils
.loadInterpolator(mContext,
android.R.anim.accelerate_decelerate_interpolator));
mLinearLayout.startAnimation(myAnimation_Translate);
mLinearLayout.setVisibility(View.VISIBLE);
2.左滑隐藏
myAnimation_Translate = new TranslateAnimation(
Animation.RELATIVE_TO_PARENT, 0,
Animation.RELATIVE_TO_PARENT, -1,
Animation.RELATIVE_TO_PARENT, 0,
Animation.RELATIVE_TO_PARENT, 0
);
myAnimation_Translate.setDuration(1000);
myAnimation_Translate.setInterpolator(AnimationUtils
.loadInterpolator(mContext,
android.R.anim.accelerate_decelerate_interpolator));
mLinearLayout.startAnimation(myAnimation_Translate);
mLinearLayout.setVisibility(View.GONE);