use of us.pinguo.edit.sdk.base.widget.AnimationAdapter in project PhotoNoter by yydcdut.
the class PGEditView method hideEffectBackWithAnimation.
public void hideEffectBackWithAnimation() {
AlphaAnimation alphaAnimation = new AlphaAnimation(1f, 0f);
alphaAnimation.setDuration(PGEditConstants.EFFECT_ANIMATION_TIME);
alphaAnimation.setAnimationListener(new AnimationAdapter() {
@Override
public void onAnimationEnd(Animation animation) {
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
mEffectBackView.setVisibility(View.GONE);
}
});
}
});
mEffectBackView.startAnimation(alphaAnimation);
mEffectBackView.setOnClickListener(null);
}
use of us.pinguo.edit.sdk.base.widget.AnimationAdapter in project PhotoNoter by yydcdut.
the class PGEditView method hideBottomSecondMenuWithAnimation.
public void hideBottomSecondMenuWithAnimation() {
if (Build.VERSION.SDK_INT >= 11) {
float secondBottomHeight = mActivity.getResources().getDimension(R.dimen.pg_sdk_edit_second_bottom_height);
TranslateAnimation translateAnimation = new TranslateAnimation(0f, 0f, 0f, secondBottomHeight);
translateAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
translateAnimation.setDuration(ANIMATION_TIME);
translateAnimation.setAnimationListener(new AnimationAdapter() {
@Override
public void onAnimationEnd(Animation animation) {
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (null != mMenuListener) {
mMenuListener.onHideBottomSecondMenuWithAnimationFinish();
}
}
});
}
});
mSecondMenusLayout.startAnimation(translateAnimation);
mFirstHorizontalLayout.setVisibility(View.VISIBLE);
float bottomHeight = mActivity.getResources().getDimension(R.dimen.pg_sdk_edit_bottom_height);
TranslateAnimation firstTranslateAnimation = new TranslateAnimation(0f, 0f, bottomHeight, 0f);
firstTranslateAnimation.setDuration(ANIMATION_TIME);
firstTranslateAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
AlphaAnimation firstAlphaAnimation = new AlphaAnimation(0f, 1f);
firstAlphaAnimation.setDuration(ANIMATION_TIME);
firstAlphaAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
AnimationSet animationSet = new AnimationSet(true);
animationSet.addAnimation(firstTranslateAnimation);
animationSet.addAnimation(firstAlphaAnimation);
mFirstHorizontalLayout.startAnimation(animationSet);
} else {
if (null != mMenuListener) {
mMenuListener.onHideBottomSecondMenuWithAnimationFinish();
}
mFirstHorizontalLayout.setVisibility(View.VISIBLE);
}
}
use of us.pinguo.edit.sdk.base.widget.AnimationAdapter in project PhotoNoter by yydcdut.
the class PGEditView method changeSecondBottomLayoutWithAnimation.
public void changeSecondBottomLayoutWithAnimation() {
AlphaAnimation backAlphaAnimation = new AlphaAnimation(1f, 0f);
backAlphaAnimation.setDuration(PGEditConstants.EFFECT_BOTTOM_ANIMATION_TIME);
backAlphaAnimation.setAnimationListener(new AnimationAdapter() {
@Override
public void onAnimationEnd(Animation animation) {
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
mBackMainView.setVisibility(View.GONE);
}
});
}
});
mBackMainView.startAnimation(backAlphaAnimation);
AlphaAnimation nameAlphaAnimation = new AlphaAnimation(1f, 0f);
nameAlphaAnimation.setDuration(PGEditConstants.EFFECT_BOTTOM_ANIMATION_TIME);
nameAlphaAnimation.setAnimationListener(new AnimationAdapter() {
@Override
public void onAnimationEnd(Animation animation) {
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (null != mMenuListener) {
mMenuListener.onChangeSecondBottomLayoutWithAnimationFinish();
}
AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f);
alphaAnimation.setDuration(PGEditConstants.EFFECT_BOTTOM_ANIMATION_TIME);
mSecondBottomName.startAnimation(alphaAnimation);
}
});
}
});
mSecondBottomName.startAnimation(nameAlphaAnimation);
AlphaAnimation savePhotoAlphaAnimation = new AlphaAnimation(1f, 0f);
savePhotoAlphaAnimation.setDuration(PGEditConstants.EFFECT_BOTTOM_ANIMATION_TIME);
savePhotoAlphaAnimation.setAnimationListener(new AnimationAdapter() {
@Override
public void onAnimationEnd(Animation animation) {
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f);
alphaAnimation.setDuration(PGEditConstants.EFFECT_BOTTOM_ANIMATION_TIME);
mSaveEffectView.startAnimation(alphaAnimation);
}
});
}
});
mSaveEffectView.startAnimation(savePhotoAlphaAnimation);
}
use of us.pinguo.edit.sdk.base.widget.AnimationAdapter in project PhotoNoter by yydcdut.
the class PGEditView method showBottomSecondMenuWithAnimation.
public void showBottomSecondMenuWithAnimation() {
mSecondMenusLayout.setVisibility(View.VISIBLE);
if (Build.VERSION.SDK_INT >= 11) {
float secondBottomHeight = mActivity.getResources().getDimension(R.dimen.pg_sdk_edit_second_bottom_height);
TranslateAnimation translateAnimation = new TranslateAnimation(0f, 0f, secondBottomHeight, 0f);
translateAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
translateAnimation.setDuration(ANIMATION_TIME);
mSecondMenusLayout.startAnimation(translateAnimation);
float bottomHeight = mActivity.getResources().getDimension(R.dimen.pg_sdk_edit_bottom_height);
TranslateAnimation firstTranslateAnimation = new TranslateAnimation(0f, 0f, 0f, bottomHeight);
firstTranslateAnimation.setDuration(ANIMATION_TIME);
firstTranslateAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
AlphaAnimation firstAlphaAnimation = new AlphaAnimation(1f, 0f);
firstAlphaAnimation.setDuration(ANIMATION_TIME);
firstAlphaAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
AnimationSet animationSet = new AnimationSet(true);
animationSet.addAnimation(firstTranslateAnimation);
animationSet.addAnimation(firstAlphaAnimation);
animationSet.setAnimationListener(new AnimationAdapter() {
@Override
public void onAnimationEnd(Animation animation) {
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
mFirstHorizontalLayout.setVisibility(View.INVISIBLE);
}
});
}
});
mFirstHorizontalLayout.startAnimation(animationSet);
} else {
mFirstHorizontalLayout.setVisibility(View.INVISIBLE);
}
}
use of us.pinguo.edit.sdk.base.widget.AnimationAdapter in project PhotoNoter by yydcdut.
the class PGEditView method resetSecondBottomLayoutWithAnimation.
public void resetSecondBottomLayoutWithAnimation() {
mBackMainView.setVisibility(View.VISIBLE);
AlphaAnimation backAlphaAnimation = new AlphaAnimation(0f, 1f);
backAlphaAnimation.setDuration(PGEditConstants.EFFECT_ANIMATION_TIME);
mBackMainView.startAnimation(backAlphaAnimation);
AlphaAnimation nameAlphaAnimation = new AlphaAnimation(1f, 0f);
nameAlphaAnimation.setDuration(PGEditConstants.EFFECT_BOTTOM_ANIMATION_TIME);
nameAlphaAnimation.setAnimationListener(new AnimationAdapter() {
@Override
public void onAnimationEnd(Animation animation) {
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (null != mMenuListener) {
mMenuListener.onResetSecondBottomLayoutWithAnimationFinish();
}
AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f);
alphaAnimation.setDuration(PGEditConstants.EFFECT_BOTTOM_ANIMATION_TIME);
mSecondBottomName.startAnimation(alphaAnimation);
}
});
}
});
mSecondBottomName.startAnimation(nameAlphaAnimation);
AlphaAnimation savePhotoAlphaAnimation = new AlphaAnimation(1f, 0f);
savePhotoAlphaAnimation.setDuration(PGEditConstants.EFFECT_BOTTOM_ANIMATION_TIME);
savePhotoAlphaAnimation.setAnimationListener(new AnimationAdapter() {
@Override
public void onAnimationEnd(Animation animation) {
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f);
alphaAnimation.setDuration(PGEditConstants.EFFECT_BOTTOM_ANIMATION_TIME);
mSaveEffectView.startAnimation(alphaAnimation);
}
});
}
});
mSaveEffectView.startAnimation(savePhotoAlphaAnimation);
}
Aggregations