Skip to content
This repository has been archived by the owner on Aug 26, 2019. It is now read-only.

Commit

Permalink
调整阅读界面滑调消失显示动画
Browse files Browse the repository at this point in the history
  • Loading branch information
seven332 committed Nov 12, 2014
1 parent fbd9e93 commit 0631c29
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions src/com/hippo/ehviewer/ui/GalleryActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,26 +86,30 @@ private void cancelFullScreenTask() {
void setFullScreen(final boolean fullScreen) {
mFullScreenHelper.setFullScreen(fullScreen);

AlphaAnimation aa = fullScreen ? new AlphaAnimation(1.0f, 0.0f) : new AlphaAnimation(0.0f, 1.0f);
aa.setDuration(Constants.ANIMATE_TIME);
aa.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
mFooter.setVisibility(View.VISIBLE);
}

@Override
public void onAnimationEnd(Animation animation) {
if (fullScreen)
mFooter.setVisibility(View.INVISIBLE);
}

@Override
public void onAnimationRepeat(Animation animation) {
// Empty
}
});
mFooter.startAnimation(aa);
if (!(fullScreen && mFooter.getVisibility() == View.GONE) &&
!(!fullScreen && mFooter.getVisibility() == View.VISIBLE)) {
AlphaAnimation aa = fullScreen ? new AlphaAnimation(1.0f, 0.0f) :
new AlphaAnimation(0.0f, 1.0f);
aa.setDuration(Constants.ANIMATE_TIME);
aa.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
mFooter.setVisibility(View.VISIBLE);
}

@Override
public void onAnimationEnd(Animation animation) {
if (fullScreen)
mFooter.setVisibility(View.GONE);
}

@Override
public void onAnimationRepeat(Animation animation) {
// Empty
}
});
mFooter.startAnimation(aa);
}

if (!fullScreen)
startFullScreenTask();
Expand Down

0 comments on commit 0631c29

Please sign in to comment.